:root{
  --bg:#f5f6f2; --surface:#fff; --ink:#1e231d; --muted:#6c7468; --line:#e1e5dc; --soft:#eef1ea;
  --wine:#4f5e4b; --wine-2:#3c4939; --wine-soft:#e8eee5; --gold:#c49a52; --ok:#3f7d4a; --warn:#b4541b;
  --focus:#a8b8a2;
  --r:18px; --r-sm:12px; --sh:0 1px 2px rgba(30,40,28,.05),0 6px 24px -12px rgba(30,40,28,.2);
  --serif:Comfortaa,"Trebuchet MS",system-ui,sans-serif;
  --sans:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
html,body{overflow-x:clip}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.45 var(--sans);-webkit-font-smoothing:antialiased}
body.lock{overflow:hidden}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
img{max-width:100%}
.wrap{max-width:1280px;margin:0 auto;padding:0 20px}
.muted{color:var(--muted)}
.link{background:none;border:0;color:var(--wine);font-weight:600;padding:4px 0;text-decoration:underline;text-underline-offset:3px}
[hidden]{display:none!important}

/* header */
.top{position:sticky;top:0;z-index:30;background:rgba(248,245,241,.88);backdrop-filter:saturate(1.4) blur(14px);-webkit-backdrop-filter:saturate(1.4) blur(14px);border-bottom:1px solid var(--line)}
.top-in{display:flex;align-items:center;gap:14px;height:68px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:inherit;flex:none}
.logo{width:46px;height:46px;border-radius:50%;display:block;box-shadow:0 6px 16px -8px var(--wine)}
.brand-mark svg{width:22px;height:22px;stroke:none}
.brand-text{display:flex;flex-direction:column;line-height:1.1}
.brand-text b{font-family:var(--serif);font-weight:700;font-size:21px;letter-spacing:.2px;color:var(--wine-2)}
.brand-text small{font-size:11.5px;color:var(--muted);letter-spacing:.6px;text-transform:uppercase}
.search{flex:1;display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:0 16px;height:44px;max-width:560px;margin-left:auto;transition:border-color .15s,box-shadow .15s}
.search:focus-within{border-color:var(--focus);box-shadow:0 0 0 4px var(--wine-soft)}
.search svg{color:var(--muted)}
.search input{border:0;outline:0;background:none;flex:1;min-width:0;height:100%}
.icon-btn{display:flex;align-items:center;gap:8px;height:44px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font-weight:500}
.icon-btn:hover{border-color:#d9c9c0}
.cart-btn{position:relative;display:flex;align-items:center;gap:8px;height:44px;padding:0 18px 0 14px;border:0;border-radius:999px;background:var(--wine);color:#fff;font-weight:600;box-shadow:0 8px 18px -10px var(--wine);transition:transform .12s,background .15s}
.cart-btn:hover{background:var(--wine-2)}
.cart-btn.bump{animation:bump .35s}
@keyframes bump{40%{transform:scale(1.07)}}
.cart-count{position:absolute;top:-5px;right:-5px;min-width:21px;height:21px;padding:0 6px;border-radius:999px;background:var(--gold);color:#fff;font-size:12px;display:grid;place-items:center;border:2px solid var(--bg)}

/* hero */
.hero{padding:30px 0 18px}
.hero-in{display:grid;grid-template-columns:1.2fr 1fr;gap:28px;align-items:center}
.hero h1{font-family:var(--serif);font-weight:700;font-size:clamp(28px,4vw,40px);line-height:1.1;margin:4px 0 10px;color:var(--wine-2)}
.hero-text>p{margin:0;color:var(--muted);max-width:560px;font-size:16px}
.ship-card p{margin:0}
.notice{margin-top:14px;padding:12px 14px;border-radius:var(--r-sm);background:#fff6e6;border:1px solid #f1dcb4;color:#6d4a12;white-space:pre-line}
.paused{margin-top:14px;padding:12px 14px;border-radius:var(--r-sm);background:#fdecea;border:1px solid #f3c6c0;color:#8a2a1c;font-weight:500}
.ship-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px 18px;box-shadow:var(--sh)}
.ship-head{display:flex;align-items:center;gap:12px}
.ship-head>svg{width:40px;height:40px;padding:9px;border-radius:12px;background:var(--wine-soft);color:var(--wine)}
.ship-head>div{flex:1}
.ship-title{font-size:12.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px}
.ship-date{font-weight:700;font-size:18px}
.ship-rule{margin:12px 0 8px;font-size:14px}
.ship-map{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.ship-map span{display:flex;flex-direction:column;gap:1px;align-items:center;background:var(--soft);border-radius:10px;padding:6px 0;font-size:12px;color:var(--muted);line-height:1.25}
.ship-map i{font-style:normal;text-transform:uppercase;letter-spacing:.4px}
.ship-map i::after{content:"↓";display:block;text-align:center;font-size:11px;opacity:.7}
.ship-map b{font-size:15px;color:var(--wine);text-transform:uppercase}
.ship-note{font-size:12.5px;color:var(--muted);margin:10px 0}
.remote-note{background:#fff6e6;border-radius:8px;padding:8px 10px;color:#6d4a12;font-size:13.5px}
.how{list-style:none;display:flex;gap:10px;flex-wrap:wrap;padding:0;margin:18px 0 0}
.how li{display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:6px 14px 6px 6px;font-size:14px;font-weight:500}
.how b{width:24px;height:24px;border-radius:50%;background:var(--wine);color:#fff;display:grid;place-items:center;font-size:12.5px}

/* categories */
.cats-bar{position:sticky;top:68px;z-index:20;background:var(--bg);padding:8px 0;border-bottom:1px solid transparent}
.cats-bar.stuck{border-bottom-color:var(--line)}
.cats{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:2px 0}
.cats::-webkit-scrollbar{display:none}
.chip{flex:none;border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:8px 15px;font-weight:500;white-space:nowrap;transition:all .15s}
.chip:hover{border-color:#d6c3ba}
.chip small{color:var(--muted);margin-left:4px;font-weight:400}
.chip.on{background:var(--ink);color:#fff;border-color:var(--ink)}
.chip.on small{color:#cfc6c8}

/* toolbar */
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px auto 6px;flex-wrap:wrap}
.found{color:var(--muted);font-size:14px}
.tools{display:flex;gap:8px;align-items:center;min-width:0}
.tool{min-width:0}
.tool{display:flex;align-items:center;gap:6px;height:40px;padding:0 14px;border:1px solid var(--line);background:var(--surface);border-radius:var(--r-sm);font-weight:500}
select.tool{padding-right:10px}
.pill{background:var(--wine);color:#fff;border-radius:999px;font-size:11.5px;min-width:19px;height:19px;display:grid;place-items:center;padding:0 5px}
.seg{flex:none;display:flex;border:1px solid var(--line);border-radius:var(--r-sm);overflow:hidden;background:var(--surface)}
.seg button{border:0;background:none;width:40px;height:38px;display:grid;place-items:center;color:var(--muted)}
.seg button.on{background:var(--soft);color:var(--ink)}
.active-filters{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:6px}
.af{display:inline-flex;align-items:center;gap:6px;background:var(--wine-soft);color:var(--wine-2);border:0;border-radius:999px;padding:5px 11px;font-size:13px;font-weight:500}
.af b{font-weight:700}

/* grid of cards */
main{min-height:50vh;padding-bottom:40px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(228px,1fr));gap:16px;margin-top:8px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);overflow:hidden;display:flex;flex-direction:column;transition:box-shadow .18s,transform .18s,border-color .18s}
.card:hover{box-shadow:var(--sh);border-color:#d3dacd}
.card.off{opacity:.62}
.ph{position:relative;aspect-ratio:1/1;background:linear-gradient(180deg,#fafbf8,#eef1ea);display:grid;place-items:center;cursor:zoom-in;overflow:hidden}
.ph img{width:100%;height:100%;object-fit:contain;padding:14px;transition:transform .35s}
.card:hover .ph img{transform:scale(1.04)}
.ph .noimg{width:38%;height:auto;opacity:.22;color:var(--wine);stroke-width:1.2}
.badges{position:absolute;left:10px;top:10px;display:flex;gap:5px;flex-wrap:wrap}
.badge{font-size:11px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;padding:4px 8px;border-radius:6px;background:var(--ink);color:#fff}
.badge.new{background:#2f6d8a}.badge{border-radius:999px;padding:4px 9px}.badge.hit{background:var(--gold)}.badge.promo{background:#c0392b}.badge.out{background:#8b8487}
.cb{padding:12px 14px 14px;display:flex;flex-direction:column;gap:4px;flex:1}
.cmeta{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cname{font-weight:600;font-size:16px;line-height:1.3;margin:0;cursor:pointer;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.cname:hover{color:var(--wine)}
.specs{display:flex;gap:5px;flex-wrap:wrap;margin-top:2px}
.spec{font-size:12px;background:var(--soft);border-radius:6px;padding:2px 7px;color:#5b5254}
.cfoot{margin-top:auto;padding-top:10px;display:flex;align-items:flex-end;justify-content:space-between;gap:8px;flex-wrap:wrap}
.price{font-weight:700;font-size:19px;white-space:nowrap}
.price s{font-weight:400;font-size:13px;color:var(--muted);margin-left:6px}
.boxprice{font-size:12px;color:var(--muted)}
.add{border:0;background:var(--wine);color:#fff;border-radius:var(--r-sm);height:46px;padding:0 16px;font-size:15.5px;font-weight:600;display:flex;align-items:center;gap:6px;transition:background .15s}
.add:hover{background:var(--wine-2)}
.add:disabled{background:#cfc8c9;cursor:not-allowed}
.add svg{width:18px;height:18px}
.qty{display:flex;align-items:center;border:1.5px solid var(--wine);border-radius:var(--r-sm);height:46px;overflow:hidden;background:#fff}
.qty button{border:0;background:none;width:40px;height:100%;font-size:22px;color:var(--wine);font-weight:600}
.qty button:hover{background:var(--wine-soft)}
.qty input{width:46px;border:0;text-align:center;font-weight:700;outline:0;height:100%;-moz-appearance:textfield;background:none}
.qty input::-webkit-outer-spin-button,.qty input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.boxbtn{border:1px dashed #cdb4bd;background:#fff;color:var(--wine);border-radius:8px;font-size:12.5px;font-weight:600;padding:4px 8px}
.boxbtn:hover{background:var(--wine-soft)}
.inbox{font-size:12px;color:var(--wine);font-weight:500}
.ctrl{display:flex;flex-direction:column;align-items:flex-end;gap:5px}

/* list view */
.grid.list{grid-template-columns:1fr;gap:0;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.grid.list .card{flex-direction:row;align-items:center;border:0;border-bottom:1px solid var(--soft);border-radius:0;padding:8px 12px;gap:12px}
.grid.list .card:last-child{border-bottom:0}
.grid.list .card:hover{box-shadow:none;background:#fdfbfa}
.grid.list .ph{width:64px;height:64px;flex:none;border-radius:10px;aspect-ratio:auto}
.grid.list .ph img{padding:4px}
.grid.list .badges{display:none}
.grid.list .cb{flex-direction:row;align-items:center;padding:0;gap:14px}
.grid.list .cinfo{flex:1;min-width:0}
.grid.list .cname{-webkit-line-clamp:2;font-size:14.5px}
.grid.list .cfoot{margin:0;padding:0;flex-wrap:nowrap;gap:14px}
.grid.list .price{font-size:16px}
.cinfo{display:flex;flex-direction:column;gap:4px}

.skel{height:360px;border-radius:var(--r);background:linear-gradient(90deg,#e9ede5 25%,#f4f6f1 50%,#e9ede5 75%);background-size:200% 100%;animation:sk 1.2s infinite}
@keyframes sk{to{background-position:-200% 0}}
.empty{text-align:center;padding:60px 20px;color:var(--muted)}
.empty-ico{font-size:42px}

/* buttons */
.btn{border:0;background:var(--wine);color:#fff;border-radius:12px;height:48px;padding:0 20px;font-weight:600;font-size:15.5px;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:background .15s}
.btn:hover{background:var(--wine-2)}
.btn:disabled{background:#cbbfc3;cursor:not-allowed}
.btn.ghost{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.btn.ghost:hover{background:var(--soft)}
.btn.block{width:100%}
.btn.sm{height:36px;padding:0 12px;font-size:14px;border-radius:9px}

/* sheets */
.sheet{position:fixed;inset:0;z-index:50}
.sheet-bg{position:absolute;inset:0;background:rgba(28,16,20,.42);animation:fade .2s}
@keyframes fade{from{opacity:0}}
.sheet-panel{position:absolute;background:var(--bg);display:flex;flex-direction:column;box-shadow:0 20px 60px -10px rgba(0,0,0,.35)}
.sheet-panel.side{top:0;right:0;bottom:0;width:min(420px,100%);animation:slide .25s cubic-bezier(.2,.8,.2,1)}
.sheet-panel.side.wide{width:min(560px,100%)}
@keyframes slide{from{transform:translateX(30px);opacity:.4}}
.sheet-panel.modal{left:50%;top:50%;transform:translate(-50%,-50%);width:min(880px,calc(100% - 32px));max-height:calc(100% - 40px);border-radius:20px;overflow:auto;animation:pop .22s cubic-bezier(.2,.8,.2,1)}
@keyframes pop{from{transform:translate(-50%,-47%);opacity:.3}}
.sheet-head{flex:none;display:flex;align-items:center;gap:10px;padding:16px 20px;border-bottom:1px solid var(--line);background:var(--surface)}
.sheet-head h2{margin:0;font-family:var(--serif);font-weight:700;font-size:22px;flex:1}
.x,.back{border:0;background:var(--soft);width:36px;height:36px;border-radius:50%;font-size:22px;line-height:1;display:grid;place-items:center}
.back{font-size:18px}
.sheet-body{flex:1;overflow:auto;padding:16px 20px;-webkit-overflow-scrolling:touch}
.sheet-foot{flex:none;padding:14px 20px calc(14px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--surface);display:flex;gap:10px}
.sheet-foot>.btn{flex:1}
.sheet-foot.col{flex-direction:column}
.sheet-foot.col>.btn{flex:none}
.steps{flex:none;display:flex;gap:4px;padding:10px 20px;background:var(--surface);border-bottom:1px solid var(--line);font-size:12.5px;color:var(--muted)}
.steps span{flex:1;text-align:center;padding:5px 0;border-radius:6px}
.steps span.on{background:var(--wine-soft);color:var(--wine-2);font-weight:600}

/* filters */
.fgroup{margin-bottom:22px}
.fgroup h3{font-size:13px;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);margin:0 0 10px;font-weight:600}
.frow{display:flex;gap:10px;align-items:center}
.frow input{flex:1;min-width:0;height:42px;border:1px solid var(--line);border-radius:var(--r-sm);padding:0 12px;background:var(--surface)}
.fchips{display:flex;flex-wrap:wrap;gap:7px}
.fchips .chip{padding:6px 12px;font-size:14px}
.switch{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;font-weight:500;cursor:pointer}
.switch input{appearance:none;width:44px;height:26px;border-radius:999px;background:#d8cfd1;position:relative;transition:background .15s;cursor:pointer;flex:none}
.switch input::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:left .15s;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.switch input:checked{background:var(--wine)}
.switch input:checked::after{left:21px}

/* product modal */
.pm{display:grid;grid-template-columns:1fr 1fr;min-height:420px}
.pm-ph{background:linear-gradient(180deg,#fafbf8,#edf0e9);display:grid;place-items:center;position:relative;min-height:320px}
.pm-ph img{max-height:520px;width:100%;object-fit:contain;padding:28px}
.pm-ph .noimg{width:28%;height:auto;opacity:.2;color:var(--wine);stroke-width:1.2}
.pm-info{padding:26px 26px 22px;display:flex;flex-direction:column;gap:12px;background:var(--surface)}
.pm-info h2{font-family:var(--serif);font-weight:700;font-size:26px;line-height:1.2;margin:0}
.pm-close{position:absolute;right:14px;top:14px;z-index:2}
.props{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;font-size:14px;margin:4px 0}
.props dt{color:var(--muted)}
.props dd{margin:0;font-weight:500}
.desc{white-space:pre-line;color:#463d40;font-size:14.5px;margin:0}
.pm-buy{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:auto;padding-top:14px;border-top:1px solid var(--line)}
.pm-buy .price{font-size:26px}
.barcode{border:1px dashed var(--line);border-radius:12px;padding:12px;text-align:center;background:#fff}
.barcode img{max-width:280px;width:100%}
.code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.5px}
.copy{border:0;background:var(--soft);border-radius:6px;font-size:12px;padding:2px 7px;margin-left:6px}

/* cart */
.citem{display:grid;grid-template-columns:56px 1fr auto;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}
.citem .thumb{width:56px;height:56px;border-radius:10px;background:#eef1ea;display:grid;place-items:center;overflow:hidden}
.citem .thumb img{width:100%;height:100%;object-fit:contain;padding:3px}
.citem .thumb svg{width:26px;height:26px;stroke-width:1.4;opacity:.3;color:var(--wine)}
.citem .nm{font-weight:600;font-size:14px;line-height:1.3}
.citem .sub{font-size:12.5px;color:var(--muted);margin-top:2px}
.citem .right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.citem .qty{height:34px}
.citem .qty button{width:30px}
.citem .qty input{width:42px}
.citem .lsum{font-weight:700;white-space:nowrap}
.citem.bad{opacity:.55}
.citem .warn{color:#b3261e;font-size:12.5px;font-weight:500}
.rm{border:0;background:none;color:var(--muted);font-size:12.5px;padding:0;text-decoration:underline}
.totals{display:flex;flex-direction:column;gap:4px;font-size:14px}
.totals .t-row{display:flex;justify-content:space-between}
.totals .grand{font-size:20px;font-weight:700}
.min-warn{background:#fff6e6;color:#6d4a12;border-radius:8px;padding:8px 10px;font-size:13.5px}
.cart-empty{text-align:center;padding:50px 10px;color:var(--muted)}
.cart-empty .big{font-size:46px}
.cart-tools{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px;font-size:13.5px}

/* form */
.form{display:flex;flex-direction:column;gap:14px}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:13.5px;font-weight:600}
.field label i{font-style:normal;color:#b3261e}
.field small{color:var(--muted);font-size:12.5px}
.field input,.field select,.field textarea{height:46px;border:1px solid var(--line);border-radius:var(--r-sm);padding:0 13px;background:var(--surface);outline:0;transition:border-color .15s,box-shadow .15s;width:100%}
.field textarea{height:auto;min-height:74px;padding:10px 13px;resize:vertical}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--focus);box-shadow:0 0 0 4px var(--wine-soft)}
.field.err input,.field.err select{border-color:#d0574a;box-shadow:0 0 0 3px #fbe4e1}
.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.dates{display:flex;flex-wrap:wrap;gap:8px}
.date{border:1px solid var(--line);background:var(--surface);border-radius:12px;padding:8px 12px;text-align:left;min-width:96px;transition:all .15s}
.date b{display:block;font-size:15px}
.date span{font-size:12px;color:var(--muted)}
.date.on{border-color:var(--wine);background:var(--wine-soft);box-shadow:inset 0 0 0 1px var(--wine)}
.date.on span{color:var(--wine-2)}
.hint{background:var(--soft);border-radius:10px;padding:10px 12px;font-size:13px;color:#5b5254}
.hint.warn{background:#fff6e6;color:#6d4a12}
.summary-line{display:flex;justify-content:space-between;font-size:14px;padding:4px 0}
.error-box{background:#fdecea;color:#8a2a1c;border-radius:10px;padding:10px 12px;font-size:14px}

/* success */
.done{text-align:center;padding:24px 6px}
.done .ok{width:74px;height:74px;border-radius:50%;background:#e7f4ec;color:var(--ok);display:grid;place-items:center;margin:0 auto 14px;animation:pop2 .4s}
.done .ok svg{width:38px;height:38px;stroke-width:2.4}
@keyframes pop2{from{transform:scale(.5);opacity:0}}
.done h3{font-family:var(--serif);font-size:26px;margin:0 0 6px}
.done .num{font-size:15px;color:var(--muted)}
.done-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px;margin:18px 0;text-align:left}

/* history */
.hitem{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 14px;margin-bottom:10px}
.hitem .hrow{display:flex;justify-content:space-between;align-items:center;gap:10px}
.hitem .st{font-size:12px;font-weight:600;padding:3px 8px;border-radius:999px;background:var(--soft)}
.st.new{background:#e9f0fb;color:#2b5797}.st.accepted{background:#e7f4ec;color:var(--ok)}.st.shipped{background:#efe9f8;color:#5b3c99}.st.canceled{background:#fdecea;color:#8a2a1c}
.hitem .hact{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}

/* mobile bar */
.mbar{position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:25;display:none;align-items:center;gap:10px;border:0;border-radius:16px;background:var(--ink);color:#fff;padding:13px 16px;box-shadow:0 14px 30px -10px rgba(0,0,0,.5);font-size:14px;text-align:left}
.mbar-sum{margin-left:auto;font-weight:700;font-size:16px}
.mbar-go{background:var(--wine);padding:7px 11px;border-radius:10px;font-weight:600}

.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,30px);background:var(--ink);color:#fff;padding:11px 18px;border-radius:12px;font-size:14px;opacity:0;pointer-events:none;transition:all .25s;z-index:80;max-width:calc(100% - 32px);text-align:center}
.toast.show{opacity:1;transform:translate(-50%,0)}

.foot{border-top:1px solid var(--line);padding:22px 0 90px;font-size:13.5px}
.foot-in{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.foot b{font-family:var(--serif);font-size:16px;color:var(--wine-2);margin-right:10px}

@media (max-width:900px){
  .hero-in{grid-template-columns:1fr}
  .pm{grid-template-columns:1fr}
  .pm-ph{min-height:260px}
  .pm-ph img{max-height:320px}
}
@media (max-width:720px){
  .wrap{padding:0 14px}
  .top-in{flex-wrap:wrap;height:auto;padding:10px 0;gap:10px}
  .search{order:3;flex-basis:100%;max-width:none;height:42px}
  .brand-mark{width:36px;height:36px}
  .brand-text b{font-size:19px}
  .icon-btn{margin-left:auto;padding:0 12px}
  .hide-sm{display:none}
  .cats-bar{top:118px}
  .how{gap:6px}.how li{font-size:13px;padding:4px 10px 4px 4px}.how b{width:20px;height:20px;font-size:11px}
  .ship-map b{font-size:13px}
  .hero{padding:18px 0 8px}
  .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .cb{padding:10px 10px 12px}
  .cname{font-size:14px}
  .price{font-size:17px}
  .cfoot{flex-direction:column;align-items:stretch}
  .ctrl{align-items:stretch}
  .add{justify-content:center}
  .qty{justify-content:space-between}
  .qty input{flex:1}
  .mbar{display:flex}
  .tools .tool span.lbl{display:none}
  .grid.list .card{padding:8px 10px;gap:10px}
  .grid.list .ph{width:54px;height:54px}
  .grid.list .cb{flex-direction:column;align-items:stretch;gap:6px}
  .grid.list .cfoot{flex-direction:row;align-items:center;justify-content:space-between}
  .grid.list .ctrl{flex-direction:row;align-items:center}
  .two{grid-template-columns:1fr}
  .sheet-panel.modal{top:auto;bottom:0;left:0;transform:none;width:100%;max-height:92%;border-radius:20px 20px 0 0;animation:up .25s cubic-bezier(.2,.8,.2,1)}
  @keyframes up{from{transform:translateY(40px);opacity:.4}}
  .pm-info{padding:18px}
  .pm-info h2{font-size:22px}
  .toolbar{margin-top:8px}
  .found{flex-basis:100%;order:2}
  .tools{flex:1}
  .tools select{flex:1;min-width:0}
}
@media (max-width:380px){ .grid{gap:8px} .add span{display:none} }
@media (max-width:720px){
  .toast{bottom:calc(88px + env(safe-area-inset-bottom))}
  .grid.list .boxprice{display:none}
  .grid.list .boxbtn{font-size:11.5px;padding:3px 6px}
}

/* --- упрощённая корзина --- */
.btn.big{height:58px;font-size:18px;border-radius:16px}
.cmt-toggle{background:none;border:0;color:var(--wine);font-weight:600;padding:10px 0;text-decoration:underline;text-underline-offset:3px}
.cmt{width:100%;min-height:70px;border:1px solid var(--line);border-radius:12px;padding:10px 12px;resize:vertical;background:#fff}
.done .num-big{font-family:var(--serif);font-weight:700;font-size:34px;color:var(--wine-2);margin:4px 0}
.done-items{margin:14px 0 0;padding:0;list-style:none;text-align:left;font-size:14.5px}
.done-items li{display:flex;justify-content:space-between;gap:10px;padding:7px 0;border-bottom:1px dashed var(--line)}
.done-items li span:last-child{white-space:nowrap;font-weight:600}
.done-total{display:flex;justify-content:space-between;font-size:19px;font-weight:700;padding-top:10px}
.hero-ship{display:flex;align-items:center;gap:8px}
@media (max-width:720px){.toast{top:calc(14px + env(safe-area-inset-top));bottom:auto;transform:translate(-50%,-30px)}.toast.show{transform:translate(-50%,0)}}
.agent{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}
.agent div{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:7px 13px;font-size:14.5px;line-height:1.25}
.agent span{display:block;font-size:11.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.4px}
.agent b{font-weight:600;color:var(--wine-2)}
.agent a{color:inherit;text-decoration:none}

/* ====== v9: боковые категории, литражи, адаптив ====== */
.layout{display:grid;grid-template-columns:236px minmax(0,1fr);gap:26px;align-items:start;padding-top:8px;padding-bottom:40px}
.catside{position:sticky;top:84px;max-height:calc(100vh - 100px);overflow:auto;scrollbar-width:thin}
.side-in{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:12px}
.side-title{font-family:var(--serif);font-weight:700;font-size:17px;padding:4px 8px 10px;color:var(--wine-2)}
.catlist{display:flex;flex-direction:column;gap:2px}
.catitem{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;text-align:left;border:0;background:none;border-radius:10px;padding:9px 10px;font-weight:500;font-size:15px;color:var(--ink);transition:background .12s}
.catitem small{color:var(--muted);font-size:12.5px;background:var(--soft);border-radius:999px;padding:1px 8px;min-width:26px;text-align:center}
.catitem:hover:not(:disabled){background:var(--soft)}
.catitem.on,.catitem.on:hover:not(:disabled){background:var(--wine);color:#fff}
.catitem.on small{background:rgba(255,255,255,.2);color:#fff}
.catitem:disabled{opacity:.4;cursor:default}
.catlist.big .catitem{font-size:17px;padding:14px 12px;border-bottom:1px solid var(--soft);border-radius:12px}
.main-col{min-width:0}
.toolbar{display:flex;align-items:center;gap:8px;margin:0 0 10px;flex-wrap:nowrap;justify-content:flex-start}
.toolbar .tool{height:42px}
.toolbar select.tool{margin-left:auto}
.cat-btn{display:none}
.sub-bar{display:flex;align-items:baseline;gap:12px;margin:2px 0 8px}
.cur-cat{font-family:var(--serif);font-weight:700;font-size:24px;margin:0;color:var(--wine-2)}
.sub-bar .found{color:var(--muted);font-size:14px}
.grid{margin-top:6px}
.grid-head{grid-column:1/-1;margin:16px 0 0;font-family:var(--serif);font-weight:700;font-size:19px;color:var(--wine-2);cursor:pointer;display:flex;align-items:center;gap:10px}
.grid-head::after{content:"";flex:1;height:1px;background:var(--line)}
.grid-head:first-child{margin-top:0}
.grid.list .grid-head{padding:12px 14px 6px;margin:0;font-size:16px;background:var(--soft)}
.more{grid-column:1/-1;text-align:center;padding:16px}
.card.incart{border-color:#b8c7b2;box-shadow:0 0 0 1px #b8c7b2}
.vars{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.var{position:relative;border:1px solid var(--line);background:#fff;border-radius:999px;padding:5px 10px;font-size:13px;font-weight:600;color:var(--ink);line-height:1.1;transition:all .12s}
.var:hover{border-color:var(--focus)}
.var.on{background:var(--wine);border-color:var(--wine);color:#fff}
.var.out{opacity:.5;text-decoration:line-through}
.var i{position:absolute;top:-7px;right:-6px;background:var(--gold);color:#fff;font-style:normal;font-size:10.5px;min-width:17px;height:17px;border-radius:999px;display:grid;place-items:center;padding:0 4px;border:2px solid #fff}
.boxrow{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.shop-box{margin-top:14px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:6px}
.shop-box label{font-weight:700;font-size:15px}
.shop-box label i{color:#b3261e;font-style:normal}
.shop-box input{height:50px;border:1px solid var(--line);border-radius:12px;padding:0 14px;font-size:16px;background:#fff;outline:0}
.shop-box input:focus{border-color:var(--focus);box-shadow:0 0 0 4px var(--wine-soft)}
.shop-box small{color:var(--muted);font-size:12.5px}
.shop-box.err input{border-color:#d0574a;box-shadow:0 0 0 3px #fbe4e1}
.cmid{min-width:0}
/* условия вывоза — раскрывающиеся */
details.ship-card summary{list-style:none;cursor:pointer}
details.ship-card summary::-webkit-details-marker{display:none}
.ship-more{display:flex;align-items:center;gap:2px;font-size:13px;font-weight:600;color:var(--wine)}
.ship-more svg{width:16px;height:16px;transition:transform .2s}
details.ship-card[open] .ship-more svg{transform:rotate(180deg)}
details.ship-card[open] .ship-head{margin-bottom:2px}
/* карточка товара */
.pm{position:relative}
.pm-ctrl{margin-left:auto}
details.bc summary{list-style:none;display:inline-flex;cursor:pointer}
details.bc summary::-webkit-details-marker{display:none}
details.bc[open] summary{display:none}
/* боковая шторка категорий */
.sheet-panel.side-left{top:0;left:0;bottom:0;width:min(340px,88%);animation:slideL .25s cubic-bezier(.2,.8,.2,1)}
@keyframes slideL{from{transform:translateX(-30px);opacity:.4}}

@media (max-width:1199px){
  .layout{grid-template-columns:206px minmax(0,1fr);gap:18px}
  .grid{grid-template-columns:repeat(auto-fill,minmax(196px,1fr))}
}
@media (max-width:899px){
  .layout{grid-template-columns:1fr;gap:0}
  .catside{display:none}
  .cat-btn{display:flex;flex:1;min-width:0;justify-content:flex-start;font-weight:600;background:var(--wine);color:#fff;border-color:var(--wine)}
  .cat-btn .cat-btn-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;text-align:left}
  .cat-btn .chev{width:18px;height:18px}
  .toolbar{position:sticky;top:68px;z-index:20;background:var(--bg);padding:8px 0;margin:0}
  .toolbar select.tool{margin-left:0;max-width:170px}
  .grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
  .hero-in{grid-template-columns:1fr;gap:14px}
}
@media (max-width:720px){
  .toolbar{top:116px}
  .toolbar .lbl{display:none}
  .toolbar select.tool{max-width:132px;padding:0 6px;font-size:14px}
  .cur-cat{font-size:20px}
  .hero{padding:14px 0 6px}
  .hero h1{font-size:24px;margin:2px 0 6px}
  .hero-text>p{font-size:14px}
  .how{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-top:12px;padding-bottom:2px}
  .how::-webkit-scrollbar{display:none}
  .how li{flex:none}
  .agent{gap:6px;margin-bottom:10px}
  .agent div{padding:5px 10px;font-size:13px}
  .ship-card{padding:12px 14px}
  .ship-head>svg{width:34px;height:34px;padding:7px}
  .ship-date{font-size:16px}
  .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .grid-head{font-size:17px;margin-top:10px}
  .var{padding:5px 8px;font-size:12px}
  .cfoot{flex-direction:column;align-items:stretch;gap:8px}
  .ctrl{align-items:stretch}
  .boxrow{justify-content:space-between}
  .pm-buy{flex-direction:column;align-items:stretch}
  .pm-ctrl{margin-left:0}
  .pm-ctrl .add{width:100%;justify-content:center;height:52px;font-size:16px}
  .citem{grid-template-columns:48px 1fr;gap:10px}
  .citem .thumb{width:48px;height:48px}
  .citem .right{grid-column:1/-1;flex-direction:row;justify-content:space-between;align-items:center}
  .citem .right .ctrl{flex-direction:row;align-items:center;gap:8px}
  .sheet-panel.side.wide{width:100%}
}
@media (max-width:380px){
  .grid{gap:8px}
  .cb{padding:9px 9px 11px}
  .cname{font-size:14.5px}
  .toolbar select.tool{max-width:108px}
}
@media (min-width:900px) and (max-width:1100px){ .how li{font-size:13px} }
@media (max-width:720px){
  .toolbar{flex-wrap:wrap;row-gap:8px}
  .cat-btn{flex:1 1 100%;height:46px!important;font-size:16px}
  .toolbar select.tool{flex:1;max-width:none}
  .toolbar .lbl{display:inline}
  .sub-bar{flex-wrap:wrap;gap:4px 10px}
}
@media (max-width:380px){ .toolbar .lbl{display:none} }
/* фото в карточке товара: жёсткие рамки, чтобы не вылезало (iOS Safari) */
.pm-ph{position:relative;overflow:hidden;min-height:440px}
.pm-ph img{position:absolute;inset:0;width:100%;height:100%;max-height:none;object-fit:contain;padding:28px;mix-blend-mode:multiply}
.ph{overflow:hidden}
.ph img{mix-blend-mode:multiply}
.pm-info h2{overflow-wrap:anywhere}
@media (max-width:900px){
  .pm-ph{min-height:0;height:min(40vh,320px)}
  .pm-ph img{padding:18px}
}
/* карточки: фото всегда целиком внутри квадрата (узкие/высокие фото в Safari) */
.ph{position:relative}
.ph img{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:contain;padding:14px}
.grid.list .ph img{padding:4px}
.citem .thumb{position:relative}
.citem .thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;padding:3px;mix-blend-mode:multiply}
