/* DECEMBERMODY V147 — Stable Responsive Layer
   This file replaces the accumulated V123–V133 desktop/responsive overrides.
   Goals: predictable breakpoints, readable product cards, stable cart layering,
   symmetric shipping UI, and no changes to order/member/cart business logic. */

:root{
  --v147-rail:min(1480px,calc(100% - 28px));
  --v147-gap:12px;
  --v147-radius:16px;
}

/* ---------- shared safety / overflow ---------- */
body.order-redesign *,
body.order-redesign *::before,
body.order-redesign *::after{box-sizing:border-box;}
body.order-redesign{overflow-x:hidden;}
body.order-redesign img{max-width:100%;}

/* ---------- member note overlap fix ---------- */
body.order-redesign #cartPanel .member-benefit-in-cart .member-benefit-result,
body.order-redesign #cartPanel .member-benefit-in-cart .member-benefit-result.show{overflow:visible!important;}
body.order-redesign #cartPanel .member-benefit-in-cart .member-benefit-note{
  position:relative!important;
  display:block!important;
  margin-top:10px!important;
  padding:12px 12px 12px 40px!important;
  min-height:44px!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
  line-height:1.6!important;
}
body.order-redesign #cartPanel .member-benefit-in-cart .member-benefit-note::before{
  left:12px!important;top:12px!important;width:16px!important;height:16px!important;
  font-size:8px!important;line-height:1!important;
}

