/* Mobile storefront chrome — <768px header/drawer/tabbar, <1024px catalog sheet.
   Desktop mega menu is untouched. Do not rely on purged Tailwind utilities here. */

:root {
  --m-tabbar-h: 56px;
  --m-brand: #0B3A5C;
  --m-brand-dark: #07263D;
  --m-accent: #E85D04;
  --m-line: #E6EBF0;
  --m-soft: #F5F7FA;
}

.m-nav-toggle,
.m-nav-overlay,
.m-nav-drawer,
.m-tabbar,
.m-catalog-bar,
.m-sticky-atc,
.m-sticky-cta {
  display: none;
}

body.m-lock {
  overflow: hidden;
}

@media (max-width: 767px) {
  .m-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--m-brand);
    flex-shrink: 0;
    border-radius: 8px;
  }

  .m-logo-tag {
    display: none;
  }

  .m-header-inner {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  .m-search-mobile {
    margin-top: 0.5rem !important;
  }

  .m-desktop-nav {
    display: none !important;
  }

  .m-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 69;
    background: rgba(7, 38, 61, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .m-nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .m-nav-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 70;
    width: min(86vw, 360px);
    background: #fff;
    box-shadow: 8px 0 28px rgba(7, 38, 61, 0.18);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    padding-bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom, 0px));
  }

  .m-nav-drawer.is-open {
    transform: translateX(0);
  }

  .m-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--m-line);
    background: var(--m-brand);
    color: #fff;
  }

  .m-nav-head strong {
    font-size: 16px;
    letter-spacing: -0.02em;
  }

  .m-nav-close {
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    border-radius: 8px;
  }

  .m-nav-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .m-acc-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--m-line);
  }

  .m-acc-row > a {
    flex: 1;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--m-brand);
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .m-acc-toggle {
    width: 48px;
    border: 0;
    border-left: 1px solid var(--m-line);
    background: var(--m-soft);
    color: var(--m-brand);
    font-size: 18px;
  }

  .m-acc-panel {
    display: none;
    background: var(--m-soft);
    padding: 4px 0 8px;
  }

  .m-acc-item.is-open .m-acc-panel {
    display: block;
  }

  .m-acc-item.is-open .m-acc-toggle {
    color: var(--m-accent);
  }

  .m-acc-panel a {
    display: block;
    padding: 10px 16px 10px 28px;
    font-size: 14px;
    color: #475569;
    min-height: 44px;
  }

  .m-nav-links {
    border-top: 8px solid var(--m-soft);
    padding: 8px 0 16px;
  }

  .m-nav-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--m-brand);
    min-height: 48px;
  }

  .m-tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    height: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid var(--m-line);
    box-shadow: 0 -4px 16px rgba(7, 38, 61, 0.08);
  }

  .m-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    position: relative;
  }

  .m-tabbar a.is-active {
    color: var(--m-brand);
  }

  .m-tabbar a.is-active svg {
    color: var(--m-accent);
  }

  .m-tab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--m-accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body {
    padding-bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom, 0px));
  }

  #cookie-consent {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px) !important;
  }

  .m-sticky-atc,
  .m-sticky-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom, 0px));
    z-index: 54;
    background: #fff;
    border-top: 1px solid var(--m-line);
    padding: 10px 16px;
    box-shadow: 0 -4px 16px rgba(7, 38, 61, 0.08);
  }

  .m-sticky-atc .m-sticky-price,
  .m-sticky-cta .m-sticky-price {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--m-brand);
  }

  .m-sticky-atc button,
  .m-sticky-cta button,
  .m-sticky-cta a {
    flex: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    background: var(--m-accent);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border: 0;
    border-radius: 8px;
    text-decoration: none;
    padding: 0 12px;
  }

  .m-sticky-atc button:disabled,
  .m-sticky-cta button:disabled {
    opacity: 0.4;
  }

  .m-product-title {
    font-size: 1.5rem !important;
    line-height: 1.25 !important;
  }

  .m-product-pad {
    padding: 1rem !important;
  }

  .m-checkout-summary {
    order: -1;
  }

  .m-cart-cta {
    display: block;
    width: 100%;
    text-align: center;
    min-height: 44px;
    line-height: 44px;
    padding: 0 !important;
  }

  .m-checkout-submit-inline {
    display: none;
  }

  body:has(.m-sticky-atc),
  body:has(.m-sticky-cta) {
    padding-bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom, 0px) + 64px);
  }
}

@media (max-width: 1023px) {
  .m-catalog-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    background: var(--m-soft);
    padding: 4px 0 8px;
  }

  .m-catalog-layout {
    display: block !important;
  }

  .m-lg-only {
    display: none;
  }

  .m-catalog-bar .m-count {
    flex: 1;
    font-size: 13px;
    color: #64748b;
  }

  .m-catalog-bar button {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--m-line);
    background: #fff;
    color: var(--m-brand);
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
  }

  .m-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 71;
    background: rgba(7, 38, 61, 0.45);
  }

  .m-sheet-overlay.is-open {
    display: block;
  }

  .m-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 72;
    max-height: min(85vh, 640px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 16px 16px 0 0;
    transform: translateY(110%);
    transition: transform 0.22s ease;
    padding: 16px 16px calc(var(--m-tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
    box-shadow: 0 -8px 28px rgba(7, 38, 61, 0.18);
  }

  .m-sheet.is-open {
    transform: translateY(0);
  }

  .m-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .m-sheet-head h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--m-brand);
    margin: 0;
  }

  .m-sheet-head button {
    width: 40px;
    height: 40px;
    border: 0;
    background: var(--m-soft);
    border-radius: 8px;
    font-size: 22px;
    color: var(--m-brand);
  }
}

@media (min-width: 1024px) {
  .m-sheet-overlay,
  .m-sheet-head {
    display: none !important;
  }

  .m-sheet {
    position: static;
    transform: none !important;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
  }
}

.m-tap {
  width: 44px;
  height: 44px;
}

.m-qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--m-line);
  border-radius: 8px;
  overflow: hidden;
}

.m-qty button {
  width: 44px;
  height: 44px;
  border: 0;
  background: var(--m-soft);
  color: var(--m-brand);
  font-size: 20px;
  line-height: 1;
}

.m-qty input {
  width: 48px;
  height: 44px;
  border: 0;
  border-left: 1px solid var(--m-line);
  border-right: 1px solid var(--m-line);
  text-align: center;
  font-size: 14px;
}
