/* Mobile refinements – keep light; main styles in shop.css */
:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --cart-bar-h: 60px;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.site-header { padding-top: 0 !important; }

.mobile-cart-bar {
  padding-bottom: calc(.65rem + var(--safe-bottom));
}

.mobile-call-fab {
  bottom: calc(var(--cart-bar-h) + var(--safe-bottom) + 10px);
}

.app-toast-wrap {
  top: calc(.75rem + var(--safe-top)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%);
  width: min(92vw, 22rem);
  padding-top: .5rem !important;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.app-toast-wrap .toast {
  pointer-events: auto;
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
}

@media (min-width: 992px) {
  .app-toast-wrap {
    top: 1rem !important;
  }
  .mobile-cart-bar { display: none !important; }
}

@media (max-width: 991.98px) {
  body {
    padding-bottom: calc(var(--cart-bar-h) + var(--safe-bottom) + 8px) !important;
  }

  /* Apple-like bottom sheet cart */
  #cartDrawer.offcanvas-end {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: min(88vh, 720px) !important;
    max-height: calc(100dvh - 12px);
    border: 0 !important;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, .18);
    --cart-sheet-y: 100%;
    transform: translate3d(0, var(--cart-sheet-y), 0) !important;
    visibility: visible;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: transform .32s cubic-bezier(.22, 1, .36, 1);
  }
  #cartDrawer.offcanvas-end.showing,
  #cartDrawer.offcanvas-end.show:not(.hiding) {
    --cart-sheet-y: 0%;
  }
  #cartDrawer.offcanvas-end.hiding {
    --cart-sheet-y: 100%;
  }
  #cartDrawer.offcanvas-end.is-dragging {
    transition: none !important;
  }
  #cartDrawer .cart-sheet-header {
    position: relative;
    padding-top: 1.15rem;
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
    user-select: none;
  }
  #cartDrawer .cart-sheet-handle {
    position: absolute;
    top: .45rem;
    left: 50%;
    transform: translateX(-50%);
    width: 3rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #cartDrawer .cart-sheet-handle span {
    display: block;
    width: 2.25rem;
    height: .28rem;
    border-radius: 999px;
    background: #c5cedb;
  }
  #cartDrawer .offcanvas-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .btn-primary-shop,
  .btn-outline-shop {
    min-height: 44px;
  }

  /* Product cards: keep qty + cart icon compact and equal height */
  .product-card__buy .btn-primary-shop,
  .product-card__buy .btn-cart-add,
  .product-list-row .btn-cart-add {
    min-height: 0;
  }
  .product-card .qty-control,
  .product-list-row .qty-control {
    height: 40px;
  }
  .product-card .qty-control button,
  .product-list-row .qty-control button {
    width: 32px;
    height: auto;
  }
  .product-card .qty-control select,
  .product-card .qty-control .qty-value,
  .product-list-row .qty-control select,
  .product-list-row .qty-control .qty-value {
    height: 100%;
  }

  .brand-tag { display: none; }
  .brand-title { font-size: .95rem; }
}

@media (min-width: 992px) {
  #cartDrawer .cart-sheet-handle { display: none; }
  #cartDrawer .cart-sheet-header { padding-top: var(--bs-offcanvas-padding, 1rem); }
}

@media (min-width: 700px) and (max-width: 991.98px) {
  .product-list-row {
    grid-template-columns: 100px 1fr auto;
    align-items: center;
  }
}
