/* 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);
  }
}

/* Drawer categorías — móvil (entra de izquierda) */
.cats-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: min(100%, 360px);
  height: 100%;
  z-index: 10001;
  background: #fff;
  color: #111;
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 12px 0 40px rgba(0,0,0,0.14);
}

.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;
  padding: 22px 20px 16px;
  border-bottom: 1px solid #e8e8e8;
}

.cats-modal-header h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cats-modal-close {
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #111;
  padding: 0 4px;
}

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

.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: 14px 20px;
  color: #111;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid #f0f0f0;
}

.cats-store-pages {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.cats-link--label {
  display: block;
  padding: 14px 20px;
  color: #111;
  font-size: 15px;
  font-weight: 600;
  cursor: default;
}

.cats-link-all {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
}

.cats-link-child {
  padding-left: 34px;
  font-weight: 500;
  font-size: 14px;
  color: #444;
}

.cats-acc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  border-bottom: 1px solid #f0f0f0;
}

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

.cats-acc-toggle {
  border: 0;
  background: transparent;
  width: 48px;
  font-size: 18px;
  cursor: pointer;
  color: #111;
}

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

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