/* Intentional mobile-app presentation layer. Desktop remains owned by brand.css. */
.mobile-header-search,
.mobile-bottom-nav {
  display: none;
}

.mobile-sticky-buy {
  display: none;
}

.mobile-nav-close { display: none; }

.footer-disclosure {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
}
.footer-disclosure > span { display: none; }

@media (max-width: 820px) {
  :root {
    --mobile-nav-height: 72px;
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  html { scroll-padding-bottom: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 16px); }
  body { padding-bottom: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom)); }
  body.menu-open { overflow: hidden; }
  body.page-checkout,
  body.page-pay,
  body.page-invoice { padding-bottom: 0; }

  .topbar { display: none; }
  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.96);
    box-shadow: 0 8px 24px rgba(9,48,72,.08);
    backdrop-filter: blur(14px);
  }
  .header-inner {
    min-height: 64px;
    padding: 9px 16px;
    display: grid;
    grid-template-columns: minmax(0,1fr) 44px 44px;
    gap: 8px;
    align-items: center;
  }
  .site-brand { min-width: 0; justify-self: start; }
  html[dir="rtl"] .site-brand { justify-self: end; }
  .site-brand img { width: min(178px, 54vw); max-height: 46px; object-fit: contain; }
  .mobile-header-search,
  .menu-toggle {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8e8ef;
    border-radius: 14px;
    color: #12384d;
    background: #f6fbfd;
    text-decoration: none;
  }
  .mobile-header-search .ui-icon,
  .menu-toggle .ui-icon { width: 22px; height: 22px; }
  .menu-toggle { position: relative; z-index: 53 !important; font-size: 0; cursor: pointer; }
  .site-header .menu-toggle::before { content: none; }
  .menu-toggle span:not(.ui-icon) { display: none; }
  .header-actions { display: none; }
  /* Override the legacy 760px grid so search and menu keep separate touch targets. */
  .site-header .menu-toggle,
  .site-header .header-actions { grid-column: auto; grid-row: auto; }
  .primary-nav {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(360px, calc(100vw - 20px));
    min-height: 100dvh;
    z-index: 52;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 86px 18px 26px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 30px 70px rgba(6,43,79,.2);
    transform: translateX(-110%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .25s ease, visibility 0s linear .25s;
  }
  .primary-nav.is-open { transform: translateX(0); visibility: visible; pointer-events: auto; transition-delay: 0s; }
  html[dir="rtl"] .primary-nav { inset: 0 0 0 auto; transform: translateX(110%); }
  html[dir="rtl"] .primary-nav.is-open { transform: translateX(0); }
  .mobile-nav-backdrop { z-index: 51 !important; }
  .mobile-nav-close {
    position: absolute;
    inset-block-start: 18px;
    inset-inline-end: 18px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8e8ef;
    border-radius: 14px;
    background: #f6fbfd;
    color: #12384d;
    cursor: pointer;
  }
  .mobile-nav-close .ui-icon { width: 20px; height: 20px; }
  .primary-nav a {
    min-height: 52px;
    display: flex;
    align-items: center;
    border-radius: 12px;
    padding-inline: 14px;
  }
  .primary-nav a.active { background: #eaf8fc; color: #087ca2; font-weight: 800; }

  .site-main { overflow: clip; }
  .container { width: min(100% - 28px, 1180px); }
  .listing-section { padding-block: 28px; }
  .section-heading { margin-bottom: 20px; }
  .section-heading h2 { font-size: clamp(22px, 6vw, 32px); line-height: 1.35; }
  .section-lead { font-size: 14px; line-height: 1.8; }
  .hero-section--automotive { min-height: 320px; }
  .home-retail .hero-copy { max-width: 100%; padding-top: 14px; }
  .home-retail .hero-copy h1 { font-size: clamp(28px, 8vw, 42px); }

  /* Keep the campaign image readable and move supporting copy below it. */
  .campaign-banner--hero { display: grid; grid-template-columns: 1fr; overflow: hidden; }
  .campaign-banner--hero img { min-height: 210px; max-height: 300px; object-fit: cover; object-position: center; }
  .page-products .campaign-banner--hero img { min-height: 0; max-height: none; aspect-ratio: 2 / 1; object-fit: cover; }
  .page-products .campaign-banner--hero { min-height: 0; }
  .campaign-banner--hero .campaign-banner__overlay { position: static; background: #fff; color: #12384d; padding: 18px; }
  .campaign-banner--hero .campaign-banner__overlay h2,
  .campaign-banner--hero .campaign-banner__overlay p { color: #12384d; }

  .content-grid-4,
  .home-products .content-grid,
  .catalogue-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .content-card-body { padding: 14px; }
  .catalogue-card__body { padding: 12px; }
  .catalogue-card h3 { font-size: 14px; line-height: 1.55; }
  .catalogue-card__actions .btn { min-height: 42px; padding-inline: 10px; font-size: 12px; }
  .page-cart .cart-row { grid-template-columns: 72px minmax(0,1fr); gap: 12px; }
  .page-cart .cart-thumb { width: 72px; height: 72px; }
  .page-cart .cart-row > .quantity-stepper { grid-column: 2; width: 100%; grid-template-columns: 48px minmax(48px, 1fr) 48px; }
  .page-cart .cart-row > .quantity-stepper .quantity-stepper__button { min-height: 48px; }
  .page-cart .cart-line-actions { grid-column: 2; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .page-cart .cta-panel { margin-bottom: 14px; padding: 16px; gap: 16px; }
  .page-cart .cta-panel .hero-actions { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; }
  .page-cart .cta-panel .hero-actions .btn { width: 100%; min-height: 48px; }
  .product-retail__gallery { padding: 12px; }
  .product-retail .catalogue-detail { grid-template-columns: minmax(0,1fr); }
  .product-retail__gallery { position: static; }
  .product-retail__gallery > img { max-height: 300px; }
  .product-retail__purchase .content-card-body { padding: 18px 14px; }
  .product-pricing strong { font-size: 27px; }
  .product-retail__buy { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .product-retail__buy > .btn { grid-column: 1; min-height: 50px; }
  .product-retail__buy .quantity-stepper { width: 168px; }
  .product-retail__buy .quantity-stepper__button { min-height: 48px; }

  .filter-panel-shell {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: flex-end;
    padding: 16px 14px calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 10px);
    background: rgba(4,25,39,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .filter-panel-shell.is-open { opacity: 1; pointer-events: auto; }
  .filter-panel-shell .filter-panel {
    width: 100%;
    max-height: min(76vh, 620px);
    overflow: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 -18px 50px rgba(3,29,47,.2);
    transform: translateY(24px);
    transition: transform .2s ease;
  }
  .filter-panel-shell.is-open .filter-panel { transform: translateY(0); }
  .filter-panel select,
  .filter-panel input,
  .filter-panel button { min-height: 50px; }
  .mobile-filter-toggle { min-height: 48px; width: 100%; }

  .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, minmax(0,1fr));
    min-height: var(--mobile-nav-height);
    padding: 7px 8px var(--mobile-safe-bottom);
    border-top: 1px solid #dbeaf0;
    background: rgba(255,255,255,.97);
    box-shadow: 0 -8px 28px rgba(9,48,72,.1);
    backdrop-filter: blur(14px);
  }
  .mobile-bottom-nav__item {
    position: relative;
    min-width: 44px;
    min-height: 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #6b7f8c;
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
  }
  .mobile-bottom-nav__item .ui-icon { width: 22px; height: 22px; }
  .mobile-bottom-nav__item.is-active { color: #007fa7; }
  .mobile-bottom-nav__item.is-active::before { content: ''; position: absolute; top: -7px; width: 30px; height: 3px; border-radius: 99px; background: #00aeef; }
  .mobile-bottom-nav__badge { position: absolute; top: 3px; inset-inline-end: 21%; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; color: #fff; background: #e54b50; font-size: 10px; text-align: center; }

  .floating-contact { bottom: calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 12px); }
  .floating-contact__toggle { width: 44px; height: 44px; }
  .back-to-top { display: none; }

  .site-footer { padding-bottom: 18px; }
  .footer-grid { gap: 0; }
  .footer-pages { border-bottom: 1px solid rgba(255,255,255,.12); padding-block: 5px; }
  .footer-pages .footer-links { display: none; padding-bottom: 10px; }
  .footer-pages.is-open .footer-links { display: grid; }
  .footer-disclosure { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
  .footer-disclosure > span { display: inline; font-size: 22px; font-weight: 400; transition: transform .2s ease; }
  .footer-pages.is-open .footer-disclosure > span { transform: rotate(45deg); }
  .footer-bottom { gap: 8px; padding-bottom: 10px; font-size: 11px; }

  body.page-checkout .mobile-bottom-nav,
  body.page-pay .mobile-bottom-nav,
  body.page-invoice .mobile-bottom-nav { display: none; }
  .mobile-sticky-buy { position: fixed; inset: auto 12px calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 10px); z-index: 55; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #d9eaf0; border-radius: 16px; background: rgba(255,255,255,.96); box-shadow: 0 12px 34px rgba(4,45,65,.18); transform: translateY(140%); transition: transform .2s ease; }
  .mobile-sticky-buy.is-visible { transform: translateY(0); }
  .mobile-sticky-buy strong { color: #12384d; font-size: 14px; }
  .mobile-sticky-buy .btn { min-height: 44px; white-space: nowrap; }
}

@media (max-width: 379px) {
  .content-grid-4,
  .home-products .content-grid,
  .catalogue-grid { grid-template-columns: 1fr; }
  .site-brand img { width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.checkout-auth-panel { margin-top: 16px; }
.checkout-auth-error { padding: 12px 14px; border: 1px solid #f1b7b7; border-radius: 14px; color: #8d2222; background: #fff4f4; }
.checkout-auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.checkout-auth-card { padding: 20px; border: 1px solid #dcecf2; border-radius: 20px; background: linear-gradient(150deg, #fff, #f5fbfd); }
.checkout-auth-card h4 { margin: 10px 0 6px; color: #12384d; }
.checkout-auth-card p { margin: 0 0 16px; color: #567080; }
.checkout-auth-form { gap: 8px; }
.checkout-auth-form label { margin-top: 4px; font-weight: 700; color: #23485a; }
.password-field { position: relative; display: flex; align-items: center; }
.password-field input { width: 100%; padding-inline-end: 76px; }
.password-toggle { position: absolute; inset-inline-end: 8px; min-height: 34px; padding: 0 9px; border: 0; border-radius: 9px; color: #087ca2; background: #eaf8fc; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.account-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 24px; }
.account-overview__card { display: flex; align-items: flex-start; gap: 11px; min-width: 0; padding: 16px; border: 1px solid #dcecf2; border-radius: 18px; background: #fff; box-shadow: 0 10px 28px rgba(16, 63, 84, .06); }
.account-overview__icon { display: inline-flex; flex: 0 0 40px; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 13px; color: #087ca2; background: #e7f7fb; }
.account-overview__icon .ui-icon { width: 21px; height: 21px; }
.account-overview__card div { min-width: 0; display: grid; gap: 3px; }
.account-overview__card small { color: #6b8390; }
.account-overview__card strong { overflow-wrap: anywhere; color: #12384d; font-size: 18px; }
.account-overview__card span:not(.account-overview__icon) { overflow-wrap: anywhere; color: #567080; font-size: 12px; }

@media (max-width: 820px) {
  .checkout-auth-grid { grid-template-columns: 1fr; }
  .checkout-auth-card { padding: 16px; border-radius: 16px; }
  .account-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .account-overview__card { padding: 13px; border-radius: 15px; }
  .account-overview__icon { flex-basis: 34px; width: 34px; height: 34px; border-radius: 10px; }
}

@media (max-width: 379px) {
  .account-overview { grid-template-columns: 1fr; }
}

@media print {
  .mobile-bottom-nav, .mobile-sticky-buy, .floating-contact, .site-header { display: none !important; }
  body { padding-bottom: 0 !important; }
}
