/* CrownOS dealer portal: the Store (dealer-store.js). Uses the portal's own tokens (dealer-portal.css) and Crown's
   design system (design-system.css); forest green accent, quiet surfaces, phone-first layout. */
.ds-store{display:flex;flex-direction:column;gap:20px;min-width:0}
.ds-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap}
.ds-head p:not(.dp-kicker){margin-top:6px}
.ds-cart-button{display:inline-flex;align-items:center;gap:8px}
.ds-cart-button small{font-weight:400;opacity:.85}
.ds-count{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:#1e3f27;color:#ffffff;font-size:12px;font-weight:600}
.btn-primary .ds-count{background:#ffffff;color:#1e3f27}

.ds-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:24px;align-items:start}
.ds-cats{display:flex;flex-direction:column;gap:2px;position:sticky;top:12px}
.ds-cats button{display:flex;justify-content:space-between;gap:8px;text-align:left;border:0;background:none;padding:9px 12px;border-radius:6px;color:var(--dp-ink);font-size:14px;min-height:40px}
.ds-cats button span{color:var(--dp-muted);font-size:12px;font-variant-numeric:tabular-nums}
.ds-cats button:hover{background:#f3f2ee}
.ds-cats button.active{background:#e7efe8;color:#1e3f27;font-weight:600}
.ds-cats .ds-sub{padding-left:26px;font-size:13px}

.ds-main{display:flex;flex-direction:column;gap:12px;min-width:0}
.ds-toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.ds-toolbar input[type=search]{flex:1 1 260px;min-height:44px;padding:10px 12px;border:1px solid #c9dccd;border-radius:6px;font:inherit;font-size:15px;background:#ffffff;color:var(--dp-ink)}
.ds-toggle{display:inline-flex;gap:8px;align-items:center;font-size:14px;cursor:pointer;min-height:44px}
.ds-toggle input{width:18px;height:18px}

.ds-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px}
.ds-more{display:flex;flex-direction:column;align-items:center;gap:6px;margin:20px 0 4px;text-align:center}
.ds-more small{color:var(--dp-muted)}
.ds-card{display:flex;flex-direction:column;width:100%;height:100%;text-align:left;padding:0;border:1px solid var(--dp-border);border-radius:10px;background:#ffffff;overflow:hidden;color:var(--dp-ink);box-shadow:0 1px 2px #171b190a;transition:border-color .15s,box-shadow .15s}
.ds-card:hover{border-color:#9fbaa5;box-shadow:0 4px 14px #171b1912}
.ds-card-photo{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:cover;background:#f3f2ee}
.ds-card-body{display:flex;flex-direction:column;gap:3px;padding:12px 14px 14px}
.ds-card-body strong{font-size:14px;font-weight:600;line-height:1.35}
.ds-card-body small{color:var(--dp-muted);font-size:12px}
.ds-sku{font-family:'IBM Plex Mono',ui-monospace,monospace}
.ds-price{font-size:14px;font-weight:600;color:#1e3f27;margin-top:4px}
.ds-noimg{display:grid;place-items:center;font-family:Georgia,serif;font-size:34px;color:#9aa39d;background:#f3f2ee}
.ds-card-photo.ds-noimg{aspect-ratio:4/3}
.ds-photo-failed{opacity:.35}

.ds-item{display:flex;flex-direction:column;gap:12px}
.ds-back{align-self:flex-start}
.ds-item-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px;align-items:start}
.ds-gallery{display:flex;flex-direction:column;gap:10px}
.ds-hero{width:100%;height:auto;aspect-ratio:1/1;object-fit:contain;background:#f6f5f1;border:1px solid var(--dp-border);border-radius:10px}
.ds-hero.ds-noimg{font-size:72px}
.ds-thumbs{display:flex;gap:8px;flex-wrap:wrap}
.ds-thumbs button{padding:0;border:2px solid transparent;border-radius:8px;background:none;line-height:0}
.ds-thumbs button.active{border-color:#1e3f27}
.ds-thumb{width:64px;height:64px!important;object-fit:cover;border-radius:6px;background:#f3f2ee}
.ds-buy{display:flex;flex-direction:column;gap:10px;min-width:0}
.ds-buy h2{font-size:24px}
.ds-price-lg{font-size:20px!important;font-weight:600;color:#1e3f27!important}
.ds-fits{font-size:13px!important;color:#2f5d3a!important}
.ds-add{display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid var(--dp-border);border-radius:10px;background:#f6f5f1}
.ds-options{border:0;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:8px}
.ds-options legend{font-size:12px;color:var(--dp-muted);margin-bottom:6px;padding:0}
.ds-option{position:relative;cursor:pointer}
.ds-option input{position:absolute;opacity:0;inset:0;cursor:pointer}
.ds-option span{display:flex;flex-direction:column;padding:9px 14px;border:1px solid #c9dccd;border-radius:8px;background:#ffffff;font-size:14px;min-height:44px;justify-content:center}
.ds-option span small{font-size:11px;color:var(--dp-muted)}
.ds-option input:checked+span{border-color:#1e3f27;box-shadow:inset 0 0 0 1px #1e3f27;background:#e7efe8}
.ds-option input:focus-visible+span{outline:3px solid #2f5d3a;outline-offset:2px}
.ds-qty{display:flex;flex-direction:column;gap:6px}
.ds-qty label{font-size:12px;color:var(--dp-muted)}
.ds-qty small{font-size:12px;color:var(--dp-muted)}
.ds-stepper{display:inline-flex;align-items:stretch;border:1px solid #c9dccd;border-radius:8px;overflow:hidden;background:#ffffff;width:max-content}
.ds-stepper button{border:0;background:#ffffff;width:44px;font-size:18px;color:var(--dp-ink)}
.ds-stepper button:disabled{color:#c2c6c3;cursor:not-allowed}
.ds-stepper input{width:72px;border:0;border-left:1px solid #e2dfd7;border-right:1px solid #e2dfd7;text-align:center;font:inherit;font-size:16px;min-height:44px;-moz-appearance:textfield}
.ds-stepper input::-webkit-inner-spin-button,.ds-stepper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
/* Stock: a status, never a count (core-store-stock-schema.sql). */
.ds-stock{display:inline-flex;align-items:center;gap:6px;align-self:flex-start;margin-top:6px;font-size:12px;font-weight:600;line-height:1.3;color:#1e3f27}
.ds-stock::before{content:"";width:8px;height:8px;border-radius:50%;background:#2f5d3a;flex:none}
.ds-stock-back{color:#7a4e0c}.ds-stock-back::before{background:#c88a1e}
.ds-stock-ask{color:var(--dp-muted);font-weight:500}.ds-stock-ask::before{background:#b3b8b4}
.ds-stock-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0}.ds-stock-line .ds-stock{margin-top:0;font-size:13px}
.ds-stock-line small{font-size:12px;color:var(--dp-muted)}
.ds-cart-what .ds-stock{margin-top:2px}
.ds-summary-lines em{font-style:normal;color:#7a4e0c;font-size:12px}
.ds-ship-when .dp-note{margin-top:8px}
.ds-line-total{font-size:14px!important;color:var(--dp-ink)!important;font-weight:600}
.ds-details h3{font-size:15px;margin-bottom:6px}
.ds-details p{white-space:normal}

.ds-cart-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px;align-items:start}
.ds-cart-lines{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.ds-cart-line{display:grid;grid-template-columns:56px minmax(0,1fr) auto auto auto;gap:14px;align-items:center;padding:14px 0;border-top:1px solid var(--dp-border)}
.ds-cart-line:first-child{border-top:0}
.ds-cart-photo{width:56px;height:56px!important;object-fit:cover;border-radius:6px;background:#f3f2ee;font-size:22px}
.ds-cart-what{display:flex;flex-direction:column;gap:2px;min-width:0}
.ds-cart-what small{color:var(--dp-muted);font-size:12px}
.ds-cart-qty{display:flex;gap:6px;align-items:center}
.ds-cart-qty input{width:72px;min-height:40px;padding:6px 8px;border:1px solid #c9dccd;border-radius:6px;font:inherit;text-align:center}
.ds-cart-sum{font-variant-numeric:tabular-nums;white-space:nowrap}
.ds-issue{background:#fdf4e7}
.ds-warn{font-size:13px!important;color:#8a5a12!important;background:#fdf4e7;border:1px solid #f0d9b0;border-radius:6px;padding:8px 10px}
.ds-summary{display:flex;flex-direction:column;gap:12px;position:sticky;top:12px}
.ds-summary dl{margin:0;display:flex;flex-direction:column;gap:6px}
.ds-summary dl div{display:flex;justify-content:space-between;gap:12px;font-size:14px}
.ds-summary dt{color:var(--dp-muted)}
.ds-summary dd{margin:0;font-weight:600;font-variant-numeric:tabular-nums}
.ds-summary .btn{width:100%}
.ds-summary-lines{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--dp-muted);max-height:260px;overflow:auto}
.ds-summary-lines li{display:flex;justify-content:space-between;gap:10px}
.ds-checkout{display:flex;flex-direction:column;gap:14px}
.ds-checkout .field{display:flex;flex-direction:column;gap:6px}
.ds-checkout .field label{font-size:12px;color:var(--dp-muted)}
.ds-checkout input:not([type=radio]),.ds-checkout textarea{font:inherit;font-size:15px;padding:10px;border:1px solid #c9dccd;border-radius:6px;background:#ffffff;color:var(--dp-ink);min-height:44px;width:100%;box-sizing:border-box}
.ds-checkout fieldset{border:0;padding:0;margin:0}
.ds-checkout legend{font-size:12px;color:var(--dp-muted);margin-bottom:6px;padding:0}
.ds-fields{display:flex;flex-direction:column;gap:12px}
.ds-placed{display:flex;flex-direction:column;gap:10px;max-width:640px}

@media (max-width:900px){
  .ds-layout{grid-template-columns:1fr}
  .ds-cats{position:static;flex-direction:row;overflow-x:auto;gap:6px;padding-bottom:4px}
  .ds-cats button{flex:none;white-space:nowrap;border:1px solid var(--dp-border)}
  .ds-cats .ds-sub{padding-left:12px}
  .ds-item-grid,.ds-cart-layout{grid-template-columns:1fr}
  .ds-summary{position:static}
}
@media (max-width:560px){
  .ds-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .ds-cart-line{grid-template-columns:48px minmax(0,1fr) auto;grid-template-areas:"p w s" "p q r"}
  .ds-cart-photo{grid-area:p;width:48px;height:48px}
  .ds-cart-what{grid-area:w}.ds-cart-sum{grid-area:s}.ds-cart-qty{grid-area:q}.ds-remove{grid-area:r}
}
/* Cut to order (core-store-cut-schema.sql): fabric by the yard and lengths cut to size. */
.ds-add .field{display:flex;flex-direction:column;gap:6px}
.ds-add .field label{font-size:12px;color:var(--dp-muted)}
.ds-add .field select,.ds-length input{font:inherit;font-size:15px;padding:10px;border:1px solid #c9dccd;border-radius:6px;background:#ffffff;color:var(--dp-ink);min-height:44px;width:100%;box-sizing:border-box}
.ds-length input{max-width:200px}
.ds-length small{font-size:12px;color:var(--dp-muted)}
.ds-swatches{border:0;padding:0;margin:0;display:flex;flex-direction:column;gap:12px}
.ds-swatches legend{font-size:12px;color:var(--dp-muted);margin-bottom:6px;padding:0}
.ds-style>p{margin:0 0 6px;font-size:13px;font-weight:600}
.ds-style>p small{font-weight:400;color:var(--dp-muted)}
.ds-swatch-row{display:flex;flex-wrap:wrap;gap:8px}
.ds-swatch{position:relative;cursor:pointer;display:flex;align-items:center;gap:8px;padding:6px 10px 6px 6px;border:1px solid #c9dccd;border-radius:8px;background:#ffffff;font-size:13px;min-height:44px}
.ds-swatch input{position:absolute;opacity:0;inset:0;cursor:pointer}
.ds-swatch span:last-child{display:flex;flex-direction:column}
.ds-swatch small{font-size:11px;color:var(--dp-muted)}
.ds-chip{width:28px;height:28px;border-radius:6px;border:1px solid #00000022;background:repeating-linear-gradient(45deg,#ece9e1 0 4px,#f6f5f1 4px 8px);flex:none}
.ds-swatch:has(input:checked){border-color:#1e3f27;box-shadow:inset 0 0 0 1px #1e3f27;background:#e7efe8}
.ds-swatch:has(input:focus-visible){outline:3px solid #2f5d3a;outline-offset:2px}
/* The roll width, after the colour (db/core-store-fabric-widths-schema.sql). */
.ds-widths{border:0;padding:0;margin:0}
.ds-widths legend{font-size:12px;color:var(--dp-muted);margin-bottom:6px;padding:0}
.ds-width-row{display:flex;flex-wrap:wrap;gap:8px}
.ds-width{position:relative;cursor:pointer;display:flex;align-items:center;padding:6px 12px;border:1px solid #c9dccd;border-radius:8px;background:#ffffff;font-size:14px;font-weight:600;min-height:44px}
.ds-width input{position:absolute;opacity:0;inset:0;cursor:pointer}
.ds-width span{display:flex;flex-direction:column}
.ds-width small{font-size:11px;font-weight:400;color:var(--dp-muted)}
.ds-width:has(input:checked){border-color:#1e3f27;box-shadow:inset 0 0 0 1px #1e3f27;background:#e7efe8}
.ds-width:has(input:focus-visible){outline:3px solid #2f5d3a;outline-offset:2px}
.ds-width-one{margin:0}
.ds-unit{font-size:12px;color:var(--dp-muted);align-self:center}
