/* =====================================================================
   Celltek tienda · LAYOUT
   Aviso superior, cabecera pegajosa (logo, buscador, acciones), barra de
   categorías con desplegables, cajón móvil, cajón del carrito, pie.
   ===================================================================== */

/* ---- Aviso superior ---- */
.aviso { background: var(--accent); color: var(--on-accent); font-size: 13.5px; font-weight: 600; text-align: center; position: relative; z-index: 51; }
.aviso .wrap { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 36px; padding: 6px 40px; }
.aviso a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .5); }
.aviso .aviso-x { position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 999px; border: 0; background: transparent; color: inherit; display: grid; place-items: center; opacity: .8; }
.aviso .aviso-x:hover { opacity: 1; background: rgba(0, 0, 0, .12); }
body.sin-aviso .aviso { display: none; }

/* ---- Cabecera ---- */
.hdr { position: sticky; top: 0; z-index: 50; isolation: isolate; color: var(--nav-text);
  border-bottom: 1px solid var(--nav-line);
  backdrop-filter: blur(18px) saturate(170%); -webkit-backdrop-filter: blur(18px) saturate(170%); }
.hdr::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--nav-bg); transition: background .4s; }
.hdr.scrolled::before { background: var(--nav-bg-solid); }
.hdr-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(12px, 2.4vw, 32px); height: var(--nav-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; height: 40px; }
.logo img { height: 34px; width: auto; }
.logo-light { display: var(--logo-light); } .logo-dark { display: var(--logo-dark); }
.hdr .logo-light { display: var(--nav-logo-light); } .hdr .logo-dark { display: var(--nav-logo-dark); }
/* marca tipográfica cuando no hay logo subido */
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -.035em; line-height: 1; display: inline-flex; align-items: baseline; gap: 2px; }
.wordmark i { width: 9px; height: 9px; border-radius: 3px; background: var(--accent); display: inline-block; transform: translateY(-1px); }

/* buscador */
.search { position: relative; display: flex; align-items: center; height: 46px; border-radius: var(--r-btn); border: 1px solid var(--nav-line); background: var(--nav-field); color: var(--nav-field-text);
  transition: border-color .3s, box-shadow .3s; }
