/* Menú app + FAB carrito — solo móvil */

.sh-app-nav,
.sh-cart-fab,
.sh-cats-fab {
  display: none;
}

@media (max-width: 720px) {
  .sh-app-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    min-height: 64px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.08);
    transition: transform .42s cubic-bezier(.22, 1, .36, 1), opacity .28s ease;
  }

  .sh-app-nav.is-logged-in {
    grid-template-columns: repeat(3, 1fr);
  }

  .sh-app-nav.is-guest [data-app-nav-orders] {
    display: none !important;
  }

  .sh-app-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: var(--sh-muted, #7a7468);
    font-family: var(--sh-sans, Manrope, system-ui, sans-serif);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 12px;
    transition: color .2s ease, background .2s ease;
  }

  .sh-app-nav-item svg {
    display: block;
  }

  .sh-app-nav-item.is-active,
  .sh-app-nav-item:active {
    color: var(--sh-olive, #000000);
    background: rgba(0, 0, 0, 0.08);
  }

  /* FAB carrito — flota encima, a la derecha del menú */
  .sh-cart-fab {
    display: grid;
    place-items: center;
    position: fixed;
    right: 16px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 41;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: var(--sh-olive, #000000);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    transition: transform .2s ease, box-shadow .2s ease, opacity .28s ease;
  }

  .sh-cart-fab:active {
    transform: scale(0.94);
  }

  .sh-cart-fab .cart-num {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    border: 1px solid #111;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: none;
  }

  .sh-cart-fab .cart-num:empty,
  body:not(.has-cart-items) .sh-cart-fab .cart-num {
    display: none;
  }

  /* Espacio para menú inferior + FABs (carrito/cats) sin tapar CTAs */
  .kinlig-body {
    padding-bottom: calc(148px + env(safe-area-inset-bottom));
  }

  .product-detial .product-buybox .product-buybox-add,
  .product-detial .product-buybox .btn-primary,
  .product-detial .product-buybox .product-buybox-add.is-disabled {
    margin-bottom: 12px;
  }

  .kinlig-home .sh-footer,
  .sh-footer {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  /* Sin carrito duplicado en header */
  .sh-header-actions .cart-opener {
    display: none !important;
  }

  /* Ocultar nav/FAB cuando hay sheets/modales abiertos */
  body.modal-cart-open .sh-app-nav,
  body.checkout-sheet-open .sh-app-nav,
  body.cuenta-app-open .sh-app-nav,
  body.cuenta-auth-open .sh-app-nav,
  body.modal-product-open .sh-app-nav,
  body.modal-cats-open .sh-app-nav {
    transform: translateY(110%);
    pointer-events: none;
  }

  body.modal-cart-open .sh-cart-fab,
  body.checkout-sheet-open .sh-cart-fab,
  body.cuenta-app-open .sh-cart-fab,
  body.cuenta-auth-open .sh-cart-fab,
  body.modal-product-open .sh-cart-fab,
  body.modal-cats-open .sh-cart-fab,
  body.modal-cart-open .sh-cats-fab,
  body.checkout-sheet-open .sh-cats-fab,
  body.cuenta-app-open .sh-cats-fab,
  body.cuenta-auth-open .sh-cats-fab,
  body.modal-product-open .sh-cats-fab,
  body.modal-cats-open .sh-cats-fab {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
  }

  /* FAB categorías: alineado con el carrito (misma altura y tamaño) */
  .sh-cats-fab {
    display: grid;
    place-items: center;
    position: fixed;
    left: 16px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 41;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 0;
    background: #111;
    color: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  }

  .sh-cats-fab:active {
    transform: scale(0.94);
  }
}

/* Menú móvil — fullscreen, logo arriba al centro, links en el medio */
.cats-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  z-index: 10001;
  background: var(--sh-cream, #111);
  color: var(--sh-ink, #fff);
  display: flex;
  flex-direction: column;
  transform: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: none;
}

.modal-cats-open .cats-modal {
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-cats-open {
  overflow: hidden;
}

.cats-modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: static;
  flex: 0 0 auto;
  min-height: 0;
  margin-top: auto;
  padding: 0 28px 22px;
  border: 0;
  background: transparent;
}

.cats-modal-header h2 {
  display: none;
}

.cats-modal-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(280px, 72vw);
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-cats-open .cats-modal-logo {
  opacity: 1;
  transform: none;
  transition-delay: 0.1s;
}

.cats-modal-logo-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 56px;
  object-fit: contain;
}

.cats-modal-logo-img--light {
  display: none;
}

body.theme-is-dark .cats-modal-logo-img--dark {
  display: none;
}

body.theme-is-dark .cats-modal-logo-img--light {
  display: block;
}

.cats-modal-logo-text {
  font-family: var(--sh-serif, Georgia, serif);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cats-modal-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  z-index: 2;
  border: 0;
  background: transparent;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: var(--sh-ink, #fff);
  padding: 4px 8px;
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-cats-open .cats-modal-close {
  opacity: 1;
  transition-delay: 0.22s;
}

.cats-modal-body {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: auto;
  padding: 0 28px 8px;
  -webkit-overflow-scrolling: touch;
  text-align: center;
}

.cats-modal-body > * {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.58s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-cats-open .cats-modal-body > *:nth-child(1) { transition-delay: 0.14s; }
.modal-cats-open .cats-modal-body > *:nth-child(2) { transition-delay: 0.2s; }
.modal-cats-open .cats-modal-body > *:nth-child(3) { transition-delay: 0.26s; }
.modal-cats-open .cats-modal-body > *:nth-child(4) { transition-delay: 0.32s; }
.modal-cats-open .cats-modal-body > *:nth-child(5) { transition-delay: 0.38s; }
.modal-cats-open .cats-modal-body > *:nth-child(6) { transition-delay: 0.44s; }
.modal-cats-open .cats-modal-body > *:nth-child(7) { transition-delay: 0.5s; }
.modal-cats-open .cats-modal-body > *:nth-child(8) { transition-delay: 0.56s; }
.modal-cats-open .cats-modal-body > *:nth-child(n+9) { transition-delay: 0.6s; }

.modal-cats-open .cats-modal-body > * {
  opacity: 1;
  transform: none;
}

.cats-modal-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
  border: 0;
  margin-top: auto;
  flex: 0 0 auto;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-cats-open .cats-modal-social {
  opacity: 1;
  transform: none;
  transition-delay: 0.36s;
}

.cats-social-link {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--sh-ink, #fff);
  text-decoration: none;
  border: 0;
  background: transparent;
  transition: opacity 0.2s ease;
}

.cats-social-link:active,
a.cats-social-link:hover {
  opacity: 0.55;
}

.cats-social-link.is-empty {
  color: var(--sh-muted, #888);
  cursor: default;
}

.cats-link {
  display: block;
  padding: 12px 16px;
  color: var(--sh-ink, #fff);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  border: 0;
  background: transparent;
  text-align: center;
  width: 100%;
}

.cats-store-pages {
  margin-top: 28px;
  padding-top: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}

.cats-store-pages-label {
  margin: 0 0 10px;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sh-muted, #888);
}

.cats-link--label {
  display: block;
  padding: 12px 16px;
  color: var(--sh-ink, #fff);
  font-size: 18px;
  font-weight: 600;
  cursor: default;
  border: 0;
}

.cats-link-all {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
}

.cats-link-child {
  padding-left: 16px;
  font-weight: 500;
  font-size: 16px;
  color: var(--sh-muted, #aaa);
}

.cats-acc {
  width: 100%;
}

.cats-acc-row {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
}

.cats-acc-row .cats-link {
  border: 0;
  width: auto;
  flex: 0 1 auto;
}

.cats-acc-toggle {
  border: 0;
  background: transparent;
  width: 40px;
  flex: 0 0 auto;
  font-size: 18px;
  cursor: pointer;
  color: var(--sh-ink, #fff);
}

.cats-acc-panel[hidden] {
  display: none !important;
}

@media (min-width: 721px) {
  .sh-cats-fab,
  .cats-modal {
    display: none !important;
  }
}
