/* ==========================================================================
   Avodah — header completo (prototipo)
   Barra superior · header fijo · mega menús · buscador · cuenta · favoritos
   mini carrito · tooltips · avisos (toasts) · alertas · menú móvil
   Capas: header 60 · atenuado 50 · scrim 90 · paneles laterales 100 · toasts 120 · demo 130
   ========================================================================== */

/* --------------------------------------------------------------------------
   Barra superior con mensajes rotativos
   -------------------------------------------------------------------------- */
.topbar { background: var(--olive-900); color: #F1EFE4; font-size: 13px; position: relative; z-index: 61; }
.topbar__inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 34px; gap: 16px; }
.topbar__item { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.topbar__item .ico { font-size: 17px; }
.topbar__item a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(238,235,224,.4); }
.topbar__item a:hover { text-decoration-color: currentColor; }
.topbar__right { justify-self: end; }
.ticker { position: relative; justify-self: center; height: 20px; min-width: 320px; overflow: hidden; text-align: center; }
.ticker__msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; opacity: 0; transform: translateY(100%); transition: opacity .45s var(--ease-out), transform .45s var(--ease-out); }
.ticker__msg.is-active { opacity: 1; transform: none; }
.ticker__msg.is-leaving { opacity: 0; transform: translateY(-100%); }
.ticker__msg .ico { font-size: 15px; }

/* --------------------------------------------------------------------------
   Header fijo (se compacta al hacer scroll)
   -------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 60; background: var(--bg); border-bottom: 1px solid var(--line); transition: box-shadow .25s; }
.site-header.is-compact { box-shadow: 0 6px 24px rgba(32,34,22,.07); }
.header__inner { display: flex; align-items: center; height: 88px; gap: 24px; transition: height .25s var(--ease-out); }
.site-header.is-compact .header__inner { height: 68px; }
.logo { flex: none; display: block; }
.logo img { height: 64px; width: auto; transition: height .25s var(--ease-out); }
.site-header.is-compact .logo img { height: 48px; }

/* Logo animado: al hover el perro levanta la cabeza, abre los ojos y saca la
   lengua; el gato abre los ojos y mueve la oreja; la rama se mece.
   Los transform-origin son coordenadas del viewBox (pivotes sobre el trazo). */
.logo__anim { display: block; height: 64px; width: auto; overflow: visible; transition: height .25s var(--ease-out); }
.site-header.is-compact .logo__anim { height: 48px; }
.logo__anim .avl-dog,
.logo__anim .avl-ear,
.logo__anim .avl-branch,
.logo__anim .avl-tongue,
.logo__anim .avl-eye-open { transform-box: view-box; }
.logo__anim .avl-dog { transform-origin: 325.5px 228px; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.logo__anim .avl-ear { transform-origin: 266px 218px; }
.logo__anim .avl-branch { transform-origin: 143.1px 427.5px; }
.logo__anim .avl-tongue { fill: var(--bg); transform-origin: 392px 203px; transform: scaleY(0); transition: transform .2s ease-in; }
.logo__anim .avl-eye-closed { transition: opacity .15s; }
.logo__anim .avl-eye-open { opacity: 0; transition: opacity .15s; }
.logo__anim .avl-eye-open--dog { transform-origin: 321px 106px; }
.logo__anim .avl-eye-open--cat { transform-origin: 306px 281px; }

.logo:hover .avl-dog,
.logo:focus-visible .avl-dog, .logo.is-playing .avl-dog { transform: rotate(-4.5deg); }
.logo:hover .avl-tongue,
.logo:focus-visible .avl-tongue, .logo.is-playing .avl-tongue {
	transform: scaleY(1);
	transition: transform .3s .2s cubic-bezier(.34, 1.56, .64, 1);
	animation: avl-pant .36s .55s ease-in-out infinite alternate;
}
.logo:hover .avl-eye-closed,
.logo:focus-visible .avl-eye-closed, .logo.is-playing .avl-eye-closed { opacity: 0; }
.logo:hover .avl-eye-open,
.logo:focus-visible .avl-eye-open, .logo.is-playing .avl-eye-open { opacity: 1; animation: avl-blink 2.8s 1.4s infinite; }
.logo:hover .avl-ear,
.logo:focus-visible .avl-ear, .logo.is-playing .avl-ear { animation: avl-ear .9s .3s ease-in-out; }
.logo:hover .avl-branch,
.logo:focus-visible .avl-branch, .logo.is-playing .avl-branch { animation: avl-sway 1.8s ease-in-out; }

@keyframes avl-pant { from { transform: scaleY(1); } to { transform: scaleY(.8); } }
@keyframes avl-blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes avl-ear { 0%, 72%, 100% { transform: rotate(0); } 18% { transform: rotate(-10deg); } 36% { transform: rotate(1deg); } 54% { transform: rotate(-7deg); } }
@keyframes avl-sway { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(3deg); } 55% { transform: rotate(-2deg); } 80% { transform: rotate(1deg); } }

