/* Tienda CACF pública (2026-11-04). Usa los tokens de /styles.css; estructura como la Tienda del portal. */
.tw { --tw-ok: #1B7A43; --tw-ok-tint: #E7F5EC; --tw-ambar: #8A5300; --tw-ambar-tint: #FFF4DE; --tw-rojo: #B3261E; padding-bottom: 4rem; }
.tw h1, .tw h2 { margin: 0; }

/* Barra de la Tienda: queda pegada debajo del menú del sitio (top lo ajusta tienda.js a la altura del menú). */
.tw-barra { position: sticky; top: var(--tw-top, 80px); z-index: 50; display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: -1.2rem 0 1.4rem; padding: .7rem 0; background: rgba(250, 250, 250, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tw-barra-titulo { font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--cacf-blue); }
.tw-barra-volver { display: inline-flex; align-items: center; gap: .35rem; padding: .55rem 1rem .55rem .7rem; border-radius: 999px; background: var(--cacf-blue-tint); color: var(--cacf-blue-dark); font-weight: 600; font-size: .95rem; text-decoration: none; transition: background .2s var(--ease); }
.tw-barra-volver:hover { background: #DCE6F7; }
.tw-barra-volver svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tw > .dp-migas { display: none; } /* la barra ya dice dónde estás; las migas quedan para Google (JSON-LD) */
.tw-fiscal { margin: 0; font-size: .85rem; color: var(--ink-mute); }
.tw-datos .tw-fiscal { margin-top: -.7rem; }
.tw-cab .tw-fiscal { margin-top: .5rem; }

/* Cabecera del catálogo */
.tw-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; margin-bottom: 1.6rem; }
.tw-cab > div { max-width: 720px; }
.tw-carrito-btn { position: relative; flex: none; display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--cacf-blue-dark); font-weight: 600; font-size: .95rem; text-decoration: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.tw-carrito-btn:hover { border-color: var(--cacf-blue); box-shadow: 0 6px 18px rgba(31, 59, 110, .1); }
.tw-carrito-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tw-carrito-btn b { min-width: 22px; height: 22px; border-radius: 999px; background: var(--cacf-blue); color: var(--white); font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.tw-carrito-btn b[hidden] { display: none; }

/* Franja para socios (descuento del portal) */
.tw-socios { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.1rem; margin-bottom: 1.6rem; border-radius: 14px; background: var(--cacf-blue-dark); color: #DCE5F5; font-size: .92rem; line-height: 1.45; }
.tw-socios strong { color: var(--white); }
.tw-socios span:nth-child(2) { flex: 1 1 260px; }
.tw-socios-pct { flex: none; padding: .35rem .7rem; border-radius: 10px; background: #FFD54A; color: #10224A; font-weight: 700; font-size: 1.05rem; }
.tw-socios a { flex: none; color: var(--white); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .5); }
.tw-socios a:hover { border-bottom-color: var(--white); }
.tw-carrito .tw-socios { margin: 1.6rem 0 0; }

/* Filtros */
.tw-chips { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.tw-chips button { font: inherit; font-size: .88rem; border: 1px solid var(--line); background: var(--white); color: var(--ink-soft); border-radius: 999px; padding: .45rem 1rem; cursor: pointer; transition: border-color .2s var(--ease); }
.tw-chips button:hover { border-color: var(--cacf-blue); }
.tw-chips button.act { background: var(--cacf-blue-dark); border-color: var(--cacf-blue-dark); color: var(--white); font-weight: 600; }

/* Grilla de productos */
.tw-grilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (min-width: 760px) { .tw-grilla { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tw-grilla { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2rem; } }
.tw-tarjeta { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.tw-tarjeta:hover { transform: translateY(-3px); border-color: #C9D4EA; box-shadow: 0 14px 30px rgba(31, 59, 110, .1); }
.tw-tarjeta:focus-visible { outline: 3px solid var(--cacf-blue-soft); outline-offset: 2px; }
.tw-tarjeta[hidden] { display: none; }
.tw-foto { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; background: var(--cacf-blue-tint); overflow: hidden; }
.tw-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
.tw-tarjeta:hover .tw-foto img { transform: scale(1.04); }
.tw-foto svg, .tw-sin-foto svg { width: 38px; height: 38px; fill: none; stroke: var(--cacf-blue); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.tw-stock { position: absolute; left: .6rem; top: .6rem; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: .2rem .6rem; background: var(--tw-ok-tint); color: var(--tw-ok); }
.tw-stock.tw-ultimas { background: var(--tw-ambar-tint); color: var(--tw-ambar); }
.tw-cuerpo { padding: .8rem 1rem 1rem; display: flex; flex-direction: column; gap: .2rem; }
.tw-cat { font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cacf-blue); }
.tw-cuerpo strong { font-size: 1rem; font-weight: 600; line-height: 1.25; color: var(--cacf-blue-dark); }
.tw-sub { font-size: .8rem; color: var(--ink-mute); }
.tw-precio { margin-top: .35rem; font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.tw-precio small { font-size: .75rem; font-weight: 400; color: var(--ink-mute); }

/* Ficha */
.tw-ficha { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.8rem; }
@media (min-width: 900px) { .tw-ficha { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3rem; align-items: start; } .tw-galeria { position: sticky; top: calc(var(--tw-top, 80px) + 5rem); } }
.tw-galeria { position: relative; border-radius: 20px; overflow: hidden; background: var(--cacf-blue-tint); }
.tw-galeria-fotos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 1 / 1; }
.tw-galeria-fotos::-webkit-scrollbar { display: none; }
.tw-galeria-fotos img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.tw-sin-foto { flex: 1; display: flex; align-items: center; justify-content: center; }
.tw-flecha { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); color: var(--cacf-blue-dark); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.tw-flecha svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tw-flecha:hover { background: var(--white); }
.tw-ant { left: .8rem; }
.tw-sig { right: .8rem; }
.tw-puntos { position: absolute; left: 0; right: 0; bottom: .9rem; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.tw-puntos span { width: 7px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .7); box-shadow: 0 0 2px rgba(0, 0, 0, .3); transition: width .2s var(--ease); }
.tw-puntos span.act { width: 22px; background: var(--white); }
.tw-datos { display: flex; flex-direction: column; gap: 1.1rem; }
.tw-datos h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); font-weight: 600; line-height: 1.15; color: var(--cacf-blue-dark); margin-top: -.6rem; letter-spacing: -.01em; }
.tw-precio-grande { font-size: 1.9rem; margin: 0; }
.tw-opciones { border: 0; margin: 0; padding: 0; }
.tw-opciones[hidden], .tw-aviso-stock[hidden], .tw-ok[hidden] { display: none; }
.tw-opciones legend { font-size: .88rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .55rem; }
.tw-variantes { display: flex; gap: .5rem; flex-wrap: wrap; }
.tw-talles { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: .5rem; }
.tw-opcion { min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); color: var(--ink); font: inherit; font-size: .95rem; cursor: pointer; padding: 0 1rem; transition: border-color .15s var(--ease); }
.tw-opcion:hover:not(:disabled) { border-color: var(--cacf-blue); }
.tw-opcion.act { border: 2px solid var(--cacf-blue); background: var(--cacf-blue-tint); color: var(--cacf-blue-dark); font-weight: 600; }
.tw-opcion:disabled { border-style: dashed; background: var(--paper); color: #A9B1C4; text-decoration: line-through; cursor: default; }
.tw-nota { margin: .4rem 0 0; font-size: .84rem; color: var(--ink-mute); }
.tw-aviso-stock { background: var(--tw-ambar-tint); color: var(--tw-ambar); border-radius: 12px; padding: .65rem .9rem; font-size: .9rem; font-weight: 600; }
.tw-agregar { display: flex; align-items: center; gap: .8rem; }
.tw-cantidad { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--white); flex: none; }
.tw-cantidad button { width: 46px; height: 50px; border: 0; background: none; font-size: 1.3rem; color: var(--cacf-blue-dark); cursor: pointer; font-family: inherit; }
.tw-cantidad button:disabled { opacity: .3; cursor: default; }
.tw-cantidad input, .tw-cantidad span { width: 34px; text-align: center; font-weight: 700; font-size: 1rem; border: 0; background: none; font-family: inherit; color: var(--ink); }
.tw-cantidad-chica button { width: 38px; height: 36px; font-size: 1.1rem; }
.tw-btn { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 1.4rem; border-radius: 12px; background: var(--cacf-blue); color: var(--white); font: inherit; font-weight: 600; font-size: 1rem; border: 0; cursor: pointer; text-decoration: none; transition: background .2s var(--ease), transform .2s var(--ease); }
.tw-btn:hover { background: var(--cacf-blue-dark); }
.tw-btn:active { transform: scale(.99); }
.tw-btn:disabled { opacity: .5; cursor: default; }
.tw-btn-grande { width: 100%; min-height: 56px; font-size: 1.05rem; box-shadow: 0 10px 24px rgba(31, 59, 110, .22); }
.tw-ok { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; background: var(--tw-ok-tint); color: var(--tw-ok); border-radius: 12px; padding: .7rem .95rem; font-weight: 600; font-size: .92rem; }
.tw-ok-acciones { display: flex; flex-wrap: wrap; gap: .5rem; }
.tw-ok-acciones a { padding: .45rem .9rem; border-radius: 999px; text-decoration: none; font-size: .88rem; }
.tw-ok-seguir { border: 1px solid #BFE3CD; color: var(--tw-ok); background: var(--white); }
.tw-ok-carrito { background: var(--tw-ok); color: var(--white); }
.tw-ok-carrito:hover { background: #155F35; }
.tw-desc, .tw-como { border: 1px solid var(--line); border-radius: 16px; background: var(--white); padding: 1.1rem 1.3rem; }
.tw-desc h2, .tw-como h2 { font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--cacf-blue); margin-bottom: .6rem; }
.tw-desc p { font-size: .95rem; color: var(--ink-soft); line-height: 1.6; }
.tw-desc p + .tw-desc-nota { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.tw-desc .tw-desc-nota { font-size: .84rem; color: var(--ink-mute); }
.tw-como ol { margin: 0; padding-left: 1.2rem; font-size: .93rem; color: var(--ink-soft); line-height: 1.7; }

/* Carrito */
.tw-h1 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 600; color: var(--cacf-blue-dark); margin-bottom: 1.2rem !important; }
.tw-h2 { font-size: 1.1rem; font-weight: 600; color: var(--cacf-blue-dark); }
.tw-pedido[hidden], .tw-vacio[hidden], .tw-error-campos[hidden] { display: none; }
.tw-pedido { max-width: 720px; }
.tw-vacio { padding: 2rem 0; color: var(--ink-mute); }
.tw-vacio a { color: var(--cacf-blue); font-weight: 600; }
.tw-error, .tw-error-campos { background: #FBEAEA; color: var(--tw-rojo); border: 1px solid #F1C2BE; border-radius: 12px; padding: .75rem 1rem; font-size: .92rem; font-weight: 500; margin: 0 0 1rem; max-width: 720px; }
.tw-caja { background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.tw-linea { display: flex; gap: .9rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.tw-linea-foto { flex: none; width: 72px; height: 72px; border-radius: 12px; background: var(--cacf-blue-tint); overflow: hidden; }
.tw-linea-foto img { width: 100%; height: 100%; object-fit: cover; }
.tw-linea-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.tw-linea-cuerpo a { color: var(--cacf-blue-dark); font-weight: 600; text-decoration: none; }
.tw-linea-cuerpo a:hover { text-decoration: underline; }
.tw-linea-pie { display: flex; justify-content: space-between; align-items: center; margin-top: .4rem; }
.tw-linea-ultimas { align-self: flex-start; font-size: .72rem; font-weight: 700; color: var(--tw-ambar); background: var(--tw-ambar-tint); border-radius: 999px; padding: .1rem .55rem; margin-top: .3rem; }
.tw-linea-simple { justify-content: space-between; align-items: baseline; font-size: .95rem; }
.tw-total { display: flex; justify-content: space-between; padding: 1rem 1.1rem; font-size: 1.2rem; font-weight: 700; color: var(--cacf-blue-dark); }
.tw-nota-envio { margin: .7rem 0 1.6rem; }
.tw-form { display: flex; flex-direction: column; gap: 1.1rem; }
.tw-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tw-entrega { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.tw-entrega legend { font-size: 1.1rem; font-weight: 600; color: var(--cacf-blue-dark); margin-bottom: .6rem; }
.tw-entrega label { display: flex; gap: .8rem; align-items: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: .85rem 1rem; cursor: pointer; transition: border-color .15s var(--ease); }
.tw-entrega label:hover { border-color: #C9D4EA; }
.tw-entrega label:has(input:checked) { border: 2px solid var(--cacf-blue); padding: calc(.85rem - 1px) calc(1rem - 1px); }
.tw-entrega input[type=radio] { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--cacf-blue); flex: none; }
.tw-entrega span { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.tw-entrega small { font-size: .85rem; color: var(--ink-mute); }
.tw-entrega select { margin-top: .4rem; max-width: 320px; }
.tw-entrega label:not(:has(input:checked)) select { display: none; }
.tw-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.tw-campo { display: flex; flex-direction: column; gap: .3rem; }
.tw-ancho { grid-column: 1 / -1; }
@media (max-width: 600px) { .tw-campos { grid-template-columns: minmax(0, 1fr); } }
.tw-campo label { font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.tw-opc { font-weight: 400; color: var(--ink-mute); }
.tw-campo input, .tw-campo select, .tw-campo textarea, .tw-entrega select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: .65rem .9rem; font: inherit; font-size: 1rem; color: var(--ink); background: var(--white); }
.tw-campo textarea { min-height: 96px; resize: vertical; }
.tw-campo input:focus, .tw-campo select:focus, .tw-campo textarea:focus { outline: none; border-color: var(--cacf-blue); box-shadow: 0 0 0 3px var(--cacf-blue-tint); }
.tw-campo .tw-mal { border-color: var(--tw-rojo); box-shadow: 0 0 0 3px #FBEAEA; }
.tw-info { background: var(--cacf-blue-tint); color: var(--cacf-blue-dark); border-radius: 12px; padding: .85rem 1rem; font-size: .9rem; line-height: 1.5; }

/* Confirmación */
.tw-gracias { max-width: 640px; }
.tw-gracias .tw-caja { margin: 1.4rem 0 .6rem; }
.tw-gracias .btn { margin-top: 1.4rem; }
.tw-recibido { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem; padding: 2rem 1.5rem; border-radius: 20px; background: var(--tw-ok-tint); border: 1px solid #BFE3CD; color: #1D4F31; line-height: 1.55; }
.tw-recibido h1 { font-size: 1.6rem; font-weight: 600; color: #155F35; }
.tw-recibido-tilde { width: 56px; height: 56px; border-radius: 50%; background: var(--tw-ok); display: flex; align-items: center; justify-content: center; }
.tw-recibido-tilde svg { width: 30px; height: 30px; fill: none; stroke: var(--white); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }


