/* ===== PRODUCT DETAIL PAGE (PDP) v2.0 - MOBILE FIRST ===== */

.pdp-wrapper {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
  padding-top: 80px;
}

/* ===== BREADCRUMB ===== */
.pdp-breadcrumb {
  font-family: var(--font-tech);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.5;
}

.pdp-breadcrumb a {
  font-family: var(--font-tech) !important;
  font-size: 0.9rem !important;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.pdp-breadcrumb a:hover {
  color: var(--primary);
}

.pdp-breadcrumb .sep {
  margin: 0 8px;
  color: var(--border-subtle);
  font-size: 0.9rem;
}

.pdp-breadcrumb .current {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
}


/* === LAYOUT GRID (Mobile Default: Stacked) === */
.pdp-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: start;
}

/* === COLUMNA IZQ: VISUALS (Mobile Default) === */
.pdp-image-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: static;
  max-width: 400px;
  margin: 0 auto 40px;
}

.pdp-image-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdp-image-container img.main-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.15));
  transition: transform 0.3s ease;
}

.pdp-image-container:hover img.main-img {
  transform: scale(1.05);
}

/* === COLUMNA DER: INFO === */
.pdp-header-block {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
}

.pdp-badge-brand {
  display: inline-block;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 6px;
  font-family: var(--font-tech);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

#product-name {
  font-family: var(--font-tech);
  font-size: 2rem;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 16px;
}

#product-description {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 100%;
}

/* === HERO PRICE BLOCK (Mobile Default) === */
.pdp-hero-price-block {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border: 1px solid var(--primary);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 40px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
  position: relative;
  overflow: hidden;
}

.pdp-hero-price-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

/* Mobile Layout Specifics */
.pdp-hero-price-block .col-store {
  grid-column: 1 / -1;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 12px;
}

.pdp-hero-price-block .col-price {
  text-align: left;
}

.pdp-hero-price-block .col-action {
  text-align: right;
}

