/* 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 menú inferior: oculto — el menú vive en el header (.sh-menu-btn) */
  .sh-cats-fab {
    display: none !important;
  }
}

/* Drawer menú móvil — premium (sin líneas, logo, motion suave) */
.cats-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: min(100%, 340px);
  height: 100%;
  z-index: 10001;
  background: #fff;
  color: #111;
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 24px 0 64px rgba(0, 0, 0, 0.28);
  will-change: transform;
}

.modal-cats-open .cats-modal {
  transform: translateX(0);
}

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

.cats-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) 18px 18px;
  border-bottom: 0;
  flex-shrink: 0;
}

.cats-modal-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: calc(100% - 52px);
  text-decoration: none;
  color: inherit;
}

.cats-modal-logo {
  display: block;
  height: auto;
  max-height: 42px;
  max-width: min(200px, 58vw);
  width: auto;
  object-fit: contain;
}

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

/* Fondo oscuro del menú (Theme / NavDesign): logo blanco */
body.nav-mob-accordion .cats-modal-logo--dark:not(:only-child),
body.nav-mob-fullscreen .cats-modal-logo--dark:not(:only-child),
body.theme-is-dark .cats-modal-logo--dark:not(:only-child) {
  display: none;
}

body.nav-mob-accordion .cats-modal-logo--light,
body.nav-mob-fullscreen .cats-modal-logo--light,
body.theme-is-dark .cats-modal-logo--light {
  display: block;
}

.cats-modal-brand-text {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cats-modal-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  opacity: 0.72;
  border-radius: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.cats-modal-close:hover,
.cats-modal-close:focus-visible {
  opacity: 1;
  transform: rotate(90deg);
}

.cats-modal-body {
  flex: 1;
  overflow: auto;
  padding: 10px 8px 28px;
  -webkit-overflow-scrolling: touch;
}

.modal-cats-open .cats-modal-body > .cats-link,
.modal-cats-open .cats-modal-body > .cats-acc,
.modal-cats-open .cats-modal-body > .cats-store-pages > .cats-link,
.modal-cats-open .cats-modal-body > .cats-store-pages > .cats-acc {
  animation: catsNavIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-cats-open .cats-modal-body > .cats-link:nth-child(1),
.modal-cats-open .cats-modal-body > .cats-acc:nth-child(1),
.modal-cats-open .cats-store-pages > .cats-link:nth-child(1),
.modal-cats-open .cats-store-pages > .cats-acc:nth-child(1) { animation-delay: 0.06s; }
.modal-cats-open .cats-modal-body > .cats-link:nth-child(2),
.modal-cats-open .cats-modal-body > .cats-acc:nth-child(2),
.modal-cats-open .cats-store-pages > .cats-link:nth-child(2),
.modal-cats-open .cats-store-pages > .cats-acc:nth-child(2) { animation-delay: 0.11s; }
.modal-cats-open .cats-modal-body > .cats-link:nth-child(3),
.modal-cats-open .cats-modal-body > .cats-acc:nth-child(3),
.modal-cats-open .cats-store-pages > .cats-link:nth-child(3),
.modal-cats-open .cats-store-pages > .cats-acc:nth-child(3) { animation-delay: 0.16s; }
.modal-cats-open .cats-modal-body > .cats-link:nth-child(4),
.modal-cats-open .cats-modal-body > .cats-acc:nth-child(4),
.modal-cats-open .cats-store-pages > .cats-link:nth-child(4),
.modal-cats-open .cats-store-pages > .cats-acc:nth-child(4) { animation-delay: 0.21s; }
.modal-cats-open .cats-modal-body > .cats-link:nth-child(5),
.modal-cats-open .cats-modal-body > .cats-acc:nth-child(5),
.modal-cats-open .cats-store-pages > .cats-link:nth-child(5),
.modal-cats-open .cats-store-pages > .cats-acc:nth-child(5) { animation-delay: 0.26s; }

@keyframes catsNavIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cats-modal,
  .cats-modal-close,
  .cats-acc-toggle .cats-acc-chevron,
  .cats-acc-panel,
  .cats-link {
    transition: none !important;
    animation: none !important;
  }
}

.cats-modal-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  border-top: 0;
  margin-top: auto;
}

.cats-social-link {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #111;
  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: #111;
  cursor: default;
}

.cats-link {
  display: block;
  padding: 15px 18px;
  color: #111;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-bottom: 0;
  border-radius: 0;
  transition: color 0.28s ease, background-color 0.28s ease, opacity 0.28s ease, transform 0.28s ease;
}

.cats-link:hover,
.cats-link:focus-visible {
  background: transparent;
  opacity: 0.72;
}

.cats-store-pages {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cats-store-pages--solo {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.cats-store-pages-label {
  margin: 8px 18px 4px;
  padding: 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #888;
  opacity: 0.8;
}

.cats-link--label {
  display: block;
  padding: 15px 18px;
  color: #111;
  font-size: 16px;
  font-weight: 500;
  cursor: default;
  border-bottom: 0;
}

.cats-link-all {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 650;
  opacity: 0.7;
  margin-bottom: 6px;
}

.cats-link-child {
  padding: 11px 18px 11px 28px;
  font-weight: 400;
  font-size: 14px;
  color: #444;
  opacity: 0.9;
}

.cats-acc {
  border: 0;
}

.cats-acc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-bottom: 0;
}

.cats-acc-row .cats-link {
  border-bottom: 0;
}

.cats-acc-toggle {
  border: 0;
  background: transparent;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
  transition: opacity 0.28s ease;
}

.cats-acc-toggle:hover,
.cats-acc-toggle:focus-visible,
.cats-acc.is-open .cats-acc-toggle {
  opacity: 1;
}

.cats-acc-toggle .cats-acc-chevron {
  display: block;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.cats-acc.is-open .cats-acc-toggle .cats-acc-chevron {
  transform: rotate(180deg);
}

.cats-acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.cats-acc.is-open .cats-acc-panel {
  grid-template-rows: 1fr;
}

.cats-acc-panel-inner {
  overflow: hidden;
  min-height: 0;
}

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

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