/* ============================================================
   A16A Marketplace — responsive layer
   Desktop 1440 / 1280 · tablet 900-1199 · mobile 390
   ============================================================ */

/* ---------- wide tablet / small desktop ---------- */
@media (max-width:1199px) {
  .a16a-container{padding-inline:20px}
  .a16a-header-inner{grid-template-columns:180px minmax(0,1fr) auto;gap:18px}
  .a16a-logo-mark{font-size:29px}
  .a16a-header-actions{gap:14px}
  .a16a-hero{grid-template-columns:190px minmax(0,1fr)}
  .a16a-hero-rail{grid-column:1/-1;flex-direction:row}
  .a16a-rail-card{flex-direction:row;align-items:center;justify-content:flex-start;gap:10px}
  .a16a-rail-card .a16a-icon{margin:0}
  .a16a-hero-main{min-height:320px;padding:28px}
  .a16a-hero-copy h1{font-size:32px}
  .a16a-hero-art{height:240px}
  .a16a-dept-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .a16a-hub-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .a16a-brand-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .a16a-product-grid,.a16a-pdp .related .a16a-product-grid,.a16a-pdp .upsells .a16a-product-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .a16a-listing-results .a16a-product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .a16a-footer-grid{grid-template-columns:1.4fr 1fr 1fr;gap:24px}
  .a16a-footer-grid>.a16a-footer-col:last-child{grid-column:1/-1}
  .woocommerce form.checkout{grid-template-columns:minmax(0,1fr) 320px}
}

/* ---------- tablet ---------- */
@media (max-width:899px) {
  .a16a-utility-links a:nth-of-type(2){display:none}
  .a16a-header-inner{grid-template-columns:auto minmax(0,1fr) auto;gap:14px;min-height:66px}
  .a16a-logo-sub{display:none}
  .a16a-logo-mark{font-size:26px}
  .a16a-action .a16a-action-text{display:none}
  .a16a-header-actions{gap:14px}
  .a16a-action--cart .a16a-cart-count{right:-6px}
  .a16a-deptbar-all{padding-right:12px}
  .a16a-deptbar-all span{display:none}
  .a16a-hero{grid-template-columns:1fr}
  .a16a-hero-depts{display:none}
  .a16a-hero-rail{grid-column:auto}
  .a16a-hero-main{grid-template-columns:1.15fr .85fr}
  .a16a-trust-grid{grid-template-columns:repeat(2,1fr);row-gap:16px}
  .a16a-deals{padding:18px}
  .a16a-floor-grid{grid-template-columns:1fr}
  .a16a-floor-banner{flex-direction:row;align-items:center;flex-wrap:wrap;gap:12px}
  .a16a-floor-banner a{margin-top:0}
  .a16a-card-row>.a16a-card,.a16a-card-row--floor>.a16a-card{flex-basis:200px}
  .a16a-brand-banner{grid-template-columns:1fr;padding:26px}
  .a16a-service-strip{grid-template-columns:1fr}
  .a16a-listing-layout{grid-template-columns:1fr}
  .a16a-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
  .a16a-filter-price{border-bottom:0;border-right:1px solid var(--border);padding:0 16px 0 0}
  .a16a-filter-cats{border-bottom:0;padding:0}
  .a16a-filter-note{grid-column:1/-1;border-top:1px solid var(--border);padding-top:14px}
  .a16a-listing-results .a16a-product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .a16a-pdp{grid-template-columns:1fr;gap:22px}
  .a16a-pdp .related .a16a-product-grid,.a16a-pdp .upsells .a16a-product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .a16a-page-layout--flow{grid-template-columns:1fr}
  .a16a-flow-side{flex-direction:row}
  .a16a-flow-side .a16a-side-card{flex:1}
  .woocommerce form.checkout{grid-template-columns:1fr}
  .woocommerce form.checkout #customer_details,.woocommerce form.checkout #order_review_heading,.woocommerce form.checkout #order_review{grid-column:1;grid-row:auto}
  .a16a-hub-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .a16a-ds-hero,.a16a-brand-hero{grid-template-columns:1fr}
  .a16a-ds-swatches{grid-template-columns:repeat(4,minmax(0,1fr))}
  .a16a-ds-accents{grid-template-columns:repeat(3,minmax(0,1fr))}
  .a16a-ds-grid-demo{grid-template-columns:1fr}
  .a16a-ds-notes{grid-template-columns:1fr}
}