/* Hero Elements */
.hero-price-label-small {
  font-family: var(--font-tech);
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.8rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-price-wrapper {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.hero-price-wrapper .currency {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 600;
}

.hero-price-wrapper .big-number {
  font-family: var(--font-mono);
  font-size: 2.3rem;
  color: var(--primary);
  font-weight: 700;
  line-height: 1;
}

.hero-cta-btn {
  background-color: var(--primary);
  color: white !important;
  padding: 14px 24px;
  border-radius: 8px;
  font-family: var(--font-tech);
  font-weight: 600;
  font-size: 1.1rem;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  white-space: nowrap;
}

.hero-cta-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

/* === PRICES LIST (Mobile Default) === */
.section-label {
  font-size: 1.5rem;
  margin-bottom: 30px;
  border-left: 5px solid var(--accent);
  padding-left: 16px;
  margin-top: 30px;
  font-family: var(--font-tech);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pdp-price-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.price-row {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 16px;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.price-row:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-card);
  background-color: #fafafa;
}

.price-row.unavailable,
.price-row.outdated {
  opacity: 0.6;
  background-color: #f8f9fa;
}

/* Mobile Row Layout */
.col-store {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.col-price {
  grid-column: 1 / 2;
  text-align: left;
  padding: 0;
}

.col-action {
  grid-column: 2 / 3;
  text-align: right;
}

/* Store Info */
.store-logo-img {
  width: 100px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: white;
  padding: 2px;
  border: 1px solid var(--border-subtle);
}

.store-meta {
  display: flex;
  flex-direction: column;
}

.store-name-text {
  font-weight: 600;
  color: var(--text-main);
  font-size: 1.1rem;
}

.update-time {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.update-time.fresh {
  color: var(--success);
}

.update-time.old {
  color: var(--warning);
}

/* Price Styling */
.price-val-row {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.price-decimals {
  font-size: 0.7em;
  vertical-align: top;
  position: relative;
  top: 0.1em;
  display: inline-block;
  padding-left: 2px;
}

.price-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}

.price-tag.best {
  background: var(--accent);
  color: #000;
}

.btn-go-store {
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 6px;
  font-family: var(--font-tech);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.price-row:hover .btn-go-store {
  background: var(--text-main);
  color: white;
  border-color: var(--text-main);
}

.separator-text {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 20px 0 10px;
  font-family: var(--font-tech);
  opacity: 0.7;
}

/* =========================================
   DESKTOP OVERRIDES (min-width: 900px)
   ========================================= */
@media (min-width: 900px) {
  .pdp-wrapper {
    padding-top: 100px;
  }

  /* Grid Layout */
  .pdp-layout-grid {
    grid-template-columns: 45% 1fr;
    gap: 50px;
  }

  /* Sticky Image */
  .pdp-image-card {
    position: sticky;
    top: 110px;
    max-width: none;
    margin: 0 0 40px 0;
    padding: 30px;
  }

  /* Typography Scaling */
  #product-name {
    font-size: 2.8rem;
  }

  #product-description {
    max-width: 90%;
  }

  /* Hero Desktop */
  .pdp-hero-price-block {
    grid-template-columns: 2fr 1.5fr auto;
    grid-template-rows: auto;
    padding: 24px;
  }

  .pdp-hero-price-block .col-store {
    grid-column: auto;
    border-bottom: none;
    padding-bottom: 0;
  }

  .pdp-hero-price-block .col-price {
    text-align: right;
    padding-right: 24px;
  }

  .pdp-hero-price-block .col-action {
    text-align: right;
  }

  .hero-price-label-small {
    justify-content: flex-end;
  }

  .hero-price-wrapper {
    justify-content: flex-end;
  }

  .hero-price-wrapper .big-number {
    font-size: 3.5rem;
  }

  /* Price List Desktop */
  .price-row {
    grid-template-columns: 2fr 1.5fr auto;
    grid-template-rows: auto;
    padding: 16px 24px;
  }

  .col-store {
    grid-column: auto;
  }

  .col-price {
    grid-column: auto;
    text-align: right;
    padding-right: 24px;
  }

  .col-action {
    grid-column: auto;
  }

  .price-val-row {
    font-size: 1.8rem;
  }
}

/* ============================================================
   ACTUALIZACIONES PARA EL NUEVO LOADER / PRICE ORCHESTRATOR
   ============================================================ */

/* ===== NUEVAS CLASES DE ESTADO PARA update-time ===== */
.update-time {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.9;
}

.update-time.status-fresh {
  color: var(--success);
}

.update-time.status-old {
  color: var(--warning);
}

.update-time.status-unavailable {
  color: #cc0000;
}

.update-time.status-unknown {
  color: #c28c00;
}

/* ===== PRECIO ANTIGUO (OUTDATED) - Atenuación elegante ===== */
.price-val-row.old-data {
  opacity: 0.55;
  filter: grayscale(0.8);
}

/* ===== Estado unificado para filas no vigentes ===== */
.price-row.outdated {
  opacity: 0.65;
}

.price-row.unavailable {
  opacity: 0.55;
  background-color: #f2f2f2;
}

/* ===== Decimales del precio con mejor contraste ===== */
.price-decimals {
  font-size: 0.7em;
  vertical-align: top;
  position: relative;
  top: 0.1em;
  padding-left: 2px;
  display: inline-block;
  opacity: 0.85;
}

/* ===== Mensajes/Separadores ===== */
.separator-text {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 25px 0 14px;
  font-family: var(--font-tech);
  opacity: 0.7;
}

/* ===== HERO: casos con precio viejo ===== */
#hero-update-time.status-warning {
  color: var(--warning);
  font-weight: 600;
}

/* ===== En hover, mantiene jerarquía visual ===== */
.price-row:hover {
  background-color: #fafafa;
  opacity: 1;
}

/* ===== Compatibilidad con estados ===== */
.price-row.outdated:hover,
.price-row.unavailable:hover {
  opacity: 0.75;
}

/* ===== SKELETON LOADER ===== */
.skeleton {
  background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 37%, #2a2a2a 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 16px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

/* =========================================
   STICKY HERO PRICE CARD
   ========================================= */

/* Base Sticky State (Desktop & Mobile Common) */
.pdp-hero-price-block.is-sticky {
  position: fixed;
  top: 80px;
  z-index: 6;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1300px;
  margin: 0;
  border-radius: 12px;
  border: 1px solid var(--primary);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  transform-origin: top center;
  animation: stickyScaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Exit Animation Class (Controlled by JS) */
.pdp-hero-price-block.is-unsticking {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  width: 100%;
  max-width: 1300px;
  transform-origin: top center;
  animation: stickyScaleOut 0.3s ease-in forwards;
  pointer-events: none;
}

#sticky-hero-wrapper {
  transition: height 0.1s linear;
}

/* SCALE ANIMATIONS (No Slides) */
@keyframes stickyScaleIn {
  0% {
    transform: translateX(-50%) scale(1.1);
    opacity: 0;
  }

  100% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

@keyframes stickyScaleOut {
  0% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateX(-50%) scale(1.1);
    opacity: 0;
  }
}


/* =========================================
   MOBILE COMPACT STICKY MODE (< 900px)
   ========================================= */
@media (max-width: 899px) {

  #product-description {
    font-size: 0.96rem; /* -20% respecto al 1.2rem base */
  }

  .pdp-hero-price-block.is-sticky {
    width: calc(100% - 24px);
    top: 90px;
    padding: 16px 20px;
    display: grid;
    gap: 8px;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr;
    align-items: center;
  }

  .pdp-hero-price-block.is-sticky::before {
    display: none;
  }

  .pdp-hero-price-block.is-sticky .col-store {
    grid-column: 1 / 2;
    padding: 0;
    border: none;
    width: auto;
    display: flex;
    align-items: center;
  }

  .pdp-hero-price-block.is-sticky .store-logo-img {
    width: auto;
    height: 48px;
    max-width: 110px;
    border-radius: 6px;
    padding: 0;
    border: none;
    object-fit: contain;
  }

  .pdp-hero-price-block.is-sticky .store-name-text {
    display: none;
  }

  .pdp-hero-price-block.is-sticky .update-time {
    display: none !important;
  }
  .pdp-hero-price-block.is-sticky .store-meta {
    display: none !important;
  }

  .pdp-hero-price-block.is-sticky .col-price {
    grid-column: 2 / 3;
    padding: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding-right: 12px;
  }

  .pdp-hero-price-block.is-sticky .hero-price-label-small {
    display: none;
  }

  .pdp-hero-price-block.is-sticky .hero-price-wrapper {
    gap: 2px;
    justify-content: flex-end;
  }

  .pdp-hero-price-block.is-sticky .hero-price-wrapper .currency {
    font-size: 1.2rem;
    font-weight: 600;
  }

  .pdp-hero-price-block.is-sticky .hero-price-wrapper .big-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
  }

  /* 4. CTA: Adjustment with right margin */
  .pdp-hero-price-block.is-sticky .col-action {
    grid-column: 3 / 4;
    padding: 0;
    text-align: right;
    margin-right: 8px;
  }

  .pdp-hero-price-block.is-sticky .hero-cta-btn {
    padding: 8px 18px;
    height: 44px;
    font-size: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    white-space: nowrap;
  }

  /* Insert new text "VER" - Reduced size 20% */
  .pdp-hero-price-block.is-sticky .hero-cta-btn::before {
    content: "VER";
    font-size: 0.8rem;
    font-weight: 700;
  }

  .pdp-hero-price-block.is-sticky .hero-cta-btn .arrow {
    display: inline-block;
    font-size: 1rem;
  }
}

/* =========================================
   DESKTOP STICKY REFINEMENTS (min-width: 900px)
   ========================================= */
@media (min-width: 900px) {
  .pdp-hero-price-block.is-sticky {
    grid-template-columns: 2fr 1.5fr auto;
    padding: 20px 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 1300px;
  }

  .pdp-hero-price-block.is-sticky .hero-cta-btn {
    font-size: 0 !important;
  }

  .pdp-hero-price-block.is-sticky .hero-cta-btn::before {
    content: "VER";
    font-size: 1.1rem;
  }

  .pdp-hero-price-block.is-sticky .hero-cta-btn .arrow {
    font-size: 1.2rem;
  }

  .pdp-hero-price-block.is-sticky .update-time {
    display: none !important;
  }
}

/* =========================================
   TOOLTIP FOR HIGH FREQUENCY BADGE (FIXED)
   ========================================= */

.freq-badge {
    position: relative;
    cursor: help;
    display: inline-block;
}

.freq-badge::before {
    content: attr(data-tooltip);
    position: absolute;
    
    top: calc(100% + 12px); 
    bottom: auto;
    
    left: 50%;
    transform: translateX(-50%) translateY(-4px);

    background-color: #1a1a1a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: normal;
    min-width: 180px;
    text-align: center;

    opacity: 0;
    visibility: hidden;
    z-index: 7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    pointer-events: none;

    transition:
        opacity 0.2s ease-out,
        transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1),
        visibility 0.2s;
}