.search:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-ring); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0 8px 0 18px; font-size: 15px; outline: none; }
.search input::placeholder { color: var(--nav-field-ph); }
.search input::-webkit-search-cancel-button { appearance: none; }
.search .s-btn { width: 40px; height: 40px; margin-right: 3px; border-radius: 999px; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; transition: transform .4s var(--ease), background .3s; }
.search .s-btn:hover { background: var(--accent-2); }
.search .s-btn:active { transform: scale(.94); }
.search .s-btn .ic-svg { width: 18px; height: 18px; }
.search .s-clear { width: 32px; height: 32px; border: 0; background: transparent; color: var(--nav-field-ph); display: none; place-items: center; border-radius: 999px; }
.search.tiene .s-clear { display: grid; }
/* sugerencias */
.sug { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--surf); color: var(--text); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px; z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .25s var(--ease), transform .3s var(--ease), visibility .25s; max-height: min(70vh, 520px); overflow: auto; }
.sug.open { opacity: 1; visibility: visible; transform: none; }
.sug h5 { margin: 6px 10px 4px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.sug a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-in); }
.sug a:hover, .sug a.sel { background: var(--accent-soft); }
.sug .sug-ph { width: 44px; height: 44px; border-radius: 10px; background: var(--tile); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--dim); }
.sug .sug-ph img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.sug .sug-t { flex: 1; min-width: 0; }
.sug .sug-t b { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug .sug-t small { color: var(--dim); font-size: 12.5px; }
.sug .sug-p { font-weight: 700; font-family: var(--font-display); white-space: nowrap; }
.sug .sug-all { justify-content: center; color: var(--accent-2); font-weight: 600; margin-top: 4px; }

/* acciones */
.hdr-acts { display: flex; align-items: center; gap: 6px; }
.ibtn { width: 44px; height: 44px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--nav-text); display: grid; place-items: center; position: relative; transition: background .3s, border-color .3s, transform .4s var(--ease); }
.ibtn:hover { background: var(--accent-soft); }
.ibtn:active { transform: scale(.94); }
.ibtn .ic-svg { width: 22px; height: 22px; }
.ibtn .ic-sun { display: var(--logo-dark); } .ibtn .ic-moon { display: var(--logo-light); }
.ibtn .badge { position: absolute; top: 4px; right: 2px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 800; display: grid; place-items: center; line-height: 1; transition: transform .35s var(--ease); }
.ibtn .badge.cero { display: none; }
.ibtn .badge.bump { animation: bump .5s var(--ease); }
@keyframes bump { 30% { transform: scale(1.35); } }
.hdr .wa-nav { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 12px; border-radius: 999px; border: 1px solid var(--nav-line); font-weight: 600; font-size: 14px; color: var(--nav-text); transition: border-color .3s, background .3s; }
.hdr .wa-nav:hover { border-color: var(--nav-text); }
.hdr .wa-nav .ic-svg { width: 20px; height: 20px; color: #25d366; }
.burger { display: none; }

/* ---- Barra de categorías ---- */
.cats { border-top: 1px solid var(--nav-line); }
.cats-bar { display: flex; align-items: center; gap: 2px; height: var(--cats-h); list-style: none; margin: 0; padding: 0; overflow: visible; }
.cats-bar > li { position: relative; }
.cats-bar > li > a, .cats-bar > li > button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 0; background: transparent; font-size: 14px; font-weight: 600; color: var(--nav-muted); white-space: nowrap; transition: color .25s, background .25s; }
.cats-bar > li > a:hover, .cats-bar > li > button:hover, .cats-bar > li.open > button { color: var(--nav-text); background: var(--accent-soft); }
.cats-bar > li > a[aria-current="page"] { color: var(--nav-text); }
.cats-bar .c-all { font-weight: 700; color: var(--nav-text); padding-left: 10px; }
.cats-bar .c-all .ic-svg { width: 18px; height: 18px; }
.cats-bar .c-oferta { color: var(--nav-oferta); }
.cats-bar .c-oferta .ic-svg { width: 16px; height: 16px; }
.cats-bar .caret { width: 14px; height: 14px; transition: transform .3s var(--ease); opacity: .7; }
.cats-bar > li.open .caret { transform: rotate(180deg); }
.cats-bar .sep { flex: 1; }
/* desplegable de subcategorías */
.dd { position: absolute; left: 0; top: calc(100% + 6px); min-width: 260px; background: var(--surf); color: var(--text); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px; z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .22s var(--ease), transform .3s var(--ease), visibility .22s; }
.cats-bar > li.open .dd { opacity: 1; visibility: visible; transform: none; }
.dd a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 12px; border-radius: var(--r-in); font-size: 14.5px; font-weight: 500; }
.dd a:hover { background: var(--accent-soft); }
.dd a small { color: var(--dim); font-size: 12px; }
.dd .dd-all { font-weight: 700; color: var(--accent-2); border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; border-radius: 0; }
/* menú «Todas»: dos columnas */
.mega { min-width: min(720px, 92vw); display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; padding: 12px; }
.mega .mg { padding: 6px 4px; }
.mega .mg > a { font-weight: 700; padding: 6px 10px; }
.mega .mg ul { list-style: none; padding: 0 0 0 10px; }
.mega .mg ul a { font-weight: 500; padding: 5px 10px; color: var(--muted); }
.mega .mg ul a:hover { color: var(--text); }

