/*
 * ComprasGuate Theme — Product detail v1.8.0
 * Wolmart-inspired 3-col desktop + mobile-first stack with sticky buy bar.
 */

/* ============ PAGE WRAPPER ============ */
.cg-product18 { background: #F9FAFB; padding-bottom: 80px; color: var(--c-text); }
.cg-product18 .cg-container { max-width: 1600px; margin: 0 auto; padding: 0 24px; }

/* ============ BREADCRUMB ============ */
.cg-product18-crumbs { background: #fff; border-bottom: 1px solid var(--c-border); padding: 10px 0; font-size: 12px; color: var(--c-text-muted); }
.cg-product18-bc a { color: var(--c-text-muted); text-decoration: none; }
.cg-product18-bc a:hover { color: var(--c-blue); }
.cg-product18-bc .breadcrumb_last { color: var(--c-text); font-weight: 600; }

/* ============ DESKTOP GRID ============ */
.cg-product18-grid {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 420px 240px;
  gap: 20px;
  align-items: start;
  margin-top: 22px;
}

/* THUMB STRIP */
.cg-product18-thumbs { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; }
.cg-product18-thumbs::-webkit-scrollbar { width: 0; }
.cg-product18-thumb {
  aspect-ratio: 1;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.12s;
}
.cg-product18-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-product18-thumb:hover { border-color: rgba(30,115,190,0.4); }
.cg-product18-thumb.is-active { border-color: var(--c-blue); }

/* MAIN GALLERY */
.cg-product18-gallery { position: relative; }
.cg-product18-gallery-frame {
  position: relative;
  aspect-ratio: 1;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}
.cg-product18-gallery-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cg-product18-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  color: #fff;
  letter-spacing: 0.02em;
  z-index: 2;
}
.cg-product18-badge--hot { background: #16A34A; }
.cg-product18-badge--off { background: #1F2937; }
.cg-product18-zoom {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.95);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  z-index: 2;
}
.cg-product18-dots {
  display: none;
  justify-content: center;
  gap: 6px;
  padding-top: 10px;
}
.cg-product18-dots span { display: inline-block; width: 6px; height: 6px; border-radius: 999px; background: rgba(0,0,0,0.25); transition: all 0.15s; }
.cg-product18-dots span.is-active { width: 20px; background: var(--c-blue); }

/* ============ INFO COLUMN ============ */
.cg-product18-info { display: flex; flex-direction: column; }
.cg-product18-title { font-size: 22px; font-weight: 700; line-height: 1.25; margin: 0 0 10px; color: var(--c-text); }

.cg-product18-vendor {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--c-text);
  transition: border-color 0.12s;
}
.cg-product18-vendor:hover { border-color: var(--c-blue); }
.cg-product18-vendor-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
  color: var(--c-blue-darker);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  flex-shrink: 0;
}
.cg-product18-vendor-body { flex: 1; min-width: 0; }
.cg-product18-vendor-name { display: block; font-size: 13px; font-weight: 700; }
.cg-product18-vendor-meta { display: block; font-size: 11px; color: var(--c-text-muted); }
.cg-product18-vendor-tier { font-size: 11px; color: var(--c-text-muted); }
.cgmp-scorecard-badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; font-weight: 700; }
.cg-product18-vendor-cta { font-size: 11px; color: var(--c-blue); font-weight: 600; white-space: nowrap; }