.freq-badge::after {
    content: '';
    position: absolute;
    
    top: calc(100% + 2px); 
    bottom: auto;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);

    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #1a1a1a transparent;

    opacity: 0;
    visibility: hidden;
    z-index: 7;

    transition:
        opacity 0.2s ease-out,
        transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1),
        visibility 0.2s;
}

.freq-badge:hover::before,
.freq-badge:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}/* ============================================================
   TOOLTIP STACKING CONTEXT FIXES
   ============================================================ */

.price-row,
.col-store,
.store-meta {
    overflow: visible !important;
    contain: none !important;
}

.price-row:hover {
    position: relative;
    z-index: 5;
}
.freq-badge::before {
    z-index: 7;
    width: max-content;
    max-width: 250px;
    min-width: 200px;
}/* ============================================================
   STICKY HEADER TOOLTIP UNBLOCK
   ============================================================ */

#hero-price-container,
#hero-price-container.pdp-hero-price-block {
    overflow: visible !important;
    clip-path: none !important;
}

#hero-price-container .col-store {
    overflow: visible !important;
    position: relative;
    z-index: 5;
}

/* ============================================================
   FIX: PREVENCIÓN DE SCROLL LATERAL (MOBILE OVERFLOW)
   ============================================================ */

html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

.pdp-wrapper {
  overflow-x: hidden; 
  width: 100%;
  box-sizing: border-box;
}