/* ---------- phone (390 artboards) ---------- */
@media (max-width:599px) {
  :root{--gutter:16px}
  body{font-size:14px;padding-bottom:calc(66px + env(safe-area-inset-bottom,0px))}
  .a16a-site{min-height:auto}

  /* Utility strip */
  .a16a-utility{font-size:11px}
  .a16a-utility-inner{min-height:30px}
  .a16a-utility-links{display:none}

  /* Header: logo + icons on row one, full-width search on row two */
  .a16a-header-inner{grid-template-columns:1fr auto;gap:10px 12px;padding-block:10px;min-height:0}
  .a16a-logo{grid-column:1;grid-row:1}
  .a16a-logo-mark{font-size:24px}
  .a16a-header-actions{grid-column:2;grid-row:1;gap:16px}
  .a16a-header-actions .a16a-action:not(.a16a-action--cart){display:none}
  .a16a-action{font-size:0}
  .a16a-action .a16a-icon{width:24px;height:24px}
  .a16a-action--cart{padding-right:14px}
  .a16a-search{grid-column:1/-1;grid-row:2;height:42px;border-width:1.5px}
  .a16a-search input[type=search]{font-size:16px;padding:0 14px}
  .a16a-search button{width:48px}
  .a16a-search--page{max-width:none;margin-bottom:20px}

  /* Department strip: horizontal scroll, no clipping */
  .a16a-deptbar-inner{min-height:40px;gap:8px}
  .a16a-deptbar-all{padding-right:10px}
  .a16a-deptbar-all .a16a-icon{width:18px;height:18px}
  .a16a-dept-link{font-size:12px;padding:0 8px}
  .a16a-deptbar-list{-webkit-overflow-scrolling:touch}

  /* Hero */
  .a16a-hero{margin:14px 0;gap:12px}
  .a16a-hero-main{grid-template-columns:1fr;min-height:0;padding:24px 20px}
  .a16a-hero-copy h1{font-size:27px;max-width:none}
  .a16a-hero-copy p{font-size:13px;margin-bottom:18px}
  .a16a-hero-cta{gap:8px}
  .a16a-hero-cta .a16a-btn{flex:0 1 auto;min-width:0;padding:0 14px;font-size:13px;white-space:nowrap}
  .a16a-hero-meta{gap:12px;margin-top:18px;font-size:11px}
  .a16a-hero-art{display:none}
  .a16a-hero-rail{flex-direction:row;gap:8px;overflow-x:auto}
  .a16a-rail-card{min-width:132px;flex-direction:column;align-items:flex-start;justify-content:center;padding:12px;gap:4px}
  .a16a-rail-card .a16a-icon{margin-bottom:2px}
  .a16a-rail-card strong{font-size:13px}
  .a16a-rail-card span{font-size:10.5px}

  /* Sections and grids */
  .a16a-section{margin:30px 0}
  .a16a-section-title{font-size:21px}
  .a16a-section-head{align-items:flex-start;flex-direction:column;gap:6px}
  .a16a-section-link{font-size:12.5px}
  .a16a-trust-grid{grid-template-columns:repeat(2,1fr);gap:12px;padding-block:14px}
  .a16a-trust-item{gap:8px}
  .a16a-trust-icon{width:22px;height:22px}
  .a16a-trust-item strong{font-size:11.5px}
  .a16a-trust-item span{font-size:10.5px}
  .a16a-deals{padding:16px}
  .a16a-deals-bar{gap:8px;font-size:11.5px}
  .a16a-deals-note{display:none}
  .a16a-card-row{gap:12px;margin-inline:-16px;padding-inline:16px}
  .a16a-card-row>.a16a-card,.a16a-card-row--floor>.a16a-card,.a16a-card-row--wrap>.a16a-card{flex:0 0 171px}
  .a16a-card-body{padding:10px}
  .a16a-card-title{font-size:12.5px;min-height:34px}
  .a16a-card-price{font-size:16px}
  .a16a-card-wish{width:32px;height:32px}
  .a16a-dept-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
  .a16a-dept-tile{padding:12px;gap:4px}
  .a16a-dept-tile-icon{width:32px;height:32px;margin-bottom:2px}
  .a16a-dept-tile-icon .a16a-icon{width:18px;height:18px}
  .a16a-dept-tile strong{font-size:12px}
  .a16a-dept-tile em{font-size:10.5px}
  .a16a-floor{padding:16px}
  .a16a-floor-banner{padding:14px}
  .a16a-floor-banner span{font-size:15px}
  .a16a-brand-banner{padding:22px;gap:16px}
  .a16a-brand-banner h2{font-size:22px}
  .a16a-brand-banner-list{grid-template-columns:1fr}
  .a16a-service-strip{gap:10px}
  .a16a-service-strip>div{padding:16px}

  /* Listing / department */
  .a16a-listing-head{flex-direction:column;align-items:flex-start}
  .a16a-listing-head h1{font-size:25px}
  .a16a-listing-head-badge{font-size:11px;padding:7px 12px}
  .a16a-filters{display:block;padding:14px}
  .a16a-filter-price{border-right:0;border-bottom:1px solid var(--border);padding:0 0 14px;margin-bottom:14px}
  .a16a-filter-cats{padding-bottom:12px;border-bottom:1px solid var(--border)}
  .a16a-filter-note{border-top:0;padding-top:12px}
  .a16a-product-grid,.a16a-listing-results .a16a-product-grid,.a16a-pdp .related .a16a-product-grid,.a16a-pdp .upsells .a16a-product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .a16a-dept-hero{grid-template-columns:auto 1fr;gap:14px;padding:18px}
  .a16a-dept-hero-icon{width:48px;height:48px}
  .a16a-dept-hero-icon .a16a-icon{width:25px;height:25px}
  .a16a-dept-hero h1{font-size:23px}
  .a16a-dept-hero p{font-size:12.5px}
  .a16a-dept-hero-meta{display:none}
  .a16a-subcat-chips{flex-wrap:nowrap;overflow-x:auto;padding-bottom:6px}
  .a16a-subcat-chips a{white-space:nowrap}

  /* PDP */
  .a16a-pdp{gap:18px}
  .a16a-pdp .summary h1.product_title{font-size:23px}
  .a16a-pdp .summary .price{font-size:23px}
  .a16a-pdp .summary form.cart{gap:8px}
  .a16a-pdp .summary .single_add_to_cart_button{flex:1}
  .a16a-pdp .woocommerce-tabs ul.tabs{overflow-x:auto}
  .a16a-pdp .woocommerce-tabs ul.tabs li a{white-space:nowrap}
  .a16a-pdp-trust{padding:12px}

  /* Cart / checkout / content */
  .a16a-flow-head h1,.a16a-page-title{font-size:25px}
  .a16a-steps{gap:4px;flex-wrap:wrap}
  .a16a-step{font-size:11px;gap:5px}
  .a16a-step:not(:last-child)::after{width:14px;margin-left:2px}
  .a16a-step-dot{width:22px;height:22px}
  .a16a-ship-progress{padding:12px;font-size:12px;gap:10px}
  .a16a-flow-side{flex-direction:column}
  .woocommerce table.shop_table th,.woocommerce table.shop_table td{padding:10px 8px;font-size:12px}
  .woocommerce table.shop_table img{width:56px;height:56px}
  .woocommerce .cart-collaterals .cart_totals,.woocommerce form.checkout #order_review{padding:14px}
  .woocommerce form .form-row input.input-text,.woocommerce form .form-row select{font-size:16px}
  .a16a-article-content{padding:18px}
  .a16a-404{padding:48px 12px}

  /* Hubs */
  .a16a-hub-hero,.a16a-brand-hero,.a16a-ds-hero{padding:24px 18px;margin:6px 0 22px}
  .a16a-hub-hero h1,.a16a-brand-hero h1,.a16a-ds-hero h1{font-size:26px}
  .a16a-hub-stats{gap:16px}
  .a16a-hub-stats strong{font-size:19px}
  .a16a-hub-grid{grid-template-columns:1fr}
  .a16a-hub-card{padding:14px}
  .a16a-hub-note{flex-direction:column;align-items:flex-start;padding:18px}
  .a16a-brand-hero-marks{grid-template-columns:1fr}
  .a16a-brand-grid,.a16a-brand-values{grid-template-columns:1fr}
  .a16a-ds-section{padding:18px}
  .a16a-ds-section-head{grid-template-columns:34px 1fr}
  .a16a-ds-section-head>span{font-size:18px}
  .a16a-ds-section-head h2{font-size:19px}
  .a16a-ds-swatches{grid-template-columns:repeat(2,minmax(0,1fr))}
  .a16a-ds-h1{font-size:27px}
  .a16a-ds-h2{font-size:21px}
  .a16a-ds-table>div{grid-template-columns:100px 1fr;font-size:11.5px}
  .a16a-ds-table>div>*:last-child{display:none}
  .a16a-ds-accents{grid-template-columns:repeat(2,minmax(0,1fr))}
  .a16a-ds-component-row{gap:8px;padding:10px}
  .a16a-ds-input{min-width:0;width:100%;font-size:16px}
  .a16a-ds-grid-canvas>div{height:70px}
  .a16a-ds-grid-canvas em{flex-basis:36px}

  /* Footer */
  .a16a-footer{padding-top:30px}
  .a16a-footer-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;padding-bottom:22px}
  .a16a-footer-brand{grid-column:1/-1}
  .a16a-footer-grid>.a16a-footer-col:last-child{grid-column:1/-1}
  .a16a-footer-bottom-inner{flex-direction:column;align-items:flex-start;gap:8px;padding-block:14px}
  .a16a-legal{font-size:10.5px}

  /* Mobile bottom tab bar */
  .a16a-tabbar{display:grid;grid-template-columns:repeat(4,1fr);position:fixed;left:0;right:0;bottom:0;z-index:800;background:var(--surface);border-top:1px solid var(--border);box-shadow:0 -4px 16px rgba(11,34,57,.08);padding-bottom:env(safe-area-inset-bottom,0px)}
  .a16a-tab{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:58px;padding:6px 14px;color:var(--text-muted);font-size:10px;font-weight:700;letter-spacing:.04em}
  .a16a-tab .a16a-icon{width:21px;height:21px}
  .a16a-tab.is-active{color:var(--navy-700)}
  .a16a-tab.is-active::before{content:"";position:absolute;top:0;left:22%;right:22%;height:3px;border-radius:0 0 3px 3px;background:var(--amber-500)}
  .a16a-tab--cart em{position:absolute;top:3px;right:18px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--deal-red);color:#fff;font-size:9px;font-style:normal;display:grid;place-items:center}
  .a16a-toast{bottom:calc(78px + env(safe-area-inset-bottom,0px));max-width:calc(100vw - 32px);text-align:center}
}

/* ---------- very narrow ---------- */
@media (max-width:359px) {
  .a16a-dept-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .a16a-card-row>.a16a-card,.a16a-card-row--floor>.a16a-card{flex-basis:150px}
  .a16a-hero-copy h1{font-size:24px}
}

/* ---------- touch targets / iOS zoom ---------- */
@media (pointer:coarse) {
  .a16a-dept-link{min-height:40px}
  .a16a-card-wish{width:40px;height:40px}
  .a16a-tab{min-height:60px}
}