@media (prefers-reduced-motion: reduce) {
	.logo__anim * { animation: none !important; transition: none !important; }
	.logo:hover .avl-dog, .logo:focus-visible .avl-dog, .logo.is-playing .avl-dog { transform: none; }
	.logo:hover .avl-tongue, .logo:focus-visible .avl-tongue, .logo.is-playing .avl-tongue { transform: scaleY(0); }
}

/* Navegación ------------------------------------------------------------- */
.nav { margin: 0 auto; padding-left: 40px; height: 100%; }
.nav__list { display: flex; gap: 37px; margin: 0; padding: 0; list-style: none; height: 100%; }
.nav__item { display: flex; align-items: center; }
.nav__link { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; color: #1D2321; padding: 8px 0; transition: color .15s; }
.nav__link .ico { font-size: 14px; stroke-width: 1.8; transition: transform .2s var(--ease-out); }
.nav__link::after { /* subrayado animado desde el centro */
	content: ""; position: absolute; left: 50%; right: 50%; bottom: 0; height: 1.5px; background: var(--olive-700);
	transition: left .22s var(--ease-out), right .22s var(--ease-out);
}
.nav__link:hover, .nav__item.is-open .nav__link { color: var(--olive-700); }
.nav__link:hover::after, .nav__link.is-current::after, .nav__item.is-open .nav__link::after { left: 0; right: 0; }
.nav__item.is-open .nav__link .ico { transform: rotate(180deg); }

/* Mega menú -------------------------------------------------------------- */
.mega {
	position: absolute; left: 0; right: 0; top: 100%;
	background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 24px 40px -18px rgba(32,34,22,.18);
	opacity: 0; visibility: hidden; transform: translateY(-6px);
	transition: opacity .18s var(--ease-out), transform .18s var(--ease-out), visibility 0s linear .18s;
}
.mega.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.mega__inner { display: grid; grid-template-columns: 1.9fr 1fr .95fr 1.1fr; gap: 36px; padding-top: 30px; padding-bottom: 34px; }
.mega__title { display: block; font: 600 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.mega__cats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.mega__cat { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 6px; margin-left: -6px; border-radius: 10px; transition: background .15s; }
.mega__cat:hover { background: var(--sand); }
.mega__thumb { width: 46px; height: 46px; border-radius: 9px; background: var(--sand) center / contain no-repeat; background-blend-mode: multiply; flex: none; }
.mega__cat:hover .mega__thumb { background-color: #E5E0D2; }
.mega__cat strong { display: block; font: 400 15px/1.2 var(--serif); color: var(--ink); }
.mega__cat small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.mega__links { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 2px; }
.mega__links a { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; color: #3F3C38; transition: color .15s, transform .15s; }
.mega__links a:hover { color: var(--olive-700); transform: translateX(3px); }
.mega__pet { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: 13px; color: #3F3C38; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--olive-700); background: var(--olive-100); }
.chip .ico { font-size: 14px; color: var(--muted); }
.mega__promo { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 280px; padding: 20px; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s; }
.mega__promo:hover { border-color: #DDD6C9; box-shadow: 0 10px 26px rgba(46,49,31,.08); } /* fondo igual al de las fotos de producto */
.mega__promo-img { position: absolute; right: 16px; top: 14px; height: 46%; width: auto; transition: transform .35s var(--ease-out); }
.mega__promo:hover .mega__promo-img { transform: scale(1.04) rotate(-1deg); }
.mega__promo-tag { position: relative; align-self: flex-start; font: 600 10.5px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--olive-700); background: var(--olive-100); padding: 6px 9px; border-radius: 999px; margin-bottom: 10px; }
.mega__promo strong { position: relative; font: 400 21px/1.15 var(--serif); color: var(--ink); }
.mega__promo span { position: relative; font-size: 13px; color: var(--muted); margin-top: 4px; }
.mega__promo em { position: relative; font-style: normal; font-size: 13px; font-weight: 500; color: var(--olive-700); margin-top: 12px; }
.mega__foot { grid-column: 1 / -1; display: flex; gap: 28px; padding-top: 18px; margin-top: -8px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.mega__foot span { display: inline-flex; align-items: center; gap: 8px; }
.mega__foot .ico { font-size: 17px; color: var(--olive-700); }

/* Atenuado de la página cuando hay un mega menú abierto */
.page-dim { position: fixed; inset: 0; z-index: 50; background: rgba(32,34,22,.22); opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s linear .2s; }
body.mega-open .page-dim { opacity: 1; visibility: visible; transition-delay: 0s; }

/* --------------------------------------------------------------------------
   Buscador con sugerencias
   -------------------------------------------------------------------------- */
.search { position: relative; width: 230px; flex: none; }
.search__field { position: relative; }
.search input {
	width: 100%; height: 42px; border: 1px solid transparent; border-radius: 999px; background: var(--field);
	padding: 0 42px 0 20px; font: 400 13.5px var(--sans); color: var(--ink); outline: none;
	transition: background .15s, border-color .15s, box-shadow .15s;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: #9D968E; }
.search.is-open input, .search input:focus { background: var(--white); border-color: #D9D2C6; box-shadow: 0 0 0 3px rgba(71,80,48,.12); }
.search__submit, .search__clear { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--icon); display: flex; padding: 5px; border-radius: 50%; }
.search__submit { right: 7px; font-size: 18px; }
.search__clear { right: 34px; font-size: 14px; color: var(--muted); opacity: 0; pointer-events: none; transition: opacity .15s; }
.search.has-text .search__clear { opacity: 1; pointer-events: auto; }
.search.has-text input { padding-right: 70px; } /* solo reserva espacio para la ✕ cuando hay texto */
.search__clear:hover { background: var(--field); }

.search__panel {
	position: absolute; top: calc(100% + 10px); right: 0; width: 440px; max-height: min(70vh, 560px); overflow-y: auto;
	background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop);
	padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-6px);
	transition: opacity .16s var(--ease-out), transform .16s var(--ease-out), visibility 0s linear .16s;
}
.search.is-open .search__panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.sr__group { padding: 8px 8px 6px; }
.sr__group + .sr__group { border-top: 1px solid var(--line); }
.sr__label { display: flex; justify-content: space-between; align-items: center; font: 600 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 4px 0 8px; }
.sr__label button { border: 0; background: none; font: 500 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--olive-700); padding: 4px; }
.sr__item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; background: none; border-radius: 9px; text-align: left; font-size: 13.5px; color: #3F3C38; }
.sr__item .ico { font-size: 16px; color: var(--muted); }
.sr__item:hover, .sr__item.is-active { background: var(--sand); }
.sr__item mark { background: none; color: var(--ink); font-weight: 600; }
.sr__thumb { width: 44px; height: 44px; border-radius: 8px; background: var(--surface) center / contain no-repeat; background-blend-mode: multiply; border: 1px solid var(--line); flex: none; }
.sr__name { flex: 1; min-width: 0; line-height: 1.35; }
.sr__name small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.sr__price { font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; }
.sr__remove { margin-left: auto; color: var(--muted); font-size: 14px; display: flex; padding: 6px; border: 0; background: none; border-radius: 50%; }
.sr__remove:hover { background: var(--white); color: var(--ink); }
.sr__all { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 8px 4px; height: 40px; border-radius: 9px; background: var(--olive-100); color: var(--olive-700); font-size: 13.5px; font-weight: 500; }
.sr__all:hover { background: #DCDFCB; }
.sr__empty { text-align: center; padding: 22px 16px 10px; }
.sr__empty .ico { font-size: 34px; color: #B3AC9F; margin: 0 auto 10px; display: block; }
.sr__empty strong { display: block; font: 400 17px/1.3 var(--serif); color: var(--ink); }
.sr__empty p { margin: 6px 0 14px; font-size: 13px; color: var(--muted); }
.sr__empty .chips { justify-content: center; }
.skeleton { height: 44px; border-radius: 8px; margin: 8px; background: linear-gradient(90deg, #F2EEE8 25%, #F8F5F1 50%, #F2EEE8 75%); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* --------------------------------------------------------------------------
   Acciones (cuenta, favoritos, carrito) + insignias + tooltips
   -------------------------------------------------------------------------- */
.actions { display: flex; align-items: center; gap: 14px; margin-left: 4px; }
.act { position: relative; }
.act__btn { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; color: var(--icon); font-size: 24px; transition: background .15s, color .15s; }
.act__btn:hover, .act__btn[aria-expanded="true"] { background: var(--field); color: var(--olive-700); }
.badge {
	position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; padding: 0 5px;
	border-radius: 999px; background: var(--olive-700); color: #fff; border: 2px solid var(--bg);
	font: 600 10px/14px var(--sans); text-align: center; box-sizing: border-box;
	transition: transform .2s var(--ease-out), opacity .2s;
}
.badge[data-count="0"] { transform: scale(0); opacity: 0; }
.badge.is-bump { animation: bump .5s var(--ease-out); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 65% { transform: scale(.9); } 100% { transform: scale(1); } }
.act__btn.is-wiggle .ico { animation: wiggle .55s var(--ease-out); }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 50% { transform: rotate(9deg); } 75% { transform: rotate(-4deg); } }

/* Avatar del usuario con punto de notificación */
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--olive-700); color: #F4EFE3; font: 600 12px/1 var(--sans); letter-spacing: .03em; }
.avatar--lg { width: 46px; height: 46px; font-size: 15px; }
.dot { position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: #C0623F; border: 2px solid var(--bg); }
.dot::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid #C0623F; animation: ping 1.8s var(--ease-out) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.2); opacity: 0; } }

/* Tooltips (solo con mouse o teclado; en táctil no aparecen) */
[data-tip]::after {
	content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; z-index: 70;
	transform: translate(-50%, -4px); padding: 7px 10px; border-radius: 6px; background: var(--ink); color: #fff;
	font: 500 12px/1 var(--sans); letter-spacing: .01em; white-space: nowrap; pointer-events: none;
	opacity: 0; transition: opacity .14s, transform .14s; transition-delay: 0s;
}
[data-tip]::before {
	content: ""; position: absolute; top: calc(100% + 3px); left: 50%; z-index: 70; transform: translate(-50%, -4px);
	border: 5px solid transparent; border-top: 0; border-bottom-color: var(--ink); opacity: 0; transition: opacity .14s, transform .14s; pointer-events: none;
}
@media (hover: hover) {
	[data-tip]:hover::after, [data-tip]:hover::before { opacity: 1; transform: translate(-50%, 0); transition-delay: .35s; }
}
[data-tip]:focus-visible::after, [data-tip]:focus-visible::before { opacity: 1; transform: translate(-50%, 0); }
[data-tip][aria-expanded="true"]::after, [data-tip][aria-expanded="true"]::before { display: none; }
@media (hover: none) { [data-tip]::after, [data-tip]::before { display: none; } } /* en táctil no hay hover: sin tooltips */
[data-tip-align="end"]::after { left: auto; right: -4px; transform: translate(0, -4px); }
@media (hover: hover) { [data-tip-align="end"]:hover::after { transform: none; } }
[data-tip-align="end"]:focus-visible::after { transform: none; }

/* --------------------------------------------------------------------------
   Popovers (cuenta, favoritos)
   -------------------------------------------------------------------------- */
.pop {
	position: absolute; top: calc(100% + 12px); right: -8px; width: 344px; z-index: 65;
	background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop);
	opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.985); transform-origin: top right;
	transition: opacity .16s var(--ease-out), transform .16s var(--ease-out), visibility 0s linear .16s;
}
.pop::before { /* flechita */
	content: ""; position: absolute; top: -7px; right: 21px; width: 12px; height: 12px; background: var(--white);
	border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg);
}
.pop.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.pop__head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; }
.pop__head strong { display: block; font: 400 18px/1.2 var(--serif); color: var(--ink); }
.pop__head small { display: block; font-size: 12.5px; color: var(--muted); }
.pop__section { padding: 0 18px 14px; }
.pop__label { font: 600 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 2px 0 10px; display: flex; justify-content: space-between; align-items: center; }
.pop__label a { font: 500 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--olive-700); }
.pets { display: flex; gap: 8px; flex-wrap: wrap; }
.pet { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 3px; border-radius: 999px; background: var(--sand); font-size: 13px; color: var(--ink); transition: background .15s; }
.pet:hover { background: #E5E0D2; }
.pet img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.pet--add { padding: 0 12px; background: none; border: 1px dashed #CFC7B8; color: var(--muted); }
.pet--add:hover { border-color: var(--olive-700); color: var(--olive-700); background: none; }
.next-appt { display: flex; gap: 12px; align-items: center; margin: 0 18px 12px; padding: 12px; border-radius: 10px; background: var(--olive-100); font-size: 13px; color: var(--ink); line-height: 1.35; }
.next-appt .ico { font-size: 22px; color: var(--olive-700); }
.next-appt small { display: block; color: var(--muted); font-size: 12px; }
.menu-list { list-style: none; margin: 0; padding: 6px 8px; border-top: 1px solid var(--line); }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; background: none; border-radius: 9px; font-size: 14px; color: #3F3C38; text-align: left; transition: background .12s; }
.menu-list a:hover, .menu-list button:hover { background: var(--sand); color: var(--ink); }
.menu-list .ico { font-size: 19px; color: var(--muted); }
.menu-list .pill { margin-left: auto; font-size: 11.5px; font-weight: 500; padding: 3px 8px; border-radius: 999px; background: var(--olive-100); color: var(--olive-700); }
.menu-list .pill--warn { background: var(--warn-bg); color: var(--warn); }
.menu-list--foot { padding-bottom: 8px; }
.pop__guest { padding: 20px 18px 18px; }
.pop__guest strong { display: block; font: 400 19px/1.25 var(--serif); color: var(--ink); }
.pop__guest p { margin: 6px 0 16px; font-size: 13px; color: var(--muted); }
.pop__guest .btn { height: 42px; font-size: 14px; }
.pop__guest .btn + .btn { margin-top: 8px; }
.benefits { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 9px; font-size: 13px; color: #3F3C38; }
.benefits li { display: flex; gap: 10px; align-items: center; }
.benefits .ico { font-size: 17px; color: var(--olive-700); }

/* Favoritos (vista rápida) */
.mini-list { list-style: none; margin: 0; padding: 4px 10px; }
.mini-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; }
.mini-item:hover { background: var(--surface); }
.mini-item .sr__thumb { width: 52px; height: 52px; }
.mini-item__name { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; color: #3F3C38; }
.mini-item__name b { display: block; font-weight: 600; color: var(--ink); margin-top: 2px; }
.icon-btn { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--olive-700); font-size: 16px; flex: none; transition: background .15s, border-color .15s; }
.icon-btn:hover { background: var(--olive-700); border-color: var(--olive-700); color: #fff; }
.pop__foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.pop__foot .btn { height: 40px; font-size: 13.5px; }
.pop__empty { padding: 26px 22px; text-align: center; }
.pop__empty .ico { font-size: 30px; color: #B3AC9F; display: block; margin: 0 auto 8px; }
.pop__empty strong { display: block; font: 400 17px/1.3 var(--serif); color: var(--ink); }
.pop__empty p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Paneles laterales (mini carrito y menú móvil) + scrim
   -------------------------------------------------------------------------- */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(32,34,22,.42); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s linear .25s; }
body.cart-open .scrim, body.menu-open .scrim, body.msearch-open .scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
body.cart-open, body.menu-open, body.msearch-open { overflow: hidden; }

.sheet:focus { outline: none; }
.sheet { position: fixed; top: 0; bottom: 0; z-index: 100; display: flex; flex-direction: column; background: var(--bg); box-shadow: -10px 0 40px rgba(32,34,22,.14);
	visibility: hidden; transition: transform .32s var(--ease-out), visibility 0s linear .32s; } /* oculto al cerrar: su sombra no se asoma por la orilla */
body.cart-open .cart, body.menu-open .drawer { visibility: visible; transition-delay: 0s; }
.sheet--right { right: 0; width: min(100vw, 430px); transform: translateX(100%); }
.sheet--left { left: 0; width: min(88vw, 360px); transform: translateX(-100%); box-shadow: 10px 0 40px rgba(32,34,22,.14); }
body.cart-open .cart { transform: none; }
body.menu-open .drawer { transform: none; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 14px 16px 22px; border-bottom: 1px solid var(--line); background: var(--bg); }
.sheet__head h2 { margin: 0; font: 400 21px/1.2 var(--serif); color: var(--ink); }
.sheet__head h2 small { font: 400 13px var(--sans); color: var(--muted); margin-left: 4px; }
.sheet__close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; border-radius: 50%; font-size: 22px; color: var(--icon); }
.sheet__close:hover { background: var(--field); }
.sheet__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

/* Mini carrito */
.ship-note { display: flex; gap: 12px; align-items: center; margin: 14px 22px 4px; padding: 12px 14px; border-radius: 10px; background: var(--olive-100); font-size: 13px; color: var(--ink); line-height: 1.35; }
.ship-note .ico { font-size: 22px; color: var(--olive-700); }
.ship-note small { display: block; color: var(--muted); font-size: 12px; }
.ship-note b { font-weight: 600; }
.cart-items { list-style: none; margin: 0; padding: 6px 22px; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); transition: opacity .25s, transform .25s; }
.cart-item.is-removing { opacity: 0; transform: translateX(24px); }
.cart-item__img { width: 72px; height: 72px; border-radius: 10px; background: var(--surface) center / contain no-repeat; border: 1px solid var(--line); }
.cart-item__name { font-size: 13.5px; line-height: 1.35; color: var(--ink); margin: 2px 0 2px; }
.cart-item__meta { font-size: 12px; color: var(--muted); }
.cart-item__price { font-size: 14px; font-weight: 600; color: var(--ink); text-align: right; }
.cart-item__unit { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.cart-item__row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.qty { display: inline-flex; align-items: center; height: 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.qty button { display: grid; place-items: center; width: 34px; height: 32px; border: 0; background: none; color: var(--icon); font-size: 15px; border-radius: 50%; }
.qty button:hover:not(:disabled) { color: var(--olive-700); background: var(--field); }
.qty button:disabled { color: #C9C3B8; cursor: not-allowed; }
.qty output { min-width: 24px; text-align: center; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.link-btn { border: 0; background: none; padding: 6px 4px; font-size: 12.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--err); }
.upsell { padding: 18px 22px 22px; }
.upsell__title { font: 400 16px/1.2 var(--serif); color: var(--ink); margin: 0 0 12px; }
.upsell__row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.upsell__card { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.upsell__card .sr__thumb { width: 46px; height: 46px; }
.upsell__card div { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; color: #3F3C38; }
.upsell__card b { display: block; color: var(--ink); margin-top: 2px; }
.upsell__card .icon-btn { width: 32px; height: 32px; }
.cart__foot { padding: 16px 22px 20px; border-top: 1px solid var(--line); background: var(--white); }
.cart__total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.cart__total span { font-size: 14px; color: var(--text); }
.cart__total strong { font: 600 20px/1 var(--sans); color: var(--ink); }
.cart__note { margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.cart__foot .btn { height: 48px; font-size: 15px; }
.cart__foot .btn--ghost { margin-top: 8px; height: 44px; border-color: transparent; }
.cart__foot .btn--ghost:hover { border-color: var(--line); }
.cart-empty { text-align: center; padding: 48px 28px 24px; }
.cart-empty__ico { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; background: var(--sand); font-size: 36px; color: var(--olive-700); }
.cart-empty strong { display: block; font: 400 21px/1.25 var(--serif); color: var(--ink); }
.cart-empty p { margin: 8px auto 20px; max-width: 280px; font-size: 13.5px; color: var(--muted); }

/* Animación "vuela al carrito" */
.fly { position: fixed; z-index: 140; pointer-events: none; border-radius: 10px; object-fit: contain; background: var(--surface); box-shadow: 0 8px 24px rgba(32,34,22,.2); }

/* --------------------------------------------------------------------------
   Alertas bajo el header (contextuales, se pueden cerrar)
   -------------------------------------------------------------------------- */
.alerts { position: relative; z-index: 40; }
.alert { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .3s var(--ease-out), opacity .3s; }
.alert.is-closing { grid-template-rows: 0fr; opacity: 0; }
.alert > div { overflow: hidden; }
.alert__inner { display: flex; align-items: center; gap: 14px; min-height: 52px; padding-top: 8px; padding-bottom: 8px; font-size: 13.5px; }
.alert__ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.6); font-size: 17px; flex: none; }
.alert__text { flex: 1; min-width: 0; color: var(--ink); line-height: 1.4; }
.alert__text b { font-weight: 600; }
.alert__action { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; border: 1px solid currentColor; transition: background .15s, color .15s; }
.alert__close { display: grid; place-items: center; width: 34px; height: 34px; border: 0; background: none; border-radius: 50%; font-size: 17px; color: var(--muted); flex: none; }
.alert__close:hover { background: rgba(255,255,255,.6); color: var(--ink); }
.alert--ok   { background: var(--ok-bg); }   .alert--ok   .alert__ico, .alert--ok   .alert__action { color: var(--ok); }
.alert--info { background: var(--info-bg); } .alert--info .alert__ico, .alert--info .alert__action { color: var(--info); }
.alert--warn { background: var(--warn-bg); } .alert--warn .alert__ico, .alert--warn .alert__action { color: var(--warn); }
.alert--ok .alert__action:hover { background: var(--ok); color: #fff; }
.alert--info .alert__action:hover { background: var(--info); color: #fff; }
.alert--warn .alert__action:hover { background: var(--warn); color: #fff; }
.alert + .alert { border-top: 1px solid rgba(46,49,31,.06); }

/* --------------------------------------------------------------------------
   Avisos flotantes (toasts)
   -------------------------------------------------------------------------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
	position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; overflow: hidden;
	background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop);
	pointer-events: auto; animation: toast-in .32s var(--ease-out);
}
.toast.is-leaving { animation: toast-out .22s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
.toast__ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; flex: none; }
.toast__thumb { width: 44px; height: 44px; border-radius: 8px; background: var(--surface) center / contain no-repeat; border: 1px solid var(--line); flex: none; }
.toast__body { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; color: var(--muted); }
.toast__body strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.toast__body span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast__action { border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--olive-700); white-space: nowrap; }
.toast__action:hover { background: var(--olive-100); }
.toast__close { display: grid; place-items: center; width: 30px; height: 30px; border: 0; background: none; border-radius: 50%; color: var(--muted); font-size: 15px; flex: none; }
.toast__close:hover { background: var(--field); color: var(--ink); }
.toast__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; animation: toast-bar linear forwards; }
.toast:hover .toast__bar { animation-play-state: paused; }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast--ok   .toast__ico { background: var(--ok-bg);   color: var(--ok); }   .toast--ok   .toast__bar { background: var(--ok); }
.toast--info .toast__ico { background: var(--info-bg); color: var(--info); } .toast--info .toast__bar { background: var(--info); }
.toast--warn .toast__ico { background: var(--warn-bg); color: var(--warn); } .toast--warn .toast__bar { background: var(--warn); }
.toast--err  .toast__ico { background: var(--err-bg);  color: var(--err); }  .toast--err  .toast__bar { background: var(--err); }

/* --------------------------------------------------------------------------
   Menú móvil
   -------------------------------------------------------------------------- */
.burger, .search-toggle { display: none; place-items: center; width: 44px; height: 44px; border: 0; background: none; border-radius: 50%; color: var(--icon); font-size: 24px; flex: none; }
.drawer .sheet__head img { height: 42px; width: auto; }
.drawer__user { display: flex; align-items: center; gap: 12px; margin: 16px 18px 6px; padding: 14px; border-radius: 12px; background: var(--sand); }
.drawer__user strong { display: block; font: 400 17px/1.2 var(--serif); color: var(--ink); }
.drawer__user a { font-size: 13px; color: var(--olive-700); }
.drawer__tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 18px 6px; }
.drawer__tiles a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); font-size: 12.5px; color: #3F3C38; text-align: center; }
.drawer__tiles .ico { font-size: 21px; color: var(--olive-700); }
.drawer__tiles .badge { top: 6px; right: 10px; }
.drawer__guest { margin: 16px 18px 6px; padding: 16px; border-radius: 12px; background: var(--sand); }
.drawer__guest strong { display: block; font: 400 17px/1.25 var(--serif); color: var(--ink); margin-bottom: 12px; }
.drawer__guest .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawer__guest .btn { height: 44px; padding: 0 12px; font-size: 14px; }
.drawer__nav { padding: 8px 0; }
.drawer__nav > a, .acc__btn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; padding: 0 20px; border: 0; border-bottom: 1px solid var(--line); background: none; font-size: 16px; color: var(--ink); text-align: left; }
.drawer__nav > a.is-current { color: var(--olive-700); font-weight: 500; }
.acc__btn .ico { font-size: 18px; color: var(--muted); transition: transform .25s var(--ease-out); }
.acc__btn[aria-expanded="true"] .ico { transform: rotate(180deg); }
.acc__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s var(--ease-out); background: var(--surface); }
.acc__panel.is-open { grid-template-rows: 1fr; }
.acc__panel > div { overflow: hidden; }
.acc__panel a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 20px 0 26px; border-bottom: 1px solid var(--line); font-size: 15px; color: #3F3C38; }
.acc__panel .mega__thumb { width: 34px; height: 34px; border-radius: 7px; }
.drawer__cta { padding: 18px 18px 8px; }
.drawer__cta .btn { width: 100%; height: 48px; font-size: 15px; }
.drawer__help { display: flex; gap: 10px; align-items: center; padding: 10px 20px 26px; font-size: 13px; color: var(--muted); }
.drawer__help .ico { font-size: 17px; }
.drawer__logout { display: flex; align-items: center; gap: 10px; width: calc(100% - 36px); margin: 0 18px 24px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: none; font-size: 14px; color: var(--muted); }

/* Búsqueda móvil a pantalla completa */
.msearch { position: fixed; inset: 0; z-index: 100; height: 100dvh; background: var(--bg); transform: translateY(-100%); visibility: hidden; transition: transform .3s var(--ease-out), visibility 0s linear .3s; }
.msearch:focus { outline: none; }
body.msearch-open .msearch { transform: none; visibility: visible; transition-delay: 0s; }
/* La barra es una rejilla: flecha + campo arriba, resultados a todo el ancho debajo */
.msearch__bar { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto 1fr; gap: 0 6px; height: 100%; padding: 12px 12px 0 6px; }
.msearch .search { display: contents; }
.msearch .search__field { align-self: center; }
.msearch .search input { height: 46px; font-size: 16px; } /* 16px evita el zoom de iOS */
.msearch__results { grid-column: 1 / -1; overflow-y: auto; margin: 12px -12px 0 -6px; border-top: 1px solid var(--line); overscroll-behavior: contain; }
.msearch .search__panel { position: static; width: auto; max-height: none; opacity: 1; visibility: visible; transform: none; border: 0; box-shadow: none; border-radius: 0; padding: 6px 10px 24px; }

/* Visibilidad por estado de sesión */
body[data-auth="guest"] .only-user { display: none !important; }
body[data-auth="user"] .only-guest { display: none !important; }

/* --------------------------------------------------------------------------
   Responsive del header
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
	.nav { padding-left: 16px; }
	.nav__list { gap: 24px; }
	.search { width: 190px; }
	.mega__inner { grid-template-columns: 1.4fr 1fr 1.1fr; }
	.mega__inner > .mega__col--brands { display: none; }
}
@media (max-width: 1100px) {
	.header__inner, .site-header.is-compact .header__inner { height: 68px; gap: 4px; }
	.logo img, .site-header.is-compact .logo img,
	.logo__anim, .site-header.is-compact .logo__anim { height: 44px; }
	.nav, .header__inner > .search, .mega { display: none; }
	.burger { display: grid; order: -1; margin-left: -10px; }
	.search-toggle { display: grid; }
	.actions { margin-left: auto; gap: 0; }
	.act__btn { width: 44px; height: 44px; }
	.badge { top: 2px; right: 0; }
	.topbar__right { display: none; }
	.topbar__inner { grid-template-columns: auto 1fr; }
	.ticker { justify-self: end; min-width: 0; width: 100%; text-align: right; }
	.ticker__msg { justify-content: flex-end; }
}
@media (max-width: 720px) {
	.topbar__left { display: none; }
	.topbar__inner { grid-template-columns: 1fr; }
	.ticker, .ticker__msg { justify-content: center; text-align: center; }
	/* Popovers como hoja anclada bajo el header */
	.act { position: static; }
	.pop { position: fixed; top: 76px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 90px); overflow-y: auto; transform-origin: top center; }
	.pop::before { display: none; }
	.alert__inner { flex-wrap: wrap; gap: 10px 12px; }
	.alert__text { flex-basis: calc(100% - 90px); }
	.alert__action { margin-left: 44px; }
	.toasts { left: 16px; right: 16px; bottom: 16px; width: auto; }
}
@media (max-width: 480px) { .act-fav { display: none; } }
@media (max-width: 380px) { .act-account { display: none; } }
@media (pointer: coarse) {
	.qty button { width: 40px; height: 40px; }
	.qty { height: 42px; }
	.icon-btn { width: 40px; height: 40px; }
	.link-btn { padding: 10px 4px; }
}

/* --------------------------------------------------------------------------
   Panel de demostración (solo con ?demo; no forma parte del diseño)
   -------------------------------------------------------------------------- */
.demo { position: fixed; left: 16px; bottom: 16px; z-index: 130; font-family: var(--sans); }
.demo__toggle { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: #1F2216; color: #fff; font-size: 13px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.demo__panel { display: none; position: absolute; left: 0; bottom: 50px; width: 330px; max-height: min(72vh, 640px); overflow-y: auto; padding: 14px; border-radius: 14px; background: #1F2216; color: #E9E6DA; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.demo.is-open .demo__panel { display: block; }
.demo__group + .demo__group { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); }
.demo__group > span { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #A9A691; margin-bottom: 8px; }
.demo__group > div { display: flex; flex-wrap: wrap; gap: 6px; }
.demo__group button { height: 30px; padding: 0 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(255,255,255,.04); color: #F2F0E6; font-size: 12px; }
.demo__group button:hover { background: rgba(255,255,255,.12); }
.demo__group button.is-on { background: #E6E8DA; color: #1F2216; border-color: #E6E8DA; }
@media (max-width: 600px) { .demo { left: 10px; bottom: 10px; } .demo__panel { width: calc(100vw - 20px); max-height: 55vh; } }