@keyframes stickyScaleIn {
  0% {
    transform: translateX(-50%) scale(0.95); 
    opacity: 0;
  }
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

@keyframes stickyScaleOut {
  0% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(0.95); 
    opacity: 0;
  }
}

@media (max-width: 899px) {
  .freq-badge::before,
  .freq-badge::after {
    display: none !important;
  }
  
  .pdp-hero-price-block.is-sticky {
    width: calc(100% - 40px);
    max-width: 100vw;
  }
}

/* ============================================================
   HISTÓRICO DE PRECIOS (GRÁFICA SVG)
   ============================================================ */

.pdp-history-section {
  margin-top: 40px;
  width: 100%;
}

.pdp-history-card {
  background: var(--bg-card, #ffffff);
  border-radius: 16px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-top: 16px;
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.pdp-history-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

.history-chart-wrapper {
  width: 100%;
  height: 300px;
  position: relative;
}

.history-chart-legend {
  margin-top: 16px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: var(--font-tech, sans-serif);
  opacity: 0.8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.history-gap-legend {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.75;
}

.history-chart-disclaimer {
  margin-top: 12px;
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  font-family: var(--font-body, sans-serif);
  line-height: 1.4;
  text-align: center;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.65;
}

/* Tooltip flotante de la gráfica */
.pdp-history-tooltip {
  background: #0f172a;
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  font-family: var(--font-body, sans-serif);
  text-align: left;
  line-height: 1.4;
  transition: opacity 0.15s ease-out;
  pointer-events: none;
}

.pdp-history-tooltip .tooltip-date {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pdp-history-tooltip .tooltip-price {
  font-size: 15px;
  font-weight: 700;
  color: #00f2fe;
}

.pdp-history-tooltip .tooltip-store {
  font-size: 12px;
  font-weight: 500;
  color: #ffffff;
  margin-top: 4px;
  font-family: var(--font-tech, sans-serif);
}

/* Panel de comparación A-B flotante — compacto */
.pdp-history-compare-panel {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  padding: 5px 10px 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  color: #ffffff;
  font-family: var(--font-body, sans-serif);
  pointer-events: none;
  z-index: 1000;
  max-width: calc(100% - 20px);
  box-sizing: border-box;
  line-height: 1.35;
}

/* Línea 1: variación delta */
.cp-delta {
  font-size: 14.4px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.2px;
}

.cp-delta.positive { color: #ef4444; } /* B > A: precio subió → rojo */
.cp-delta.negative { color: #10b981; } /* B < A: precio bajó → verde */
.cp-delta.neutral  { color: #94a3b8; }

/* Línea 2: puntos A → B */
.cp-points {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
  font-size: 11px;
  color: #cbd5e1;
}

/* Badges A / B */
.cp-marker {
  font-size: 9px;
  font-weight: 800;
  font-family: var(--font-tech, sans-serif);
  letter-spacing: 0.3px;
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1.5;
  flex-shrink: 0;
}

.cp-a {
  background: rgba(249, 115, 22, 0.22);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.cp-b {
  background: rgba(37, 99, 235, 0.22);
  color: #00f2fe;
  border: 1px solid rgba(0, 242, 254, 0.25);
}

/* Texto de fecha · precio · tienda */
.cp-info {
  font-family: var(--font-body, sans-serif);
  color: #e2e8f0;
  font-size: 11px;
}

/* ============================================================
   INSIGHTS DE EVENTOS COMERCIALES
   ============================================================ */

.pdp-insights-section {
  margin-top: 48px;
  width: 100%;
}

.pdp-insights-section .section-label {
  margin-top: 0;
}

.pdp-insights-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Grid de cards — mobile first: 1 columna */
.pdp-insights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .pdp-insights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .pdp-insights-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Card acordeón */
.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.insight-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

/* Borde izquierdo por tipo de status */
.insight-card.status-strong_drop    { border-left: 4px solid var(--success); }
.insight-card.status-relevant_drop  { border-left: 4px solid #34d399; }
.insight-card.status-price_increase { border-left: 4px solid #f87171; }
.insight-card.status-no_relevant_change { border-left: 4px solid var(--border-subtle); }
.insight-card.status-no_event_data,
.insight-card.status-insufficient_baseline,
.insight-card.status-insufficient_valid_data { border-left: 4px solid #e2e8f0; opacity: 0.75; }

/* Cabecera — estática, no interactiva */
.insight-header {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: default;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

/* Icono del evento */
.insight-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-icon svg {
  width: 20px;
  height: 20px;
}

/* Texto cabecera */
.insight-header-text {
  min-width: 0;
}

.insight-event-name {
  font-family: var(--font-tech);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
}

.insight-badge.badge-drop   { color: var(--success); }
.insight-badge.badge-rise   { color: #ef4444; }
.insight-badge.badge-flat   { color: var(--text-muted); }
.insight-badge.badge-nodata { color: var(--text-light); }

.insight-badge-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Chevron — oculto (cards estáticas) */
.insight-chevron {
  display: none;
}

/* Cuerpo siempre visible — cards estáticas */
.insight-body {
  display: block;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border-subtle);
}

.insight-summary-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.6;
  margin-top: 14px;
  margin-bottom: 14px;
}

/* Tabla de métricas */
.insight-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.insight-metric {
  background: var(--bg-body);
  border-radius: 10px;
  padding: 10px 12px;
}

.insight-metric-label {
  font-family: var(--font-tech);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.insight-metric-value {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Fuente discreta */
.insight-source-note {
  margin-top: 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  opacity: 0.7;
}

/* Disclaimer de sección */
.pdp-insights-disclaimer {
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  line-height: 1.4;
  text-align: center;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.8;
}

.pdp-insights-disclaimer a {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: underline;
  margin-left: 4px;
  transition: color 0.2s ease;
}

.pdp-insights-disclaimer a:hover {
  color: var(--primary);
}

/* Separador → */
.cp-sep {
  color: #475569;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
  margin: 0 2px;
}

/* Regla para aumentar los títulos del rango histórico un 40% (ajustado -15%) */
.insight-card--summary .insight-metric-label {
  font-size: 0.77rem;
}

/* Grilla de 4 columnas para la tarjeta de resumen histórico */
.insight-card--summary .insight-metrics {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}
@media (max-width: 767px) {
  .insight-card--summary .insight-metrics {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 479px) {
  .insight-card--summary .insight-metrics {
    grid-template-columns: 1fr;
  }
}