/* ---- Cajón móvil (menú) ---- */
.drawer { position: fixed; inset: 0; z-index: 80; visibility: hidden; }
.drawer .dr-bg { position: absolute; inset: 0; background: rgba(6, 9, 14, .45); opacity: 0; transition: opacity .35s var(--ease); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.drawer .dr-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(360px, 88vw); background: var(--bg); color: var(--text); box-shadow: var(--shadow); transform: translateX(-100%); transition: transform .45s var(--ease); display: flex; flex-direction: column; overflow: hidden; }
.drawer.right .dr-panel { left: auto; right: 0; transform: translateX(100%); width: min(440px, 92vw); }
.drawer.open { visibility: visible; }
.drawer.open .dr-bg { opacity: 1; }
.drawer.open .dr-panel { transform: none; }
body.dr-open { overflow: hidden; }
.dr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.dr-head b { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.dr-body { flex: 1; overflow: auto; padding: 8px 12px 24px; overscroll-behavior: contain; }
.dr-foot { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surf); }
/* acordeón de categorías */
.acc { list-style: none; }
.acc > li { border-bottom: 1px solid var(--line); }
.acc > li > a, .acc > li > button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 8px; background: transparent; border: 0; text-align: left; font-weight: 600; font-size: 16px; }
.acc > li > button .ic-svg { width: 16px; height: 16px; color: var(--dim); transition: transform .3s var(--ease); }
.acc > li.open > button .ic-svg { transform: rotate(180deg); }
.acc ul { list-style: none; padding: 0 0 8px 12px; display: none; }
.acc > li.open ul { display: block; }
.acc ul a { display: flex; justify-content: space-between; padding: 9px 8px; color: var(--muted); font-size: 15px; border-radius: var(--r-in); }
.acc ul a small { color: var(--dim); }
.acc .acc-all { color: var(--accent-2); font-weight: 700; }
.dr-links { list-style: none; padding: 12px 8px 0; display: grid; gap: 2px; }
.dr-links a { display: flex; align-items: center; gap: 12px; padding: 10px 8px; font-weight: 600; border-radius: var(--r-in); }
.dr-links a .ic-svg { width: 20px; height: 20px; color: var(--accent-2); }

