/**
 * Coompare — CSS nativo para product cards
 * Substitui os 112KB do Affiliatable plugin quando modo_produtos == 'nativo'
 * Classes cg-* mantidas para compatibilidade com tracking existente
 */

:root {
  --cg-orange: #f39c12;
  --cg-red: #e74c3c;
  --cg-gray: #95a5a6;
  --cg-blue: #3498db;
  --cg-black: #2f3640;
  --cg-green: #27ae60;
  --cg-darkorange: #F33B19;
  --cg-theme-color: #333;
}

/* ======= Color Themes ======= */
.cg-black { --cg-theme-color: var(--cg-black) }
.cg-red { --cg-theme-color: var(--cg-red) }
.cg-green { --cg-theme-color: var(--cg-green) }
.cg-darkorange { --cg-theme-color: var(--cg-darkorange) }

/* ======= Card Container ======= */
.cg-box-accord-one {
  margin: 40px 0;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 5px;
  /* visible: o selo numérico (.cg-row-number) fica parcialmente fora da borda — hidden cortava o círculo */
  overflow: visible;
  position: relative;
  z-index: 0;
}

.cg-box-accord-one .cg-box-accord-items:not(:last-child)::after { display: none }

/* Top 3 borders */
.cg-box-accord-one:nth-of-type(1) { border: 3px solid #2ecc71; border-radius: 5px }
.cg-box-accord-one:nth-of-type(2) { border: 3px solid #3498db; border-radius: 5px }
.cg-box-accord-one:nth-of-type(3) { border: 3px solid #9b59b6; border-radius: 5px }

/* ======= Table Row Layout ======= */
.cg-tbl-row {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 15px 12px 15px 18px;
  gap: 0;
  box-sizing: border-box;
  border-radius: 4px;
}

.cg-tbl-img-col {
  position: relative;
  overflow: visible;
  flex: 0 0 auto;
  width: 175px;
  max-width: 175px;
  text-align: center;
  box-sizing: border-box;
}

.cg-tbl-desc-col {
  flex: 0 0 calc(100% - 175px - 270px);
  max-width: calc(100% - 175px - 270px);
  min-width: 200px;
  box-sizing: border-box;
}

.cg-tbl-btn-col {
  padding-right: 25px;
  flex: 0 0 270px;
  max-width: 270px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  text-align: center;
  box-sizing: border-box;
}

/* ======= Row Number (sobre a borda esquerda, como no Affiliatable) ======= */
.cg-row-number {
  position: absolute;
  top: -6px;
  left: -18px;
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  background: var(--cg-theme-color);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  border-radius: 50%;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.cg-box-accord-one:nth-of-type(1) .cg-row-number { background-color: #2ecc71 }
.cg-box-accord-one:nth-of-type(2) .cg-row-number { background-color: #3498db !important }
.cg-box-accord-one:nth-of-type(3) .cg-row-number { background-color: #9b59b6 !important }
.cg-box-accord-one:nth-of-type(n+4) .cg-row-number { background-color: #999 !important }

/* ======= Product Image ======= */
.cg-tbl-img {
  display: block;
  text-decoration: none;
}

.cg-img-1 {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  aspect-ratio: 1/1;
  object-fit: contain;
}

.cg-tbl-img img {
  transition: none !important;
}

/* ======= Ribbon / Badge ======= */
.cg-tbl-ribbon {
  margin-bottom: 8px;
}

.cg-tbl-ribbon small {
  display: inline-block;
  padding: 8px 20px;
  font-weight: 500;
  font-size: 12px;
  border-radius: 5px;
  color: #fff;
  background-color: #999;
}

.cg-tbl-ribbon small::after { opacity: 0 !important }

.cg-box-accord-one:nth-of-type(1) .cg-tbl-ribbon small { background-color: #2ecc71; color: #fff !important }
.cg-box-accord-one:nth-of-type(2) .cg-tbl-ribbon small { background-color: #3498db; color: #fff !important }
.cg-box-accord-one:nth-of-type(3) .cg-tbl-ribbon small { background-color: #9b59b6; color: #fff !important }
.cg-box-accord-one:nth-of-type(n+4) .cg-tbl-ribbon small { background-color: #999 !important; color: #fff !important }

/* ======= Title ======= */
.cg-table-title {
  color: #333 !important;
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
  margin-top: 10px;
  line-height: 1.3;
}

a.cg-table-title:hover {
  text-decoration: underline;
}

/* ======= Specs List ======= */
.cg-tbl-ul {
  margin-top: 8px;
}

.cg-tbl-ul ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cg-tbl-ul ul li {
  position: relative;
  margin: 0;
  padding: 1px 0 1px 26px;
  font-size: 15px;
  color: #222;
  line-height: 1.35;
}

@media (min-width: 768px) {
  .cg-tbl-ul ul li {
    font-size: 16px;
    padding-top: 2px;
    padding-bottom: 2px;
  }
}

.cg-tbl-ul ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.22em;
  font-size: 1.05em;
  line-height: 1;
  color: var(--cg-theme-color);
  font-weight: 700;
}

/* ======= CTA Buttons ======= */
.cg-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.cg-btn.cg-btn-lg {
  min-width: 230px !important;
  padding: 12px 24px;
  font-size: 15px !important;
  font-weight: 600;
  border-radius: 8px;
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.cg-btn-gr-active {
  background: linear-gradient(60deg, #f79533, #f37055, #ef4e7b, #a166ab, #5073b8, #1098ad, #07b39b, #6fba82);
  -webkit-animation: 3s infinite alternate gradientAnim;
  animation: 3s infinite alternate gradientAnim;
  background-size: 300% 300%;
}

@-webkit-keyframes gradientAnim {
  0%, to { background-position: 0 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes gradientAnim {
  0%, to { background-position: 0 50%; }
  50% { background-position: 100% 50%; }
}

.cg-btn.cg-btn-lg:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.cg-btn.cg-btn-lg:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.cg-one-button {
  background: linear-gradient(60deg, #ef4e7b, #a166ab, #5073b8, #1098ad);
  background-size: 300% 300%;
  color: #fff !important;
}

.cg-second-button {
  background: linear-gradient(60deg, #a166ab, #ef4e7b, #1098ad, #5073b8);
  background-size: 300% 300%;
  color: #fff !important;
}

.cta-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Store icons before button text */
a.cg-btn[href*="amazon.com.br"]::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  background-image: url('https://www.coompare.com.br/wp-content/uploads/2025/01/amazon-botao.png');
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 8px;
  vertical-align: middle;
}

a.cg-btn[href*="mercadolivre.com"]::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  background-image: url('https://www.coompare.com.br/wp-content/uploads/2025/01/ml-botao2.png');
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 8px;
  vertical-align: middle;
}

a.cg-btn[href*="shopee.com.br"]::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 20px;
  margin-bottom: 4px;
  background-image: url('https://www.coompare.com.br/wp-content/uploads/2025/05/shopee-logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 8px;
  vertical-align: middle;
}

/* ======= Expand / Details ======= */
.cg-expand {
  padding: 10px;
  text-align: center;
}

details.cg-expand summary {
  display: inline-block !important;
  padding: 5px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  background: #fff !important;
  color: #614BC3 !important;
  border: 1px solid #614BC3 !important;
}

details.cg-expand summary::before { display: none }

details.cg-expand summary::-webkit-details-marker { display: none }

.cg-box-accord-content {
  padding: 15px 20px;
}

.cg-text {
  font-size: 14px;
  line-height: 1.7;
  color: #444;
}

.cg-text p {
  text-align: left;
  margin-bottom: 10px;
}

/* ======= Prós & Contras (paridade com Affiliatable — cg-pc-box-two) ======= */
.product-box-pros-cons {
  padding: 16px 20px 20px;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #614bc3;
  border-radius: 8px;
  box-sizing: border-box;
}

.cg-pc-box-two {
  width: 100%;
  margin: 0;
  position: relative;
}

.cg-pc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  box-sizing: border-box;
  width: 100%;
  justify-content: space-between;
}

.cg-pc-row .cg-item-cons,
.cg-pc-row .cg-item-pros {
  max-width: calc(50% - 14px);
  flex: 0 0 calc(50% - 14px);
  min-width: 0;
  background-color: #fff;
  box-sizing: border-box;
}

/* Card interno + “L” na esquerda/inferior (cor = --cg-theme-color de .cg-green / .cg-red) */
.cg-pc-box-two .cg-pc-row .cg-item-cons,
.cg-pc-box-two .cg-pc-row .cg-item-pros {
  padding: 20px 28px;
  position: relative;
  margin: 0 0 5px 5px;
  box-shadow: 0 3px 12px 0 rgba(79, 79, 79, 0.09);
}

/* Dentro do acordeão, Affiliatable não usa box-shadow nos blocos */
.cg-box-accord-one .cg-box-accord-items .product-box-pros-cons .cg-pc-box-two .cg-pc-row .cg-item-cons,
.cg-box-accord-one .cg-box-accord-items .product-box-pros-cons .cg-pc-box-two .cg-pc-row .cg-item-pros {
  box-shadow: none;
}

.cg-pc-box-two .cg-pc-row .cg-item-cons::after,
.cg-pc-box-two .cg-pc-row .cg-item-pros::after {
  content: "";
  position: absolute;
  left: -5px;
  bottom: -5px;
  height: 60%;
  width: 90%;
  border-left: 5px solid var(--cg-theme-color);
  border-bottom: 5px solid var(--cg-theme-color);
  pointer-events: none;
  box-sizing: border-box;
}

/* Títulos pretos + traço curto colorido (não título verde/vermelho inteiro) */
.cg-pc-box-two .cg-cons-name,
.cg-pc-box-two .cg-pros-name {
  color: #303030;
  text-align: left;
  padding: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
  position: relative;
  border: none;
}

.cg-pc-box-two .cg-cons-name::after,
.cg-pc-box-two .cg-pros-name::after {
  content: "";
  height: 2px;
  width: 40px;
  position: absolute;
  bottom: 2px;
  left: 0;
  background-color: var(--cg-theme-color);
}

.cg-pc-box-two ul {
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
}

.cg-pc-box-two ul li {
  display: block;
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.55;
  color: #303030;
  text-align: left;
}

.cg-pc-box-two ul li:not(:last-child) {
  margin-bottom: 10px;
}

/* Bolinha (Affiliatable), não ✓ / ✗ */
.cg-pc-box-two ul li::before {
  content: "";
  height: 7px;
  width: 7px;
  border-radius: 100%;
  background-color: var(--cg-theme-color);
  position: relative;
  left: -8px;
  display: inline-block;
  vertical-align: middle;
  margin-left: -7px;
  top: -1px;
}

/* ======= Mobile Responsive ======= */
@media (min-width: 768px) {
  .cg-table-title {
    display: inline-block;
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
  }
}

@media (max-width: 767px) {
  .cg-tbl-row {
    flex-direction: column;
    flex-wrap: wrap;
    text-align: center;
    gap: 10px;
    padding: 20px;
  }

  .cg-tbl-img-col {
    width: 100%;
    max-width: 100%;
  }

  .cg-tbl-img {
    width: 180px !important;
    height: 180px !important;
    margin: 0 auto !important;
  }

  .cg-tbl-img img {
    max-width: 95% !important;
    max-height: 95% !important;
  }

  .cg-tbl-desc-col {
    max-width: 100%;
    flex: 1 1 100%;
    text-align: center;
  }

  .cg-table-title {
    width: 100%;
    text-align: center;
    margin-left: 0;
    margin-top: 20px;
  }

  .cg-tbl-ul ul li {
    text-align: left;
  }

  .cg-tbl-btn-col {
    flex: 1 1 100%;
    max-width: 100%;
    padding-right: 0;
    width: 100%;
  }

  .cg-btn.cg-btn-lg {
    min-width: 100% !important;
    padding: 14px 20px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    margin-bottom: 8px !important;
  }

  .cg-one-button.cg-btn-lg {
    box-shadow: 0 3px 8px rgba(0,0,0,0.12) !important;
  }

  /* Card já com overflow visible; evita encostar no viewport em telas estreitas */
  .cg-row-number {
    left: 4px !important;
    top: 4px !important;
  }

  .product-box-pros-cons {
    padding: 14px 16px 18px;
  }

  .cg-pc-row .cg-item-cons,
  .cg-pc-row .cg-item-pros {
    max-width: 100%;
    flex: 1 1 100%;
  }

  .cg-pc-box-two .cg-pc-row .cg-item-cons,
  .cg-pc-box-two .cg-pc-row .cg-item-pros {
    margin-left: 0;
    margin-bottom: 16px;
  }

  .cg-pc-row {
    flex-direction: column;
    gap: 0;
  }
}
