/* Cabecera compartida tienda UAYU® — móvil (bar + subnav) y desktop (shell) */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

.tienda-header {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

.tienda-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-height: 3.25rem;
  box-sizing: border-box;
  padding: 0.45rem 10px;
}

.tienda-header-bar .tienda-header-logo,
.tienda-header-bar .store-header-logo {
  position: static;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  z-index: 2;
}

.tienda-header-bar .tienda-header-logo-img,
.tienda-header-bar .store-logo {
  width: auto !important;
  height: 2.35rem;
  max-height: 2.35rem;
  max-width: 5.75rem;
}

.tienda-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex: 0 0 auto;
  min-width: 0;
}

.tienda-header-wallet-mount {
  display: flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
}

.tienda-header-cart {
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tienda-nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: #0f766e;
  color: #fff !important;
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1.1;
  white-space: nowrap;
  text-decoration: none !important;
  box-shadow: 0 2px 10px rgba(15, 118, 110, 0.28);
}

.tienda-nav-cta:hover {
  opacity: 0.92;
  color: #fff !important;
}

.tienda-header-waitlist {
  flex-shrink: 0;
  white-space: nowrap;
  border-radius: 9999px;
  padding: 0.35rem 0.55rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 8.5px;
  line-height: 1.2;
  box-shadow: 0 0 0 2px #fbbf24;
  background: linear-gradient(to bottom right, #fffbeb, #f0fdfa);
  color: #134e4a;
  text-decoration: none;
}

.tienda-header-shell {
  display: none;
  min-width: 0;
  max-width: 100%;
}

.tienda-header-subnav {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.tienda-header-subnav-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tienda-header-subnav-inner {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 12px;
  width: max-content;
  box-sizing: border-box;
}

.logo,
.logo img,
.store-logo,
.store-logo img,
.header-logo,
.header-logo img,
.tienda-header-logo,
.tienda-header-logo img {
  display: block;
  width: auto;
  height: auto;
  max-width: none !important;
  object-fit: contain;
  overflow: visible;
  flex-shrink: 0;
}

.tienda-header-bar .store-header-logo,
.tienda-header-bar .tienda-header-logo,
.store-header .logo {
  width: auto;
  min-width: auto;
  height: auto;
  overflow: visible;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.tienda-header-bar .store-header-logo img,
.tienda-header-bar .tienda-header-logo img,
.tienda-header-bar .tienda-header-logo-img {
  width: auto !important;
  height: 2.35rem;
  max-height: 2.35rem;
  max-width: 5.75rem;
  object-fit: contain;
  object-position: center center;
  border-radius: 0;
}

.tienda-header-waitlist,
.tienda-header-cart,
.tienda-header-actions {
  flex-shrink: 0;
}

.tienda-header-nav {
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.tienda-header-nav::-webkit-scrollbar,
.tienda-header-subnav-scroll::-webkit-scrollbar {
  display: none;
}

.tienda-header-chip {
  flex: 0 0 auto;
  white-space: nowrap;
}

.tienda-header-chip--waitlist {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  box-shadow: 0 0 0 2px #fbbf24;
  background: linear-gradient(to bottom right, #fffbeb, #f0fdfa);
  color: #134e4a;
  text-decoration: none;
}

/* —— Menú móvil (drawer izquierdo) —— */
.tienda-header-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #e7e5e4;
  border-radius: 0.55rem;
  background: #fff;
  color: #134e4a;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  -webkit-tap-highlight-color: transparent;
}

.tienda-header-menu-btn:hover,
.tienda-header-menu-btn:focus-visible {
  border-color: #0f766e;
  background: #f0fdfa;
  outline: none;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.25);
}

.tienda-header-menu-btn__bars {
  display: block;
  width: 1.05rem;
  height: 0.7rem;
  background: linear-gradient(
    to bottom,
    currentColor 0,
    currentColor 2px,
    transparent 2px,
    transparent 5px,
    currentColor 5px,
    currentColor 7px,
    transparent 7px,
    transparent 10px,
    currentColor 10px,
    currentColor 12px
  );
}

html.tienda-menu-open,
html.tienda-menu-open body {
  overflow: hidden;
}

.tienda-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
}

.tienda-mobile-menu.is-open {
  pointer-events: auto;
}

.tienda-mobile-menu__overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.tienda-mobile-menu.is-open .tienda-mobile-menu__overlay {
  opacity: 1;
}

.tienda-mobile-menu__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(18.5rem, 88vw);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e7e5e4;
  box-shadow: 8px 0 32px rgba(28, 25, 23, 0.14);
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tienda-mobile-menu.is-open .tienda-mobile-menu__panel {
  transform: translateX(0);
}

.tienda-mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid #f5f5f4;
}

.tienda-mobile-menu__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #134e4a;
  letter-spacing: 0.01em;
}

.tienda-mobile-menu__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: #f5f5f4;
  color: #44403c;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.tienda-mobile-menu__close:hover,
