/* VDD_RESPONSIVE_V1: additive mobile/tablet layer.
   Loaded AFTER the existing styles; do not change catalog identity, photos or JS loaders. */
:where(.head,.site-nav,.page-shell,.home-grid,.catalog-layout,.product-page-grid,
       .cart-page-grid,.checkout-grid,.grid,.content-card,.checkout-card,.order-summary) {
  min-width: 0;
}
:where(.home-grid,.catalog-layout,.product-page-grid,.cart-page-grid,.checkout-grid) > * { min-width: 0; }
:where(.page-shell,.content-card,.checkout-card,.order-summary,.product-page-info,.cart-lines) {
  overflow-wrap: break-word;
}
:where(input,select,button,a,textarea):focus-visible {
  outline: 3px solid #e5a23e;
  outline-offset: 3px;
}
.vdd-filters-toggle { display: none; }
.site-nav { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.site-nav a { display: inline-flex; align-items:center; justify-content:center; }
.quick-category-nav { overscroll-behavior-x: contain; -webkit-overflow-scrolling:touch; }
.cart-line > *, .checkout-item > *, .summary-row > *, .cart-item-copy { min-width:0; }
.feature-table b, .checkout-item b, .cart-line b { overflow-wrap:anywhere; }

/* Compact tablets and landscape phones. */
@media (max-width: 960px) {
  .home-grid,.product-page-grid,.cart-page-grid,.checkout-grid { grid-template-columns: minmax(0,1fr); }
  .catalog-layout { grid-template-columns: minmax(0,1fr); }
  .filters-panel { position:static;max-height:none; }
  .home-grid > *, .catalog-layout > * { min-width:0; }
  .product-page-photo { min-height: 310px; }
  .checkout-grid .order-summary, .cart-page-grid .order-summary { position:static; }
}

@media (max-width: 760px) {
  /* Folds rather than removing filters. Without JS they remain visible. */
  .vdd-responsive-ready .vdd-filters-toggle {
    display:flex; width:100%; min-height:46px; align-items:center;
    justify-content:space-between; gap:14px; padding:11px 16px;
    border:1px solid var(--line); border-radius:14px; background:#fff;
    color:var(--ink); font-weight:800; text-align:left;
    grid-column:1/-1;
  }
  .vdd-filters-toggle::after {content:'▾';font-size:19px;color:var(--accent);}
  .vdd-filters-open > .vdd-filters-toggle::after {content:'▴';}
  .vdd-responsive-ready .catalog-layout:not(.vdd-filters-open) > #smartFilters { display:none; }
  .catalog-layout { gap:12px; }
  .toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .toolbar #search, .toolbar #category { grid-column:1/-1; }
  .toolbar input, .toolbar select, .price-filter input { min-width:0; }
  .section-head, .page-title {align-items:flex-start;flex-wrap:wrap;}
  .info-strip { grid-template-columns:minmax(0,1fr); }
  .foot { grid-template-columns:repeat(2,minmax(0,1fr));gap:20px; }
  .foot > :first-child { grid-column:1/-1; }
  .related-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .vdd-docs__panel {grid-template-columns:minmax(0,1fr);}
}

@media (max-width: 600px) {
  .wrap {padding-left:12px;padding-right:12px;}
  .topbar {padding:8px 10px;font-size:11px;line-height:1.45;}
  .head {display:flex;flex-wrap:wrap;gap:9px 10px;padding:11px 0;}
  .head .logo {font-size:21px;line-height:1.15;}
  .head .head-actions {margin-left:auto;}
  .head .head-actions .iconbtn {display:inline-flex!important;align-items:center;justify-content:center;min-height:42px;padding:9px 12px;font-size:13px;}
  /* Old CSS hid search on phones; restore as the second header row. */
  .head .search {display:block!important;order:3;flex:0 0 100%;width:100%;min-width:0;}
  .head .search input {width:100%;min-height:44px;font-size:16px;padding:10px 13px;}
  .site-nav {gap:4px;padding:0 0 9px;scrollbar-width:thin;}
  .site-nav a {flex:0 0 auto;min-height:41px;padding:8px 11px;font-size:12px;}
  header {backdrop-filter:none;}
  .page-hero {padding:20px 0 14px;}
  .page-hero h1,.page-title h1 {font-size:clamp(26px,7.5vw,35px);letter-spacing:-.9px;line-height:1.14;}
  .page-hero p {font-size:14px;line-height:1.55;}
  .home-card,.home-card.big {padding:22px 18px;border-radius:20px;}
  .home-card h1 {font-size:clamp(29px,8.5vw,41px);letter-spacing:-1.1px;line-height:1.12;}
  .home-card h2 {font-size:21px;line-height:1.24;}
  .home-actions .btn {min-height:44px;display:inline-flex;align-items:center;justify-content:center;text-align:center;}
  .section {padding:16px 0;}
  .section-head h2,.section h2 {font-size:24px;}
  .content-card,.cart-lines,.checkout-card,.order-summary {padding:17px;border-radius:18px;}
  .toolbar {gap:9px;}
  .toolbar input,.toolbar select,.field input,.field select,textarea {min-height:44px;font-size:16px;}
  .grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .grid > * {min-width:0;}
  .product {min-width:0;border-radius:16px;}
  .product .pic {aspect-ratio:4/3;min-width:0;}
  .product .product-img {padding:6px;}
  .product .pbody {padding:10px;gap:7px;min-height:0;}
  .product .title {font-size:12px;min-height:47px;-webkit-line-clamp:3;line-height:1.3;}
  .product .meta,.product .spec,.product .stock {font-size:11px;}
  .product .spec {min-height:30px;height:30px;}
  .product .price {font-size:clamp(16px,4.8vw,22px);letter-spacing:-.4px;}
  .product .badge,.product .fresh {font-size:9px;max-width:calc(100% - 18px);}
  .product .card-actions {grid-template-columns: minmax(0,1fr)!important;gap:7px;}
  .product .card-actions .add,.product .card-actions .details {
    width:100%;min-width:0;min-height:42px;padding:8px 6px!important;
    font-size:12px;white-space:normal;line-height:1.2;
  }
  .product-page-grid {gap:15px;}
  .product-page-photo {min-height:0;aspect-ratio:4/3;border-radius:19px;}
  .product-page-photo img,.product-page-img {padding:9px!important;max-height:360px;object-fit:contain;}
  .product-page-info h1 {font-size:clamp(25px,7vw,34px);overflow-wrap:anywhere;}
  .big-price-row {flex-wrap:wrap;gap:8px;}
  .big-price-row strong {font-size:clamp(28px,8vw,39px);}
  .feature-table>div {grid-template-columns:minmax(0,1fr);gap:4px;padding:11px 0;}
  .primary-wide,.secondary-wide,.checkout {min-height:44px;}
  .cart-page-grid,.checkout-grid {gap:14px;}
  .cart-line {grid-template-columns:64px minmax(0,1fr);gap:8px 12px;}
  .cart-line-photo {width:64px;height:64px;}
  .cart-line>strong,.cart-line>button {grid-column:2;justify-self:start;}
  .cart-item {grid-template-columns:48px minmax(0,1fr) auto!important;gap:8px!important;}
  .cart-item-thumb {height:48px;width:48px;}
  .cart-item-side {white-space:normal;overflow-wrap:anywhere;max-width:95px;}
  .checkout-item,.order-summary .summary-row {flex-wrap:wrap;}
  .calc-row {grid-template-columns:minmax(0,1fr);}
  .panel,.mini-cart-panel {width:min(100%,430px);padding:16px 13px;}
  .related-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .vdd-docs__panel,.vdd-docs__card {padding:18px;}
  .vdd-docs__faq details {padding:15px;}
  .foot {grid-template-columns:minmax(0,1fr);padding:30px 12px;}
  .foot > :first-child {grid-column:auto;}
}

@media (max-width: 359px) {
  /* 320px devices: avoid 150px-wide cards with unreadable text/actions. */
  .grid {grid-template-columns:minmax(0,1fr);}
  .product .pbody {padding:14px;}
  .product .card-actions {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .head .logo {font-size:19px;}
  .home-actions {flex-direction:column;align-items:stretch;}
  .toolbar {grid-template-columns:minmax(0,1fr);}
  .toolbar #search,.toolbar #category {grid-column:auto;}
  .price-filter {grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);}
}

@media (prefers-reduced-motion: reduce) {
  .product,.product-img,.cat,.showcase-card,.quick-category-img {transition:none!important;}
}
