/* CESCAC ficha de producto v2 (Fase 3). Sustituye el <style> en línea de catalogo_item.php.
   Usa los tokens --c-* de cescac-ui.css y los botones c-btn. Tres columnas en escritorio (imagen | título y detalle | compra),
   una columna en teléfono (imagen, título, compra, detalle). Las imágenes no se tocan.
   Reglas del dueño que se mantienen: cuota primero, luego contado; envío e instalación siempre visibles; un solo WhatsApp (el flotante). */

:root { color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--c-bg); color: var(--c-text); font-family: var(--c-font); font-size: 1.0625rem; line-height: 1.5; }
h1, h2, h3, h4 { font-family: var(--c-font-head); font-weight: 600; letter-spacing: -.01em; margin: 0; }
a { color: var(--c-verde); text-underline-offset: .2em; }
i.bi { line-height: 1; vertical-align: -.125em; }

/* ---------- lo compartido que se oculta en esta página ---------- */
/* el marco del catálogo (shell) repite navegación y dos WhatsApp; aquí la migas de pan y el botón flotante bastan */
.header-cata { display: none !important; }
.cx-topbar-wa { display: none !important; }
footer.shell-ft a[style*="25d366"] { display: none; }
/* C2_ITEM_20260924: el logo de la barra CESCAC va sobre chip blanco, >=96px en móvil y >=120px en escritorio */
.cx-topbar-brand img { background: #fff !important; padding: 6px 8px !important; border-radius: 8px !important; height: auto !important; width: 96px !important; max-width: none !important; }
@media (min-width: 768px) { .cx-topbar-brand img { width: 120px !important; } }
footer.shell-ft { padding: 28px 16px calc(96px + env(safe-area-inset-bottom)); background: var(--c-card); border-top: 1px solid var(--c-line); color: var(--c-muted); font-size: .9rem; margin-top: 32px; }
footer.shell-ft a { color: var(--c-verde); }

/* botón flotante de WhatsApp (el único de la página): icono Bootstrap en vez del emoji del marco */
.wa-float-s { font-size: 0 !important; gap: 8px; min-height: 48px; padding: 0 20px !important; background: var(--c-wa) !important; color: #0f172a !important; border-radius: var(--c-r-pill) !important;
  right: 16px !important; bottom: calc(16px + max(var(--cescac-aviso-h, 0px), env(safe-area-inset-bottom, 0px))) !important; box-shadow: 0 4px 16px rgba(0, 0, 0, .2) !important; align-items: center; justify-content: center; }
.wa-float-s::before { content: "\f618"; font-family: "bootstrap-icons"; font-size: 1.25rem; line-height: 1; }
.wa-float-s::after { content: "WhatsApp"; font: 700 1rem var(--c-font); }
.wa-float-s:hover { transform: scale(1.04); }
@media (max-width: 767px) { .wa-float-s { padding: 0 !important; width: 52px; height: 52px; border-radius: 50% !important; } .wa-float-s::after { display: none; } }

/* ---------- página ---------- */
.shell-main.ficha-page { max-width: 1280px; margin: 0 auto; padding: 0 16px 24px; background: none; }
.container { max-width: none; margin: 0; padding: 0; }
.breadcrumb { padding: 16px 0 8px; font-size: .9rem; color: var(--c-muted); }
.breadcrumb a { color: var(--c-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-verde); text-decoration: underline; }
.breadcrumb span { color: var(--c-text); font-weight: 600; }
@keyframes fv-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fv-in .45s cubic-bezier(.22, 1, .36, 1); }

/* ---------- cuadrícula: teléfono -> tableta -> escritorio ---------- */
.fv { display: grid; gap: 20px; margin: 8px 0 32px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "img" "head" "buy" "detail"; }
.fv-img { grid-area: img; } .fv-head { grid-area: head; } .fv-buy { grid-area: buy; } .fv-detail { grid-area: detail; }
@media (min-width: 768px) {
  .fv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "img head" "img buy" "detail detail"; align-items: start; }
}
@media (min-width: 1100px) {
  .fv { grid-template-columns: minmax(0, 5fr) minmax(0, 5fr) minmax(19rem, 4fr); grid-template-areas: "img head buy" "img detail buy"; grid-template-rows: auto 1fr; gap: 24px 32px; }
}