.cg-product18-meta { font-size: 11px; color: var(--c-text-muted); margin-bottom: 10px; }
.cg-product18-meta a { color: var(--c-blue); text-decoration: none; }
.cg-product18-meta a:hover { text-decoration: underline; }
.cg-product18-meta code { background: #fff; border: 1px solid var(--c-border-soft); padding: 1px 6px; border-radius: 3px; font-size: 11px; }

.cg-product18-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  margin: 4px 0 10px;
}
.cg-product18-price-now { font-size: 26px; font-weight: 800; color: var(--c-sale); }
.cg-product18-price-now del { color: var(--c-text-tertiary); font-size: 14px; font-weight: 400; margin-left: 6px; }
.cg-product18-price-pill { background: #FEE2E2; color: #991B1B; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }

.cg-product18-rating { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 12px; }
.cg-product18-stars { color: #F59E0B; letter-spacing: 1px; }
.cg-product18-rating a { color: var(--c-blue); text-decoration: none; }
.cg-product18-rating a:hover { text-decoration: underline; }
.cg-product18-sold { color: var(--c-text-muted); }

.cg-product18-features { list-style: none; padding: 0; margin: 0 0 14px; font-size: 13px; color: var(--c-text); line-height: 1.7; }
.cg-product18-features li::before { content: '✓ '; color: #16A34A; font-weight: 700; }

/* Mobile-only trust pills strip (hidden on desktop) */
.cg-product18-trust-pills { display: none; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.cg-product18-trust-pills span { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--c-border); border-radius: 6px; padding: 6px 8px; font-size: 11px; font-weight: 600; color: var(--c-text); }
.cg-tp-icon { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-style: normal; flex-shrink: 0; }

/* BUY BOX */
.cg-product18-buy { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cg-product18-cart-form { display: flex; gap: 8px; margin: 0; }
.cg-product18-cart-form .quantity { display: inline-flex; align-items: center; border: 1px solid var(--c-border); border-radius: 6px; overflow: hidden; }
.cg-product18-cart-form .qty {
  width: 50px; text-align: center; border: 0; padding: 9px 0;
  font-size: 14px; font-weight: 600;
  background: #fff;
  appearance: textfield; -moz-appearance: textfield;
}
.cg-product18-cart-form .qty::-webkit-inner-spin-button { -webkit-appearance: none; }

.cg-product18-add {
  flex: 1;
  background: #FB923C;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s;
}
.cg-product18-add:hover { background: #EA580C; }

.cg-product18-buynow {
  display: block;
  text-align: center;
  background: #fff;
  border: 1.5px solid #FB923C;
  color: #FB923C;
  border-radius: 6px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  transition: all 0.12s;
}
.cg-product18-buynow:hover { background: #FFF7ED; color: #EA580C; border-color: #EA580C; }

.cg-product18-eta {
  background: #F0F9FF;
  border-left: 3px solid var(--c-blue);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  color: #1E40AF;
  margin-bottom: 10px;
}

.cg-product18-share {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--c-border);
  font-size: 12px;
}
.cg-product18-share-label { color: var(--c-text-muted); margin-right: 4px; }
.cg-product18-share a {
  width: 28px; height: 28px;
  background: #F3F4F6;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--c-text);
  text-decoration: none;
  transition: all 0.12s;
}
.cg-product18-share a:hover { background: var(--c-blue); color: #fff; }
.cg-product18-share-wa:hover { background: #25D366 !important; }

.cg-product18-ask {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--c-blue);
  font-weight: 600;
  text-decoration: none;
}
.cg-product18-ask:hover { text-decoration: underline; }

/* ============ TRUST COLUMN ============ */
.cg-product18-trust { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 16px; }
.cg-product18-trust-card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-lg); overflow: hidden; }
.cg-product18-trust-row {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border-soft);
}
.cg-product18-trust-row:last-child { border-bottom: 0; }
.cg-product18-trust-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.cg-product18-trust-row strong { display: block; font-size: 12px; color: var(--c-text); }
.cg-product18-trust-row span { display: block; font-size: 11px; color: var(--c-text-muted); }

.cg-product18-promo {
  display: block;
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  color: #7C2D12;
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  text-decoration: none;
}
.cg-product18-promo:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(245,158,11,0.25); }
.cg-product18-promo strong { display: block; font-size: 24px; font-weight: 900; }
.cg-product18-promo span { display: block; font-size: 12px; font-weight: 600; }

/* ============ MÁS DE LA TIENDA STRIP ============ */
.cg-product18-strip {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-top: 18px;
}
.cg-product18-strip header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cg-product18-strip header strong { font-size: 14px; }
.cg-product18-strip header a { font-size: 12px; color: var(--c-blue); font-weight: 600; text-decoration: none; }
.cg-product18-strip-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.cg-product18-strip-card { display: block; text-decoration: none; color: var(--c-text); }
.cg-product18-strip-thumb { aspect-ratio: 1; background: #F3F4F6; border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.cg-product18-strip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cg-product18-strip-name { font-size: 12px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px; }
.cg-product18-strip-price { font-size: 13px; font-weight: 800; color: var(--c-sale); margin-top: 2px; }

/* ============ TABS ============ */
.cg-product18-tabs { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 0 22px; margin-top: 18px; }
.cg-product18-tabs-nav { display: flex; gap: 22px; border-bottom: 1px solid var(--c-border); overflow-x: auto; }
.cg-product18-tabs-nav::-webkit-scrollbar { display: none; }
.cg-product18-tab {
  background: transparent; border: 0; padding: 14px 0 12px;
  font-size: 14px; font-weight: 600; color: var(--c-text-muted);
  cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all 0.12s;
}
.cg-product18-tab.is-active { color: #FB923C; border-bottom-color: #FB923C; }
.cg-product18-tab:hover:not(.is-active) { color: var(--c-text); }

.cg-product18-tab-panel { padding: 18px 0; }
.cg-product18-tab-panel[hidden] { display: none; }
.cg-product18-desc { font-size: 14px; line-height: 1.7; color: var(--c-text); margin-bottom: 16px; }
.cg-product18-desc p { margin: 0 0 12px; }

.cg-product18-promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.cg-product18-promise { border-radius: 8px; padding: 12px 14px; }
.cg-product18-promise strong { display: block; font-size: 13px; }
.cg-product18-promise p { font-size: 12px; margin: 4px 0 0; line-height: 1.5; }

.cg-product18-policy-list { list-style: none; padding: 0; margin: 0 0 14px; font-size: 14px; line-height: 1.8; }
.cg-product18-policy-list li { padding: 6px 0; border-bottom: 1px solid var(--c-border-soft); }
.cg-product18-policy-list li:last-child { border-bottom: 0; }

.cg-product18-vendor-cta-btn {
  display: inline-block;
  background: var(--c-blue);
  color: #fff;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.cg-product18-vendor-cta-btn:hover { background: var(--c-blue-dark); }

/* ============ RELATED ============ */
.cg-product18-related { margin-top: 22px; }
.cg-product18-related header { margin-bottom: 12px; }
.cg-product18-related h2 { font-size: 18px; font-weight: 800; margin: 0; }
.cg-product18-related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cg-product18-related-card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 10px; text-decoration: none; color: var(--c-text); transition: all 0.15s; }
.cg-product18-related-card:hover { border-color: var(--c-blue); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
.cg-product18-related-thumb { aspect-ratio: 1; background: #F3F4F6; border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.cg-product18-related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cg-product18-related-name { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.cg-product18-related-price { font-size: 14px; font-weight: 800; color: var(--c-sale); }

/* ============ STICKY BOTTOM BUY BAR (mobile only) ============ */
.cg-product18-sticky {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--c-border);
  padding: 10px 12px;
  gap: 8px;
  align-items: center;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
  z-index: 100;
}
.cg-product18-sticky-icon {
  background: transparent; border: 0;
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 18px; color: var(--c-text-muted);
  cursor: pointer; text-decoration: none;
}
.cg-product18-sticky-icon span { font-size: 9px; }
.cg-product18-sticky-add {
  flex: 1;
  background: #fff;
  color: #FB923C;
  border: 1.5px solid #FB923C;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.cg-product18-sticky-buy {
  flex: 1;
  background: #FB923C;
  color: #fff;
  border: 0;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

/* ============ RESPONSIVE BREAKPOINTS ============ */

/* 1280–1440px — narrow trust column slightly */
@media (max-width: 1439px) {
  .cg-product18-grid { grid-template-columns: 72px minmax(0, 1fr) 380px 220px; gap: 16px; }
  .cg-product18-info { font-size: 13px; }
}

/* 1100–1280px — drop trust column to a horizontal row below the gallery+info */
@media (max-width: 1279px) {
  .cg-product18-grid { grid-template-columns: 72px minmax(0, 1fr) 360px; gap: 16px; }
  .cg-product18-trust {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
    gap: 12px;
  }
  .cg-product18-trust-card { flex: 1 1 320px; }
  .cg-product18-promo { flex: 1 1 220px; }
  .cg-product18-trust-row { padding: 10px 12px; }
}

/* 900–1100px — info column drops below gallery; thumbs become horizontal */
@media (max-width: 1099px) {
  .cg-product18-grid { grid-template-columns: 60px minmax(0, 1fr); gap: 14px; }
  .cg-product18-thumbs { max-height: 480px; }
  .cg-product18-info { grid-column: 1 / -1; }
  .cg-product18-trust-card { flex: 1 1 100%; }
  .cg-product18-trust-card .cg-product18-trust-row { display: flex; }
  .cg-product18-promo { flex: 1 1 100%; }
  .cg-product18-strip-grid { grid-template-columns: repeat(5, 1fr); }
}

/* 720–900px — thumb strip moves below gallery */
@media (max-width: 899px) {
  .cg-product18-grid { grid-template-columns: minmax(0, 1fr); }
  .cg-product18-gallery { order: 1; }
  .cg-product18-thumbs { order: 2; flex-direction: row; max-height: none; overflow-x: auto; padding: 0 0 4px; }
  .cg-product18-thumb { width: 64px; flex-shrink: 0; }
  .cg-product18-info { order: 3; }
  .cg-product18-trust { order: 4; }
  .cg-product18-strip-grid { grid-template-columns: repeat(4, 1fr); }
  .cg-product18-related-grid { grid-template-columns: repeat(2, 1fr); }
  .cg-product18-promises { grid-template-columns: repeat(2, 1fr); }
}

/* < 720px — mobile stack with sticky bottom bar — v1.10.2 edge-to-edge gallery */
@media (max-width: 719px) {
  .cg-product18 { padding-bottom: 80px; }
  /* Tiny 4px breathing room — almost edge-to-edge */
  .cg-product18 .cg-container { padding: 0 4px; }
  .cg-product18-grid { gap: 10px; }

  .cg-product18-title { font-size: 16px; line-height: 1.25; }
  .cg-product18-price-now { font-size: 24px; }
  .cg-product18-vendor { padding: 6px 8px; }
  .cg-product18-vendor-logo { width: 28px; height: 28px; font-size: 11px; }

  /* GALLERY — full-bleed look on mobile to match reference designs.
     Slight negative margin breaks out of container padding; bottom radius
     stays for visual continuity with the thumb strip below. */
  .cg-product18-gallery-frame {
    border-radius: 8px;
    margin-left: -2px;
    margin-right: -2px;
  }
  .cg-product18-badge { top: 8px; left: 8px; font-size: 10px; padding: 3px 8px; }
  .cg-product18-zoom { bottom: 8px; right: 8px; }

  /* Tighter section cards on mobile so more content fits */
  .cg-product18-card,
  .cg-product18-summary,
  .cg-product18-info { padding: 12px 14px !important; }

  /* Show mobile trust pills, hide desktop trust column */
  .cg-product18-trust-pills { display: grid; }
  .cg-product18-trust { display: none; }

  /* Mobile dots visible */
  .cg-product18-dots { display: flex; }

  /* Hide desktop buy box, show sticky bar */
  .cg-product18-buy { display: none; }
  .cg-product18-eta { font-size: 11px; margin-bottom: 8px; }
  .cg-product18-share { padding: 8px 0; }
  .cg-product18-share a { width: 26px; height: 26px; }
  .cg-product18-sticky { display: flex; }

  /* Tighter spacing in strip + related */
  .cg-product18-strip { padding: 12px 14px; }
  .cg-product18-strip-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cg-product18-strip-name { font-size: 11px; min-height: 28px; }
  .cg-product18-strip-price { font-size: 12px; }

  .cg-product18-related-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cg-product18-related-card { padding: 8px; }
  .cg-product18-promises { grid-template-columns: 1fr; }

  .cg-product18-tabs { padding: 0 14px; margin-top: 14px; }
  .cg-product18-tabs-nav { gap: 14px; }
  .cg-product18-tab { font-size: 12px; padding: 12px 0 10px; }
}

/* < 420px — extra-small phones (v1.10.0 tighter) */
@media (max-width: 419px) {
  .cg-product18 .cg-container { padding: 0 6px; }
  .cg-product18-strip-grid { grid-template-columns: repeat(2, 1fr); }
  .cg-product18-trust-pills { grid-template-columns: 1fr; }
  .cg-product18-sticky-icon span { display: none; }
  .cg-product18-title { font-size: 15px; }
  .cg-product18-price-now { font-size: 22px; }
  .cg-product18-card,
  .cg-product18-summary,
  .cg-product18-info { padding: 10px 12px !important; }
}

/* v1.10.0 — Ultra-wide screens (>= 1600px): keep container at 1600px */
@media (min-width: 1600px) {
  .cg-product18 .cg-container { max-width: 1600px; padding: 0 32px; }
}
