/* ======================================================
   COMFORTEK TIENDA — Ficha de producto
   Complementa style.css (ambos se cargan en producto.html)
   ====================================================== */

/* --- Breadcrumb ----------------------------------------- */
.breadcrumb {
  padding: var(--s2) 0;
  font-size: .8rem;
  color: var(--color-ink-dim);
  border-bottom: 1px solid var(--color-border);
}
.breadcrumb a {
  color: var(--color-ink-mid);
  transition: color var(--ease);
}
@media (hover: hover) {
  .breadcrumb a:hover { color: var(--color-accent); }
}
.breadcrumb span { margin: 0 6px; color: var(--color-ink-dim); }  /* mejora 87 — separador atenuado */

/* --- Layout hero producto (2 columnas) ------------------ */
.product-hero {
  padding: var(--s8) 0;
}
.product-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s8);
  align-items: start;
}

/* Columna imagen */
.product-image-col {}
.product-image-wrap {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--s4);
}
.product-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  color: var(--color-ink-dim);
  font-size: .85rem;
  text-align: center;
  padding: var(--s4);
}
.product-image-placeholder svg {
  width: 48px; height: 48px;
  opacity: .3;
}
.product-thumbnails {
  display: flex;
  gap: var(--s1);
  margin-top: var(--s2);
}
.product-thumb {
  width: 64px; height: 64px;
  border-radius: var(--radius-btn);   /* mejora 59/60 — radio consistente 8px */
  border: 2px solid var(--color-border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--ease), transform var(--ease);   /* mejora 66 */
  background: var(--color-bg-soft);
}
@media (hover: hover) {
  .product-thumb:hover { border-color: var(--color-accent); transform: translateY(-1px); }
}
.product-thumb.active,
.product-thumb:focus-visible { border-color: var(--color-accent); }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

/* Columna info */
.product-info-col { position: sticky; top: 80px; }

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-bottom: var(--s2);
}
.badge-programado {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.badge-programado.is-kit {
  background: #D1FAE5;
  color: #065F46;
}
.badge-programado.is-material {
  background: var(--color-bg-soft);
  color: var(--color-ink-mid);
  border: 1px solid var(--color-border);
}
.badge-category {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 500;
  color: var(--color-ink-mid);
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
}

.product-brand {
  font-size: .85rem;
  font-weight: 600;
  color: var(--color-accent-aa, #BE4B15);  /* R015/R014 — 4.99:1 sobre blanco, pasa AA */
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.product-name {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.2;
  margin-bottom: var(--s1);
}
.product-sku {
  font-size: .8rem;
  color: var(--color-ink-dim);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--s3);
}

/* Compatibilidades */
.product-compat {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-bottom: var(--s4);
}
.compat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 600;
  border: 1px solid currentColor;
}
.compat-ha     { color: #1565C0; background: #E3F2FD; border-color: #90CAF9; }
.compat-loxone { color: #2E7D32; background: #E8F5E9; border-color: #A5D6A7; }
.compat-zigbee { color: #6A1B9A; background: #F3E5F5; border-color: #CE93D8; }
.compat-zwave  { color: #BF360C; background: #FBE9E7; border-color: #FFAB91; }
.compat-wifi   { color: #C43900; background: #FFF3E0; border-color: #FFCC80; }  /* R022 — #C43900: 4.88:1/FFF3E0 (era #E65100: 3.42:1 → falla AA) */
.compat-bt     { color: #1565C0; background: #E8EAF6; border-color: #9FA8DA; }

/* Precio */
.product-price-block {
  margin-bottom: var(--s4);
  padding: var(--s3) var(--s4);         /* P1 — padding más generoso */
  background: var(--color-bg-soft);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent); /* P2 — acento izquierdo */
}
.product-price-label {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-ink-mid);  /* R022 — ink-mid 4.91:1/blanco (era ink-dim #9A8F80 3.05:1 → falla AA) */
  margin-bottom: 4px;
}
.product-price-amount {
  font-size: 2.5rem;                      /* P5 — precio más grande */
  font-weight: 800;                       /* P6 — 800 máximo impacto */
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--color-accent-text);        /* P7 — naranja accesible */
  letter-spacing: -.03em;
}
.product-price-amount .currency {
  font-size: 1.25rem; font-weight: 600;
  vertical-align: super;
  color: var(--color-accent-text);        /* P8 — símbolo coherente */
}
/* mejora 47 — precio original tachado */
.product-price-old {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-ink-dim);
  text-decoration: line-through;
  margin-left: var(--s1);
}
/* mejora 50 — precio con ahorro destacado en acento */
.product-price-save {
  display: inline-block;
  margin-top: 4px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--color-accent-text);
}
.product-price-amount.ask {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-ink-mid);
}
.product-price-note {
  font-size: .8rem;
  color: var(--color-ink-mid);  /* R022 — ink-mid 4.91:1 (era ink-dim 3.05:1 → falla AA) */
  margin-top: 4px;
}

/* Selector de cantidad + CTA WA */
/* mejora 30 — precio + CTA en columna con separación coherente */
.product-cta-block {
  margin-bottom: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s3);       /* mejora 30 — gap ~20-24px */
}
.qty-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: 0;
}
.qty-label { font-size: .85rem; font-weight: 500; color: var(--color-ink-mid); }
.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);   /* mejora 60 — radio 8px consistente */
  overflow: hidden;
  box-shadow: var(--shadow-inset);    /* mejora 56 — profundidad interior */
}
.qty-btn {
  width: 44px; height: 44px;  /* R022 — tap target WCAG 2.5.5 ≥44px (era 40×40px) */
  background: var(--color-bg-soft);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--color-ink);
  transition: background var(--ease);
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
@media (hover: hover) { .qty-btn:hover { background: var(--color-border); } }
.qty-input {
  width: 48px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-inline: 1px solid var(--color-border);
  background: #fff;
  padding: 0;
  height: 40px;
  -moz-appearance: textfield;
}
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.btn-wa-product {
  width: 100%;
  justify-content: center;
  font-size: 1.05rem;
  padding: 16px var(--s4);
}

/* Trust signals cerca del CTA */
.product-trust {
  display: flex;
  flex-direction: column;
  gap: 10px;                             /* P9 — más espacio entre items */
  margin-bottom: var(--s4);
  padding: var(--s3) var(--s4);         /* P10 — padding más generoso */
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-card);
  font-size: .875rem;                    /* P11 — ligeramente más grande */
  color: #166534;
}
.product-trust-item {
  display: flex;
  align-items: flex-start;              /* P12 — flex-start para items con texto largo */
  gap: 10px;
}
.product-trust-item svg {
  flex-shrink: 0;
  width: 18px; height: 18px;           /* P13 — icono ligeramente más grande */
  margin-top: 1px;                      /* P14 — alineación visual con el texto */
  color: #16A34A;                       /* P15 — verde más vivo */
}

/* Formulario fallback */
.product-form-toggle {
  background: none;
  border: none;
  color: var(--color-ink-mid);
  font-size: .85rem;
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--font);
  padding: 0;
  margin-bottom: var(--s3);
}
.product-form-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  border-radius: 2px;
}
/* P16 — animación de aparición del formulario */
@keyframes formSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.product-form {
  display: none;
  padding: var(--s4);                           /* P17 — padding más generoso */
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  border-top: 3px solid var(--color-accent);   /* P18 — acento en el borde superior */
}
.product-form.visible {
  display: block;
  animation: formSlideDown .25s ease-out;      /* P19 — slide suave al abrir */
}
.product-form legend {
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: var(--s3);
  display: block;
}
.form-row { margin-bottom: var(--s3); }   /* mejora 25 — gap 20-24px entre campos */
.form-row label {
  display: block;
  font-size: .875rem;      /* mejora 11 — labels 0.875rem 500 */
  font-weight: 500;
  color: var(--color-ink-mid);
  margin-bottom: var(--s1);
}
.form-row input,
.form-row textarea {
  width: 100%;             /* mejora 96 — full-width siempre */
  min-height: 48px;        /* mejora 85 — altura mínima 48px */
  padding: 12px 16px;      /* mejora 85 — padding 12x16 */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);   /* mejora 60 — radio 8px como botón */
  font-family: var(--font);
  font-size: 1rem;
  color: var(--color-ink);
  background: #fff;
  box-shadow: var(--shadow-inset);    /* mejora 56 — profundidad interior */
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);  /* mejora 69 */
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-accent);        /* mejora 45 */
  box-shadow: 0 0 0 3px rgba(232,104,48,.2); /* mejora 45 — halo accent 20% */
}
.form-row textarea { resize: vertical; min-height: 96px; padding-block: 12px; }
.form-submit {
  width: 100%;
  justify-content: center;
}
.form-note {
  font-size: .75rem;
  color: var(--color-ink-dim);
  margin-top: var(--s1);
  text-align: center;
}