/* ---- Cajón del carrito ---- */
.cart-lines { display: grid; gap: 4px; }
.cl { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); align-items: start; }
.cl .cl-ph { width: 72px; height: 72px; border-radius: var(--r-in); background: var(--tile); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; color: var(--dim); }
.cl .cl-ph img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.cl .cl-t { min-width: 0; }
.cl .cl-t a { font-weight: 600; font-size: 14.5px; line-height: 1.3; display: block; }
.cl .cl-t small { display: block; color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.cl .cl-t .cl-warn { color: var(--warn); font-weight: 600; }
.cl .cl-r { text-align: right; display: grid; gap: 6px; justify-items: end; }
.cl .cl-r b { font-family: var(--font-display); font-weight: 700; font-size: 15px; white-space: nowrap; }
.cl .cl-del { border: 0; background: transparent; color: var(--dim); width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; }
.cl .cl-del:hover { color: var(--bad); background: var(--bad-soft); }
.cart-tot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0 12px; }
.cart-tot b { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.cart-tot small { color: var(--dim); display: block; font-weight: 400; font-size: 12.5px; }
.cart-vacio { text-align: center; padding: 48px 20px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.cart-vacio .ic-svg { width: 48px; height: 48px; color: var(--dim); }
.cart-vacio b { color: var(--text); font-size: 18px; }
.envio-bar { margin: 4px 0 10px; }
.envio-bar small { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.envio-bar .barra { height: 6px; border-radius: 999px; background: var(--bg2); overflow: hidden; }
.envio-bar .barra i { display: block; height: 100%; width: 0; background: var(--ok); border-radius: inherit; transition: width .6s var(--ease); }

/* ---- Migas ---- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--dim); list-style: none; }
.crumbs a:hover { color: var(--text); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.crumbs [aria-current] { color: var(--muted); }

/* ---- Cabecera de páginas interiores ---- */
.page-head { padding: clamp(22px, 3.5vw, 44px) 0 clamp(18px, 2.5vw, 30px); }
.page-head h1 { font-size: var(--fs-display); margin-top: 12px; }
.page-head .lead { margin-top: 12px; }
.page-head .chips { margin-top: 18px; }

/* ---- Banda de cierre ---- */
.cta-band { padding: calc(var(--sec) * .8) 0; background: var(--cta-bg); color: var(--cta-text); border-top: 1px solid var(--line); }
.cta-band-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 40px; align-items: center; }
.cta-band .lead { margin-top: 14px; color: var(--cta-muted); }
.cta-band-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }

/* ---- Pie ---- */
.footer { border-top: 1px solid var(--footer-line); padding: 56px 0 32px; background: var(--footer-bg); color: var(--footer-text); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 40px 28px; align-items: start; }
.footer .logo img { height: 36px; }
.footer .logo-light { display: var(--footer-logo-light); } .footer .logo-dark { display: var(--footer-logo-dark); }
.footer .wordmark { color: var(--footer-text); }
.footer-giro { margin-top: 16px; max-width: 40ch; color: var(--footer-muted); font-size: calc(14.5px * var(--k-body, 1)); }
.footer .social { display: flex; gap: 8px; margin-top: 18px; }
.footer .social a { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--footer-line); display: grid; place-items: center; color: var(--footer-muted); transition: color .3s, border-color .3s; }
.footer .social a:hover { color: var(--footer-text); border-color: var(--footer-text); }
.footer .social .ic-svg { width: 20px; height: 20px; }
.footer .cols h4 { margin: 0 0 14px; font-size: calc(12px * var(--k-body, 1)); letter-spacing: .14em; text-transform: uppercase; color: var(--footer-dim); font-weight: 700; }
.footer ul { list-style: none; display: grid; gap: 9px; }
.footer li { font-size: calc(14.5px * var(--k-body, 1)); color: var(--footer-muted); line-height: 1.45; }
.footer li a:hover { color: var(--footer-text); }
.footer li .ic-svg { width: 16px; height: 16px; margin-right: 8px; color: var(--footer-dim); vertical-align: -3px; }
.footer-copy { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--footer-line); display: flex; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; font-size: calc(13px * var(--k-body, 1)); color: var(--footer-dim); }
.footer-copy .pagos { display: inline-flex; align-items: center; gap: 8px; }
.footer-copy .pagos .ic-svg { width: 18px; height: 18px; }

/* ---- Botón flotante de WhatsApp ---- */
.wa-fab { position: fixed; right: 18px; bottom: 18px; z-index: 45; width: 54px; height: 54px; border-radius: 999px; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: 0 12px 30px -10px rgba(37, 211, 102, .7); transition: transform .4s var(--ease); }
.wa-fab:hover { transform: translateY(-2px) scale(1.04); }
.wa-fab .ic-svg { width: 30px; height: 30px; }
body.con-barra .wa-fab { bottom: 86px; }

/* ---- Responsive ---- */
@media (max-width: 1060px) {
  .hdr .wa-nav { display: none; }
}
@media (max-width: 860px) {
  :root { --nav-h: 60px; }
  .hdr-main { grid-template-columns: auto auto 1fr auto; gap: 8px; }
  .burger { display: grid; }
  .search-wrap { grid-column: 1 / -1; padding-bottom: 10px; }
  .hdr-main { height: auto; padding-top: 8px; }
  .hdr-main .logo { grid-column: 2; }
  .hdr-main .hdr-acts { grid-column: 4; }
  .search { height: 44px; }
  .cats { display: none; }
  .cta-band-grid { grid-template-columns: 1fr; }
  .cta-band-actions { justify-content: flex-start; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .wa-fab { right: 14px; bottom: 14px; width: 50px; height: 50px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .aviso { font-size: 12.5px; }
  .aviso .wrap { padding: 6px 34px; }
}