/* ---------- imagen ---------- */
.imagen-section { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--c-r-3); overflow: hidden; box-shadow: var(--c-shadow); }
@media (min-width: 768px) { .imagen-section { position: sticky; top: calc(var(--cx-h-h, 0px) + 16px); } }
.imagen-wrap { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; background: #fff; }
.imagen-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .35s ease; }
.imagen-wrap:hover img { transform: scale(1.04); }
.badge-stock { position: absolute; top: 12px; left: 12px; max-width: calc(100% - 24px); padding: 4px 12px; border-radius: var(--c-r-pill); font-size: .8125rem; font-weight: 600; line-height: 1.3; }
.badge-stock.disponible { background: var(--c-ok-bg); color: var(--c-ok); }
.badge-stock.bajo-pedido { background: var(--c-warn-bg); color: var(--c-warn); }
.badge-oferta { position: absolute; left: 12px; bottom: 12px; padding: 4px 12px; border-radius: var(--c-r-pill); background: #b91c1c; color: #fff; font-size: .8125rem; font-weight: 700; }

/* ---------- título ---------- */
.categoria-tag { display: inline-flex; align-items: center; padding: 2px 12px; border-radius: var(--c-r-pill); background: var(--c-soft); color: var(--c-ghost); font-size: .8125rem; font-weight: 600; margin-bottom: 12px; }
.marca-tag { color: var(--c-muted); font-size: .95rem; margin-bottom: 4px; }
.producto-nombre { font-size: clamp(1.35rem, 3vw, 1.9rem); line-height: 1.25; margin-bottom: 12px; }
.codigo-tag { display: inline-block; padding: 2px 10px; border-radius: var(--c-r-1); background: var(--c-chip); color: var(--c-chip-t); font: 600 .8125rem ui-monospace, SFMono-Regular, Menlo, monospace; margin-bottom: 8px; }
.variante-ficha-wrap select { min-height: 44px; }

/* ---------- compra ---------- */
.fv-buy { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--c-r-3); padding: 20px; box-shadow: var(--c-shadow); font-variant-numeric: tabular-nums; }
.fv-buy i.bi { color: var(--c-verde); margin-right: 2px; }
.precio-box { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--c-line); }
.precio-principal { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-family: var(--c-font-head); font-size: clamp(1.9rem, 4vw, 2.4rem); font-weight: 600; line-height: 1.1; color: var(--c-verde); }
.precio-principal small { width: 100%; font: 600 .8125rem var(--c-font); text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); }
.precio-principal span { font: 600 .95rem var(--c-font); color: var(--c-muted); }
.ahorro-tag { padding: 2px 10px; border-radius: var(--c-r-pill); background: var(--c-ok-bg); color: var(--c-ok) !important; font-size: .8125rem !important; }
.precio-efectivo { margin-top: 12px; font-weight: 600; color: var(--c-text); }
.precio-efectivo small { color: var(--c-muted) !important; font-weight: 400 !important; }
.precio-antes-wrap { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.precio-antes { color: var(--c-muted); font-weight: 600; text-decoration: line-through; }
.chip-oferta { display: inline-block; padding: 2px 8px; border-radius: var(--c-r-pill); background: #b91c1c; color: #fff; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.precio-oculto { background: var(--c-warn-bg); border: 1px dashed var(--c-warn); border-radius: var(--c-r-1); padding: 8px 10px; font-weight: 700; color: var(--c-warn); }
.precio-oculto small { display: block; font-weight: 400; font-size: .8125rem; margin-top: 2px; }
.formas-pago-tabla { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--c-line); }
.fp-fila { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; font-size: .95rem; }
.fp-nombre { color: var(--c-muted); font-weight: 600; }
.fp-valor { font-weight: 700; }
.fp-diferido { flex-direction: column; align-items: flex-start; }
.fp-diferido-opts { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--c-ghost); }
.fp-nota { font-size: .8125rem; color: var(--c-muted); line-height: 1.5; }
.cupon-box { margin-top: 14px; padding: 12px 14px; border-radius: var(--c-r-2); background: var(--c-warn-bg); color: var(--c-warn); font-size: .9rem; line-height: 1.55; }
.cupon-box i.bi { color: inherit; }

.cta-section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.share-mini { margin: 0 0 16px; }
.envio-inst-box, .beneficios-box { margin: 0 0 12px; padding: 14px 16px; border-radius: var(--c-r-2); background: var(--c-bg); border: 1px solid var(--c-line); font-size: .9rem; line-height: 1.65; color: var(--c-chip-t); }
.envio-inst-box strong, .beneficios-box strong { color: var(--c-text); }
.beneficios-box ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.beneficios-box a { color: var(--c-ghost); font-weight: 600; }

/* ---------- detalle ---------- */
.fv-detail { min-width: 0; }
.descripcion-section { margin: 0 0 24px; }
.descripcion-section h3, .especificaciones-section h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--c-text); }
.descripcion-text { line-height: 1.7; color: var(--c-text); }
.especs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 24px; }
.espec-item { padding: 14px; border-radius: var(--c-r-2); background: var(--c-card); border: 1px solid var(--c-line); text-align: center; }
.espec-label { font-size: .75rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: 4px; }
.espec-value { font-weight: 700; }
.info-extra { padding-top: 20px; border-top: 1px solid var(--c-line); }
.info-extra h4 { font-size: 1.05rem; margin-bottom: 12px; }
.info-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.info-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--c-chip-t); line-height: 1.5; }
.info-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-brand); margin-top: .5em; flex: none; }

/* ---------- producto no encontrado ---------- */
.not-found { text-align: center; padding: 64px 16px; }
.not-found h2 { font-size: 1.6rem; color: var(--c-muted); margin-bottom: 12px; }
.not-found p { color: var(--c-muted); max-width: 26rem; margin: 0 auto 24px; }