/* --- Sección descripción -------------------------------- */
.product-description {
  padding: var(--s8) 0;
  border-top: 1px solid var(--color-border);
}
.product-description h2 {
  font-size: 1.35rem;                     /* P20 — ligeramente más grande */
  font-weight: 700;
  margin-bottom: var(--s3);
  padding-bottom: var(--s2);
  border-bottom: 2px solid var(--color-border); /* P21 — separador bajo el h2 */
}
.product-description p,
.product-description li {
  color: var(--color-ink-mid);
  line-height: 1.7;
  max-width: 65ch;      /* mejora 6 — medida óptima de lectura */
}
/* mejora 42 — enlaces en cyan con subrayado al hover */
.product-description a {
  color: var(--color-cyan);
  text-decoration: none;
  transition: color var(--ease-fast);
}
.product-description a:hover { text-decoration: underline; }
.product-description ul {
  list-style: disc;
  padding-left: var(--s3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* --- Kit includes (solo si programado) ----------------- */
.kit-includes-section {
  padding: var(--s8) 0;
  border-top: 1px solid var(--color-border);
  display: none;
}
.kit-includes-section.visible { display: block; }
.kit-includes-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--s4);
}
.kit-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--s3);
}
.kit-step {
  display: flex;
  gap: var(--s2);
  align-items: flex-start;
}
.kit-step-num {
  width: 32px; height: 32px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kit-step-text { font-size: .9rem; color: var(--color-ink-mid); }

/* --- CTA repetido al final ------------------------------ */
.product-cta-repeat {
  padding: var(--s8) 0;
  background: var(--gradient-warm, var(--color-bg-soft)); /* P22 — gradiente warm */
  border-top: 1px solid var(--color-border);
  text-align: center;
}
.product-cta-repeat h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);  /* P23 — responsive */
  font-weight: 800;                           /* P24 — 800 para impacto */
  margin-bottom: var(--s2);
}
.product-cta-repeat p {
  color: var(--color-ink-mid);
  max-width: 50ch;
  margin: 0 auto var(--s4);
  font-size: 1.05rem;                         /* P25 — ligeramente mayor */
}

/* --- Estados form success/error ----------------------- */
.form-status {
  display: none;
  padding: var(--s3) var(--s4);
  border-radius: var(--radius-card);
  font-size: .9rem;
  font-weight: 600;
  margin-top: var(--s3);
  animation: formSlideDown .25s ease-out;
}
.form-status.success {
  display: flex;
  align-items: center;
  gap: var(--s2);
  background: #F0FDF4;
  color: #166534;
  border: 1px solid #BBF7D0;
}
.form-status.error {
  display: flex;
  align-items: center;
  gap: var(--s2);
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* --- AIDA copy — R015 ----------------------------------- */

/* Benefit tagline: client-first, sobre la marca y el H1 */
.product-benefit-tagline {
  font-size: .95rem;
  font-weight: 600;
  color: var(--color-accent-aa, #BE4B15);
  margin-bottom: var(--s2);
  line-height: 1.4;
}

/* Descripción: primera línea client-first en negrita */
.product-desc-client {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--s2);
  line-height: 1.5;
}

/* Sección "Por qué comprarlo con Comfortek" */
.product-why {
  padding: var(--s8) 0;
  background: var(--color-bg-soft);
  border-top: 1px solid var(--color-border);
}
.product-why h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  margin-bottom: var(--s4);
  letter-spacing: -.02em;
}
.product-why-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.product-why-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  font-size: .95rem;
  line-height: 1.55;
}
.why-icon {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
  flex-shrink: 0;
  margin-top: 2px;
}

/* --- Error / loading ------------------------------------ */
.product-loading,
.product-error {
  text-align: center;
  padding: var(--s12) var(--s4);
  color: var(--color-ink-mid);
}
.product-error h2 { font-size: 1.25rem; margin-bottom: var(--s2); color: var(--color-ink); }
.product-error a { color: var(--color-accent); text-decoration: underline; }

/* --- Responsive ----------------------------------------- */
@media (max-width: 768px) {
  .product-hero { padding: var(--s6) 0; }
  .product-hero-grid { grid-template-columns: 1fr; gap: var(--s4); }
  .product-info-col { position: static; }
  .product-image-wrap { aspect-ratio: 4/3; }
  /* mejora 97 — precio más grande y visible above-the-fold en móvil */
  .product-price-amount { font-size: 2.5rem; }
  .product-price-block { padding: var(--s4); }
  /* mejora 96 — campos de formulario siempre full-width, nunca side-by-side */
  .form-row { display: block; }
  .form-row input, .form-row textarea { width: 100%; }
}

/* --- Cross-link al kit correspondiente (R024) ----------- */
.product-kit-link {
  padding: var(--s4) 0;
  border-top: 1px solid var(--color-border);
}
.kit-link-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-card);
  padding: var(--s3) var(--s4);
}
.kit-link-banner p {
  font-size: .95rem;
  color: var(--color-ink-mid);
  margin: 0;
  max-width: none;
}
.kit-link-banner p strong { color: var(--color-ink); }
.kit-link-banner .btn {
  padding: 10px 20px;
  min-height: 40px;
  font-size: .9rem;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .kit-link-banner { flex-direction: column; align-items: flex-start; }
  .kit-link-banner .btn { width: 100%; justify-content: center; }
}
