/* Mobile storefront refinement. Loaded after the shared desktop stylesheet. */
@media(min-width:701px) and (max-width:1000px){
  .topbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 16px}
  .topbar .brand{grid-column:1;grid-row:1;justify-self:start}
  .topbar .header-discovery{grid-column:2;grid-row:1;justify-self:end;justify-content:flex-end}
  .topbar .header-shopping{grid-column:1/-1;grid-row:2;justify-self:end;flex-wrap:wrap}
  .shopping-explainer{grid-column:1/-1;grid-row:3}
  .product-view .shopping-explainer{display:none}
  .quick-product>div,.detail-summary{min-width:0}
}
@media (max-width:700px){
  /* Menu, original logo and bag get a stable first row; secondary actions below. */
  .topbar{grid-template-columns:minmax(0,1fr) 120px minmax(0,1fr);gap:4px 8px;padding-block:8px;padding-top:max(8px,env(safe-area-inset-top))}
  .topbar .header-discovery,.topbar .header-shopping{display:contents}
  .topbar .brand{grid-column:2;grid-row:1;width:120px;height:64px}
  .topbar .brand img{width:172px;height:auto}
  .topbar #menuButton{grid-column:1;grid-row:1;justify-self:start;min-height:44px;padding:8px}
  .topbar [data-action="bag"]{grid-column:3;grid-row:1;justify-self:end;min-height:44px;padding:8px;white-space:nowrap;font-size:13px}
  .topbar #customerButton{grid-column:1;grid-row:2}
  .topbar #favoritesButton{grid-column:2;grid-row:2}
  .topbar [data-action="quiz"]{grid-column:3;grid-row:2}
  .topbar #customerButton,.topbar #favoritesButton,.topbar [data-action="quiz"]{min-height:44px;font-size:12px;line-height:1.3;padding:6px 3px;overflow-wrap:anywhere}
  .shopping-explainer{grid-column:1/-1;grid-row:3;font-size:12px;line-height:1.4;padding:4px 0 0;margin:0 auto;max-width:360px}
  .product-view .shopping-explainer{display:none}
  main{min-width:0;padding-top:18px}
  .catalog-tools{position:sticky;top:var(--header-height);z-index:9;background:var(--bg);padding-block:8px}
  .catalog-tools .catalog-search{margin:0;padding:0}
  .catalog-search .search-box{min-width:0;gap:6px}
  .catalog-search .search-box input{width:0;min-width:0;font-size:16px}
  .catalog-search .search-box button{min-height:44px;font-size:13px;max-width:90px}
  .catalog-search .search-box button::after{content:none}
  .category-filters{flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;gap:4px;scroll-padding-inline:4px;padding-bottom:4px}
  .category-filters button{flex:0 0 auto;white-space:nowrap;min-height:44px;padding:8px 14px}
  .visible-genders .filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .visible-genders .filters button{width:100%;min-width:0;min-height:44px;padding:8px;font-size:14px}
  .filter-content .scent-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .filter-content .scent-filters button{min-height:44px;padding:8px 10px}
  .cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:26px 12px}
  .perfume-card,.card-body,.detail-summary,.quick-product>div{min-width:0}
  .card-body h3{font-size:15px;min-height:3.9em;line-height:1.3}
  .card-title{width:100%;overflow-wrap:anywhere;min-height:44px}
  .card-body .brandline{overflow-wrap:anywhere}
  .card-body .card-scent{line-height:1.45}
  .card-actions{gap:4px;padding-top:8px}
  .card-actions button,.card-actions .quick-choice{min-height:44px;font-size:13px;line-height:1.3;margin:0;padding:8px 4px}
  .card-image{object-fit:contain;aspect-ratio:1;max-width:100%;height:auto}
  .detail-sections{gap:2px;overflow-x:auto;flex-wrap:nowrap;justify-content:space-between}
  .detail-sections a{min-height:44px;padding:10px 8px;white-space:nowrap;font-size:13px}
  .detail-media{padding:12px 12px 0}
  .detail-media .gallery-stage img{height:clamp(220px,65vw,330px);object-fit:contain}
  .detail-media .gallery-thumbs button{flex:0 0 78px;min-height:106px}
  .detail-media .gallery-thumbs img{width:62px;height:62px;object-fit:contain}
  .gallery-controls{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:6px}
  .gallery-controls button{padding:0;width:44px}
  .gallery-controls span{overflow-wrap:anywhere;line-height:1.35}
  .detail-summary{padding:20px 16px}
  .detail-summary h1{font-size:clamp(26px,7vw,34px);overflow-wrap:anywhere}
  .detail-summary h2{overflow-wrap:anywhere}
  .purchase-panel{padding:14px;margin-top:18px}
  .purchase-kinds{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .purchase-kinds legend{grid-column:1/-1}
  .purchase-kinds label{min-width:0}
  .purchase-kinds span{padding:10px 6px;font-size:14px;min-height:48px;text-align:center}
  .purchase-volumes label{min-width:64px}
  .purchase-action-row{gap:8px;flex-wrap:wrap}
  .purchase-quantity button{width:44px;min-width:44px;min-height:44px}
  .purchase-quantity input{width:36px;min-height:44px;margin:0}
  .purchase-action-row>.primary{min-width:112px;min-height:48px;padding:10px 8px;font-size:14px}
  .mobile-purchase{gap:6px;padding-block:8px calc(8px + env(safe-area-inset-bottom))}
  .mobile-purchase .mobile-selection{flex-wrap:wrap;gap:0 8px}
  .mobile-purchase .mobile-selection span{font-size:13px}
  .mobile-purchase .mobile-selection small{margin:0;font-size:12px}
  .mobile-purchase .purchase-action-row{gap:8px}
  .mobile-purchase .purchase-action-row>.primary{min-height:48px}
  body:has(dialog[open]) .mobile-purchase{visibility:hidden}
  .summary-actions{gap:8px}
  .summary-actions button{min-height:44px;flex:1;padding:10px;font-size:13px}
  .panel{padding:18px}
  .illustrated-notes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 8px}
  .illustrated-notes figure{width:auto;min-width:0}
  .illustrated-notes figcaption{overflow-wrap:anywhere}
  .note-image{width:64px;height:64px;max-width:100%}
  #bagDialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);border-radius:14px}
  .bag-header{padding:12px 14px;gap:8px}
  .bag-header h2{font-size:25px}
  .bag-header button{padding:8px 10px;flex-shrink:0}
  #bagBody{padding:14px 14px max(20px,env(safe-area-inset-bottom))}
  .bag-item{grid-template-columns:56px minmax(0,1fr);gap:12px;padding-block:16px}
  .bag-photo{width:56px;height:76px}
  .bag-item h3{font-size:17px;line-height:1.35}
  .bag-item .brandline{font-size:12px;letter-spacing:.5px}
  .bag-quantity{gap:6px}
  .bag-quantity button{padding:8px 12px}
  .bag-payment-summary{padding:16px}
  .bag-checkout textarea{min-height:140px;font-size:16px}
  .discovery-menu{max-height:100dvh;overscroll-behavior:contain}
  .discovery-menu .discovery-dialog-heading{padding-top:max(14px,env(safe-area-inset-top))}
  #menuBody{padding-bottom:calc(20px + env(safe-area-inset-bottom))}
  .quick-dialog,.customer-dialog{max-height:calc(100dvh - env(safe-area-inset-top) - 12px);overscroll-behavior:contain}
  .quick-product{gap:12px;align-items:flex-start}
  .quick-product img{width:64px;height:82px;flex-shrink:0}
  .quick-product h2{font-size:22px;overflow-wrap:anywhere}
  .quick-dialog .discovery-dialog-heading>span{font-size:14px;line-height:1.35}
  .customer-heading{gap:8px}
  .customer-heading button{flex-shrink:0;padding:8px 10px}
  .customer-content{padding-bottom:calc(20px + env(safe-area-inset-bottom))}
  .compare-tray .compare-chip{min-height:44px}
  .compare-scroll{max-width:100%;overscroll-behavior-inline:contain}
  .compare-table th:first-child{width:100px}
}
@media(max-width:360px){
  .topbar{grid-template-columns:minmax(0,1fr) 106px minmax(0,1fr);column-gap:4px}
  .topbar .brand{width:106px;height:60px}.topbar .brand img{width:156px}
  .cards{gap:24px 10px}.card-body h3{font-size:14px}
  .purchase-panel .purchase-action-row>.primary{flex-basis:100%;max-width:none}
}
@media(max-height:500px) and (max-width:1100px){
  .catalog-tools{top:0}
  .mobile-purchase{position:static;margin-top:16px;box-shadow:none}
  .product-view{padding-bottom:0}
}
