/**
 * Mobile UX — giftstore.co.il storefront
 * Touch targets, safe areas, bottom-stack, checkout bar, filters drawer.
 */

/* ── P0: Touch targets (min 44px) ── */
@media (max-width: 760px) {
  .hd-icon {
    width: 44px;
    height: 44px;
  }

  .hd-search-close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .dr-close {
    width: 44px;
    height: 44px;
  }

  .mm-acc-trigger {
    min-height: 48px;
    padding-block: 12px;
  }

  .cart-qty button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 16px;
  }

  .cart-xs-add {
    min-height: 44px;
    padding-block: 12px;
    font-size: 12.5px;
  }

  .cookie button {
    min-height: 44px;
    padding-block: 12px;
  }
}

@media (max-width: 520px) {
  .pc-add {
    height: 44px;
    font-size: 13px;
  }

  .cart-qty button {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
}

@media (hover: none) {
  .pc-wish {
    width: 44px;
    height: 44px;
    top: 8px;
    inset-inline-end: 8px;
  }

  .pc-quick-add {
    width: 44px;
    height: 44px;
    bottom: 8px;
    inset-inline-start: 8px;
  }
}

/* ── P0: Safe areas ── */
.fab-stack {
  bottom: max(18px, env(safe-area-inset-bottom));
}

.cart-foot,
.cart-foot--added {
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.cookie {
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
}

/* ── P0: Bottom stack — sticky ATC / cookie / FAB / BTT ── */
body.pp-has-sticky-atc .fab-stack.r {
  display: none !important;
}

body.pp-page .fab-stack.r {
  display: none !important;
}

body.pp-has-sticky-atc .btt.is-on {
  bottom: calc(78px + env(safe-area-inset-bottom));
}

body.cookie-visible {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

body.pp-has-sticky-atc.cookie-visible {
  padding-bottom: calc(160px + env(safe-area-inset-bottom));
}

body.pp-has-sticky-atc .cookie.is-on {
  bottom: calc(72px + env(safe-area-inset-bottom));
}

body.co-mobile-checkout {
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* ── P1: Search — mobile uses full overlay only ── */
@media (max-width: 980px) {
  .hd-search-bar {
    display: none !important;
  }

  .search-top input {
    font-size: 18px;
  }

  .search-top {
    padding: 16px 20px;
    gap: 10px;
  }

  .search-body {
    padding: 20px 20px 48px;
  }
}

/* ── P1: Megamenu mobile — text-only panels ── */
@media (max-width: 980px) {
  .mm-acc-panel .mm-feature {
    display: none !important;
  }

  .mm-acc-panel .mm-inner {
    padding: 8px 4px 12px;
    gap: 12px;
  }

  .mm-acc-panel .mm-col-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding-block: 10px;
    font-size: 14px;
  }
}

/* ── P1: Category filter button ── */
@media (max-width: 980px) {
  .cat-filters-btn {
    min-height: 44px;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(14, 22, 38, 0.12);
  }
}

/* ── P2: Category strip scroll affordance ── */
@media (max-width: 760px) {
  .cat-strip-scroll {
    position: relative;
    mask-image: linear-gradient(to left, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    -webkit-mask-image: linear-gradient(to left, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  }
}

/* ── P2: Product gallery thumbs ── */
@media (max-width: 680px) {
  .pp-thumbs {
    scroll-snap-type: x mandatory;
    gap: 8px;
    padding-inline: 2px;
  }

  .pp-thumb {
    scroll-snap-align: start;
  }
}

/* ── P3: Checkout mobile ── */
@media (max-width: 980px) {
  .co-field input,
  .co-field textarea,
  .co-field select,
  .tb-sort-select {
    font-size: 16px;
  }

  .co-section--ship .co-ship-tile {
    min-height: 112px;
    padding: 14px 8px;
  }

  .co-mobile-bar {
    display: flex;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 70;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(14, 22, 38, 0.1);
  }

  .co-mobile-bar__info {
    flex: 1;
    min-width: 0;
    text-align: start;
  }

  .co-mobile-bar__lbl {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }

  .co-mobile-bar__val {
    font-size: 20px;
    font-weight: 900;
    color: var(--ink);
    line-height: 1.2;
  }

  .co-mobile-bar__btn {
    flex: 0 0 auto;
    min-width: 140px;
    height: 48px;
    padding: 0 18px;
    background: var(--navy);
    color: #fff;
    border: 0;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .co-mobile-bar__btn:disabled {
    opacity: 0.6;
    cursor: wait;
  }

  .co-shell > .wrap > form > .co-grid aside .co-submit {
    margin-bottom: 8px;
  }
}

@media (min-width: 981px) {
  .co-mobile-bar {
    display: none !important;
  }
}

/* ── P3: Forms — prevent iOS zoom on focus ── */
@media (max-width: 980px) {
  .wrap input:not([type='checkbox']):not([type='radio']):not([type='hidden']):not([type='range']),
  .wrap select,
  .wrap textarea {
    font-size: 16px;
  }
}