.tienda-mobile-menu__close:focus-visible {
  background: #e7e5e4;
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

.tienda-mobile-menu__list {
  list-style: none;
  margin: 0;
  padding: 0.65rem 0.75rem;
  overflow-y: auto;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}

.tienda-mobile-menu__list--secondary {
  flex: 0 0 auto;
  padding-top: 0;
}

.tienda-mobile-menu__link {
  display: block;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1f2937;
  text-decoration: none;
  line-height: 1.3;
}

.tienda-mobile-menu__link:hover,
.tienda-mobile-menu__link:focus-visible {
  background: #f0fdfa;
  color: #0f766e;
  outline: none;
}

.tienda-mobile-menu__link.is-active {
  background: #0f766e;
  color: #fff;
  font-weight: 800;
}

.tienda-mobile-menu__link--waitlist {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8125rem;
  box-shadow: inset 0 0 0 2px #fbbf24;
  background: linear-gradient(to bottom right, #fffbeb, #f0fdfa);
  color: #134e4a;
}

.tienda-mobile-menu__link--digital {
  margin-top: 0.15rem;
  font-weight: 800;
  font-size: 0.875rem;
  background: #0f766e;
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(15, 118, 110, 0.28);
}

.tienda-mobile-menu__link--digital:hover,
.tienda-mobile-menu__link--digital:focus-visible {
  background: #115e59;
  color: #fff !important;
  opacity: 0.95;
}

.tienda-mobile-menu__divider {
  height: 1px;
  margin: 0 1rem;
  background: #e7e5e4;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .tienda-mobile-menu__panel,
  .tienda-mobile-menu__overlay {
    transition: none;
  }
}

.tienda-account-nav-mount--subnav {
  display: none !important;
}

@media (min-width: 1024px) {
  .tienda-header-bar,
  .tienda-header-subnav {
    display: none;
  }

  .tienda-header-shell {
    display: flex;
  }

  .tienda-header-shell .tienda-header-logo,
  .tienda-header-shell .store-header-logo {
    width: auto;
    min-width: auto;
    display: flex;
  }

  .tienda-header-shell .tienda-header-logo img,
  .tienda-header-shell .store-header-logo img {
    width: auto;
    height: 2.25rem;
    max-height: 2.25rem;
  }

  .store-header.tienda-header,
  .tienda-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}

/* Móvil/tablet: fila 1 = logo + acciones; fila 2 = monedero (apilado, sin desborde) */
@media (max-width: 1023px) {
  .tienda-header {
    overflow: visible;
  }

  .tienda-header-subnav {
    display: none !important;
  }

  .tienda-header-menu-btn {
    display: inline-flex;
    grid-area: menu;
    justify-self: start;
  }

  .tienda-header-bar {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      'menu logo . actions'
      'wallet wallet wallet wallet';
    align-items: center;
    gap: 0.4rem 0.5rem;
    min-height: unset;
    padding-bottom: 0.35rem;
  }

  .tienda-header-bar .tienda-header-logo,
  .tienda-header-bar .store-header-logo,
  .tienda-header-bar .logo.header-logo {
    grid-area: logo;
  }

  .tienda-header-bar .tienda-header-actions {
    grid-area: actions;
    justify-self: end;
    flex-shrink: 0;
    max-width: 100%;
    min-width: 0;
  }

  .tienda-header-bar .tienda-header-wallet-mount {
    grid-area: wallet;
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
  }

  /* Columna solo dentro de la fila 2 — evita solapamiento con fila 1 */
  .tienda-header-bar .digital-wallet-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    gap: 0.3rem;
  }

  .tienda-header-bar .digital-wallet-bar__cuenta {
    align-self: flex-start;
    max-width: 100%;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
  }

  .tienda-header-bar .digital-wallet-bar__monedero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem 0.45rem;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    padding: 0.45rem 0.6rem;
  }

  .tienda-header-bar .digital-wallet-bar__teaser {
    flex: 1 1 8rem;
    min-width: 0;
    font-size: 0.6875rem;
    line-height: 1.3;
  }

  .tienda-header-bar .digital-wallet-bar__label {
    flex: 1 1 5rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tienda-header-bar .digital-wallet-bar__balance {
    font-size: 0.8125rem;
  }

  .tienda-header-bar .digital-wallet-bar__login,
  .tienda-header-bar .digital-wallet-bar__recharge {
    flex-shrink: 0;
    padding: 0.28rem 0.55rem;
    font-size: 0.6875rem;
  }

  .tienda-header-bar .tienda-account-nav-mount--topbar {
    display: none;
  }

  .tienda-header-waitlist,
  .tienda-header-cart {
    flex-shrink: 0;
  }
}

@media (max-width: 640px) {
  .tienda-header-bar {
    gap: 0.35rem;
    padding: 0.4rem 8px;
  }

  .tienda-header-bar .tienda-header-logo-img,
  .tienda-header-bar .store-logo {
    max-width: 4.85rem;
    height: 2.15rem;
    max-height: 2.15rem;
  }

  .tienda-header-bar .tienda-header-wallet-mount {
    max-width: 100%;
  }

  .tienda-header-waitlist {
    font-size: 8px;
    padding: 0.28rem 0.45rem;
  }

  .tienda-header-cart {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
    font-size: 0.6875rem !important;
  }
}

@media (max-width: 480px) {
  .tienda-header-bar .tienda-header-waitlist {
    display: none;
  }

  .tienda-header-bar .digital-wallet-bar__label {
    font-size: 0.5625rem;
    letter-spacing: 0.04em;
  }

  .tienda-header-bar .digital-wallet-bar__amount-line {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* Reserva inferior para FABs flotantes (Babeth + Soporte) en móvil */
:root {
  --tienda-fab-reserve: 4.5rem;
}

@media (max-width: 1023px) {
  html:has(.babeth-root),
  html:has(.uayu-support-root) {
    scroll-padding-bottom: calc(var(--tienda-fab-reserve) + env(safe-area-inset-bottom, 0px));
  }

  #tienda-page,
  body:has(.babeth-root):not(:has(#tienda-page)) {
    padding-bottom: calc(var(--tienda-fab-reserve) + env(safe-area-inset-bottom, 0px));
  }

  #tienda-page > main,
  body:not(:has(#tienda-page)) > main {
    padding-bottom: calc(1.25rem + var(--tienda-fab-reserve));
  }

  #tienda-page > footer,
  body:not(:has(#tienda-page)) > footer {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }
}