/* ---------- shipping block: one stable design for light/dark ---------- */
body.order-redesign #result .shipping-note-inline,
.product-detail-popup .shipping-note-inline{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr) minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:7px!important;
  width:100%!important;
  margin-top:7px!important;
  padding:7px 8px!important;
  border-radius:11px!important;
  border:1px solid #d9af45!important;
  background:#fff0b7!important;
  color:#49360b!important;
  font-weight:800!important;
  line-height:1.25!important;
  box-shadow:0 2px 7px rgba(108,78,13,.08)!important;
}
body.order-redesign #result .shipping-note-inline .shipping-note-icon,
.product-detail-popup .shipping-note-inline .shipping-note-icon{
  display:grid!important;place-items:center!important;width:30px!important;height:30px!important;
  border-radius:9px!important;background:#ffdd72!important;border:1px solid #d3a83b!important;
  color:#4a3506!important;font-size:15px!important;line-height:1!important;
}
body.order-redesign #result .shipping-note-inline .shipping-rate,
.product-detail-popup .shipping-note-inline .shipping-rate{
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
  min-width:0!important;min-height:30px!important;padding:3px 5px!important;border-radius:8px!important;
  background:rgba(255,255,255,.58)!important;text-align:center!important;color:#49360b!important;
}
body.order-redesign #result .shipping-note-inline .shipping-rate-label,
.product-detail-popup .shipping-note-inline .shipping-rate-label{font-size:7px!important;line-height:1.05!important;font-weight:800!important;}
body.order-redesign #result .shipping-note-inline .shipping-rate-value,
.product-detail-popup .shipping-note-inline .shipping-rate-value{margin-top:2px!important;font-size:10.5px!important;line-height:1.05!important;color:#362704!important;}
body.order-redesign #result .shipping-note-inline .shipping-round-label,
.product-detail-popup .shipping-note-inline .shipping-round-label{font-size:7px!important;font-weight:900!important;white-space:nowrap!important;color:#59430e!important;}
html[data-theme="dark"] body.order-redesign #result .shipping-note-inline,
html[data-theme="dark"] .product-detail-popup .shipping-note-inline{
  background:#493913!important;border-color:#cba34b!important;color:#f6d982!important;
  box-shadow:0 2px 8px rgba(0,0,0,.18)!important;
}
html[data-theme="dark"] body.order-redesign #result .shipping-note-inline .shipping-note-icon,
html[data-theme="dark"] .product-detail-popup .shipping-note-inline .shipping-note-icon{
  background:#6b5419!important;border-color:#b99239!important;color:#ffdf7d!important;
}
html[data-theme="dark"] body.order-redesign #result .shipping-note-inline .shipping-rate,
html[data-theme="dark"] .product-detail-popup .shipping-note-inline .shipping-rate{
  background:#30270f!important;color:#f6d982!important;
}
html[data-theme="dark"] body.order-redesign #result .shipping-note-inline .shipping-rate-value,
html[data-theme="dark"] .product-detail-popup .shipping-note-inline .shipping-rate-value,
html[data-theme="dark"] body.order-redesign #result .shipping-note-inline .shipping-round-label,
html[data-theme="dark"] .product-detail-popup .shipping-note-inline .shipping-round-label{color:#ffe7a0!important;}

/* ---------- card readability ---------- */
body.order-redesign #result .content{padding:10px!important;}
body.order-redesign #result .meta{font-size:7.4px!important;line-height:1.38!important;}
body.order-redesign #result .name{font-size:12px!important;line-height:1.38!important;min-height:40px!important;margin-bottom:7px!important;}
body.order-redesign #result .chip{font-size:6.9px!important;line-height:1.25!important;padding:3px 6px!important;}
body.order-redesign #result .price-box{padding:8px!important;}
body.order-redesign #result .price-box small{font-size:6.8px!important;line-height:1.25!important;}
body.order-redesign #result .price-box strong{font-size:11px!important;line-height:1.28!important;}
body.order-redesign #result .details-btn,
body.order-redesign #result .add-btn{min-height:34px!important;font-size:9px!important;}

/* ---------- desktop / tablet landscape ---------- */
@media (min-width:721px){
  body.order-redesign{padding-bottom:24px!important;}

  /* prevent legacy mobile controls leaking into desktop */
  body.order-redesign .mobile-app-nav,
  body.order-redesign .mobile-cart-bar,
  body.order-redesign #mobileCartBar,
  body.order-redesign .search-fab,
  body.order-redesign #searchFab{display:none!important;visibility:hidden!important;pointer-events:none!important;}

  /* compact, single-row desktop header */
  body.order-redesign .desktop-topbar,
  body.cart-open.order-redesign .desktop-topbar{
    position:sticky!important;top:8px!important;z-index:1200!important;
    width:var(--v147-rail)!important;min-height:64px!important;height:auto!important;
    margin:8px auto 14px!important;padding:9px 11px!important;
    display:grid!important;
    grid-template-columns:50px minmax(110px,1fr) 44px auto!important;
    grid-template-areas:"menu title actions controls"!important;
    gap:8px!important;align-items:center!important;overflow:visible!important;
    border:1px solid var(--ref-line,#d7dee7)!important;border-radius:18px!important;
    background:color-mix(in srgb,var(--ref-panel2,#fff) 96%,transparent)!important;
    color:var(--ref-ink,#1c2734)!important;
    box-shadow:0 8px 24px rgba(24,36,52,.10)!important;backdrop-filter:blur(14px)!important;
  }
  body.order-redesign .desktop-brand{display:none!important;}
  body.order-redesign .mobile-header-search{display:none!important;}
  body.order-redesign .desktop-menu-btn{
    grid-area:menu!important;width:48px!important;min-width:48px!important;height:44px!important;min-height:44px!important;
    margin:0!important;padding:0!important;display:grid!important;place-items:center!important;border-radius:13px!important;
  }
  body.order-redesign .mobile-store-head{
    grid-area:title!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
    justify-self:center!important;min-width:0!important;text-align:center!important;margin:0!important;padding:0!important;
  }
  body.order-redesign .mobile-store-head strong{font-size:13px!important;line-height:1.1!important;color:var(--ref-ink)!important;}
  body.order-redesign .mobile-store-head small{margin-top:3px!important;font-size:7px!important;line-height:1!important;letter-spacing:.8px!important;color:var(--ref-muted)!important;}
  html[data-theme="dark"] body.order-redesign .mobile-store-head strong{color:#f2f5fa!important;}
  html[data-theme="dark"] body.order-redesign .mobile-store-head small{color:#adb8c8!important;}

  /* only desktop search stays in header; floating cart is the cart entry */
  body.order-redesign .desktop-shop-actions{
    grid-area:actions!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;
    gap:6px!important;margin:0!important;min-width:0!important;flex-wrap:nowrap!important;
  }
  body.order-redesign .desktop-shop-actions #topCartOpen,
  body.order-redesign .desktop-shop-actions #topCartClear,
  body.order-redesign .desktop-shop-actions #topOrderJump{display:none!important;}
  body.order-redesign .desktop-shop-actions #topSearchJump{
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    width:42px!important;min-width:42px!important;height:40px!important;min-height:40px!important;
    padding:0!important;margin:0!important;border-radius:12px!important;font-size:19px!important;
  }
  body.order-redesign .desktop-shop-actions #topSearchJump span{display:none!important;}

  /* theme + light/dark remain visible in the same row */
  body.order-redesign .desktop-controls,
  body.cart-open.order-redesign .desktop-controls{
    grid-area:controls!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;
    gap:7px!important;margin:0!important;min-width:0!important;flex-wrap:nowrap!important;justify-self:end!important;
  }
  body.order-redesign .desktop-control-label{display:none!important;}
  body.order-redesign .palette-select,
  body.cart-open.order-redesign .palette-select{
    display:block!important;visibility:visible!important;opacity:1!important;
    width:clamp(142px,18vw,210px)!important;min-width:142px!important;max-width:210px!important;
    height:40px!important;min-height:40px!important;margin:0!important;padding-inline:10px 28px!important;
    border-radius:12px!important;font-size:10px!important;
  }
  body.order-redesign .theme-toggle-btn,
  body.cart-open.order-redesign .theme-toggle-btn{
    display:inline-flex!important;visibility:visible!important;opacity:1!important;
    min-width:80px!important;width:auto!important;height:40px!important;min-height:40px!important;
    margin:0!important;padding:0 10px!important;border-radius:12px!important;align-items:center!important;justify-content:center!important;gap:5px!important;
  }
  body.order-redesign .theme-toggle-btn #themeLabel{display:inline!important;}

  /* one aligned content rail */
  body.order-redesign .page,
  body.order-redesign #shopFinder.finder-top-dock,
  body.order-redesign .products-window,
  body.order-redesign .desktop-order-check,
  body.order-redesign .desktop-review-panel,
  body.order-redesign .footer.window.footer-bar{
    width:var(--v147-rail)!important;max-width:none!important;margin-left:auto!important;margin-right:auto!important;
  }

  /* finder shell */
  body.order-redesign #shopFinder.finder-top-dock{margin-top:0!important;padding:15px!important;border-radius:18px!important;overflow:visible!important;}
  body.order-redesign #shopFinder .quick-shop-wrap{margin:0 0 12px!important;}
  body.order-redesign #shopFinder .quick-shop-buttons{
    display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:9px!important;width:100%!important;min-width:0!important;
  }
  body.order-redesign #shopFinder .quick-filter-btn{
    width:100%!important;min-width:0!important;min-height:42px!important;margin:0!important;padding:7px 9px!important;
    display:flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;
    border-radius:12px!important;font-size:9.5px!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  }
  body.order-redesign #shopFinder .quick-shop-buttons>.quick-filter-btn:last-child{grid-column:auto!important;}
  body.order-redesign #shopFinder .search-row{
    display:grid!important;grid-template-columns:minmax(0,1fr) 160px!important;gap:10px!important;
    margin:0 0 10px!important;width:100%!important;
  }
  body.order-redesign #shopFinder .search-toolbar{
    display:grid!important;grid-template-columns:minmax(0,1fr) 270px!important;gap:10px!important;align-items:start!important;width:100%!important;
  }
  body.order-redesign #shopFinder .quick-filters{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:9px!important;}
  body.order-redesign #shopFinder .filter-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:9px!important;}
  body.order-redesign #shopFinder #keyword,
  body.order-redesign #shopFinder #searchBtn,
  body.order-redesign #shopFinder .quick-filters .field,
  body.order-redesign #shopFinder .filter-actions button{
    width:100%!important;min-width:0!important;min-height:42px!important;height:auto!important;margin:0!important;padding:8px 11px!important;
    border-radius:12px!important;font-size:10px!important;
  }

  /* product grid responds continuously */
  body.order-redesign #result .grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:11px!important;}

  /* floating cart = only persistent desktop cart trigger */
  body.order-redesign .cart-fab,
  body.order-redesign #cartFab.cart-fab{
    display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;
    position:fixed!important;right:16px!important;bottom:16px!important;z-index:1280!important;
  }
  body.cart-open.order-redesign .desktop-topbar{visibility:hidden!important;opacity:0!important;pointer-events:none!important;}
  body.cart-open.order-redesign .cart-fab,
  body.cart-open.order-redesign #cartFab.cart-fab{display:none!important;}
  body.cart-open.order-redesign #backdrop.backdrop{z-index:1450!important;}
  body.cart-open.order-redesign #cartPanel.cart-panel{z-index:1500!important;}
}

/* laptop */
@media (min-width:1000px) and (max-width:1319px){
  body.order-redesign #shopFinder .quick-shop-buttons{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  body.order-redesign #result .grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}

/* resized desktop / tablet landscape */
@media (min-width:721px) and (max-width:999px){
  :root{--v147-rail:calc(100% - 20px);}
  body.order-redesign .desktop-topbar,
  body.cart-open.order-redesign .desktop-topbar{
    grid-template-columns:46px minmax(86px,1fr) 40px auto!important;gap:6px!important;padding:8px!important;
  }
  body.order-redesign .desktop-menu-btn{width:44px!important;min-width:44px!important;height:40px!important;min-height:40px!important;}
  body.order-redesign .desktop-shop-actions #topSearchJump{width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important;}
  body.order-redesign .palette-select,
  body.cart-open.order-redesign .palette-select{width:clamp(132px,21vw,168px)!important;min-width:132px!important;max-width:168px!important;height:38px!important;min-height:38px!important;font-size:9px!important;}
  body.order-redesign .theme-toggle-btn,
  body.cart-open.order-redesign .theme-toggle-btn{height:38px!important;min-height:38px!important;min-width:42px!important;padding:0 8px!important;}
  body.order-redesign .theme-toggle-btn #themeLabel{display:none!important;}
  body.order-redesign #shopFinder .quick-shop-buttons{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  body.order-redesign #shopFinder .search-row{grid-template-columns:minmax(0,1fr) 145px!important;}
  body.order-redesign #shopFinder .search-toolbar{grid-template-columns:1fr!important;}
  body.order-redesign #shopFinder .filter-actions{grid-template-columns:1fr 1fr!important;}
  body.order-redesign #result .grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}

/* ---------- phone: preserve 2/4 switch, improve compact safety ---------- */
@media (max-width:720px){
  body.order-redesign{overflow-x:hidden!important;}
  body.order-redesign .page{max-width:100%!important;}
  body.order-redesign #result{overflow:hidden!important;}
  body.order-redesign #result .card{min-width:0!important;}
  body.order-redesign[data-mobile-product-view="2"] #result .name{font-size:11.3px!important;min-height:38px!important;}
  body.order-redesign[data-mobile-product-view="2"] #result .price-box strong{font-size:10.5px!important;}
  body.order-redesign[data-mobile-product-view="4"] #result .content{padding:4px!important;}
  body.order-redesign[data-mobile-product-view="4"] #result .name{font-size:7.1px!important;line-height:1.25!important;min-height:20px!important;margin-bottom:3px!important;}
  body.order-redesign[data-mobile-product-view="4"] #result .price-box{padding:4px!important;}
  body.order-redesign[data-mobile-product-view="4"] #result .price-box small{font-size:4.7px!important;}
  body.order-redesign[data-mobile-product-view="4"] #result .price-box strong{font-size:6.8px!important;}
  body.order-redesign[data-mobile-product-view="4"] #result .shipping-note-inline{
    grid-template-columns:1fr!important;gap:2px!important;padding:4px!important;border-radius:7px!important;text-align:center!important;
  }
  body.order-redesign[data-mobile-product-view="4"] #result .shipping-note-inline .shipping-note-icon{display:none!important;}
  body.order-redesign[data-mobile-product-view="4"] #result .shipping-note-inline .shipping-rate{min-height:0!important;padding:2px!important;}
  body.order-redesign[data-mobile-product-view="4"] #result .shipping-note-inline .shipping-rate-label{font-size:4.3px!important;}
  body.order-redesign[data-mobile-product-view="4"] #result .shipping-note-inline .shipping-rate-value{font-size:5.9px!important;}
  body.order-redesign[data-mobile-product-view="4"] #result .shipping-note-inline .shipping-round-label{font-size:4.4px!important;}
  body.order-redesign[data-mobile-product-view="4"] #result .details-btn{min-height:25px!important;font-size:6.7px!important;}
}

@media (max-width:390px){
  body.order-redesign #cartPanel .member-benefit-in-cart .member-benefit-note{padding:12px 10px 12px 38px!important;font-size:9.5px!important;}
  body.order-redesign #cartPanel .member-benefit-in-cart .member-benefit-note::before{left:11px!important;top:11px!important;}
}
