/* TabaShop — мини-приложение. Главная деталь: карточка товара как бумажный ценник с полки. */
@font-face{font-family:"Unbounded";src:url(fonts/unbounded-cyr.woff2) format("woff2");font-weight:200 900;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;font-display:swap}
@font-face{font-family:"Unbounded";src:url(fonts/unbounded-lat.woff2) format("woff2");font-weight:200 900;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;font-display:swap}
@font-face{font-family:"Onest";src:url(fonts/onest-cyr.woff2) format("woff2");font-weight:100 900;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;font-display:swap}
@font-face{font-family:"Onest";src:url(fonts/onest-lat.woff2) format("woff2");font-weight:100 900;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;font-display:swap}

:root{
  --frost:#EEF1F6; --midnight:#12162B;
  --bg:var(--frost); --ink:var(--midnight); --muted:#5B6280; --line:#D5DAE8; --surface:#FFFFFF; --field:#E3E8F2;
  --tag:#FFFFFF; --tag-ink:var(--midnight);
  --cobalt:#3D5AFE; --on-cobalt:#FFFFFF; --berry:#E5386D; --mint:#16A085;
  --h0:#FFB400; --h0i:#12162B; --h1:#E5386D; --h1i:#fff; --h2:#19B394; --h2i:#0B1E1A; --h3:#7A4DDB; --h3i:#fff;
  --h4:#3BA7FF; --h4i:#0A1B2E; --h5:#8A4B2A; --h5i:#fff; --h6:#FF7A59; --h6i:#2A0F07; --h7:#8BC53F; --h7i:#13200A;
  --display:"Unbounded","Onest",system-ui,sans-serif; --text:"Onest",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --tabs-h:62px; --gutter:16px;
}
[data-theme=dark]{
  --bg:var(--midnight); --ink:#EEF1F6; --muted:#9AA3C4; --line:#2B3152; --surface:#1B2040; --field:#232949;
  --tag:#F7F8FC; --tag-ink:var(--midnight);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{background:var(--bg)}
body{margin:0;background:var(--bg);color:var(--ink);font:400 15px/1.4 var(--text);-webkit-font-smoothing:antialiased;overscroll-behavior-y:none}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none;padding:0}
a{color:var(--cobalt)}
img{display:block;max-width:100%}
:focus-visible{outline:2px solid var(--cobalt);outline-offset:2px}
.hide{display:none!important}

#app{max-width:600px;margin:0 auto;padding:0 var(--gutter) calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom));min-height:100vh}
.screen{padding-top:calc(12px + env(safe-area-inset-top))}
h1,h2,h3{margin:0;font-family:var(--display);font-weight:700;letter-spacing:0;line-height:1.15}
h1{font-size:24px}h2{font-size:18px}h3{font-size:15px}
.muted{color:var(--muted)}.small{font-size:13px}
.row{display:flex;align-items:center;gap:10px}.between{justify-content:space-between}.grow{flex:1;min-width:0}
.stack>*+*{margin-top:12px}

/* шапка и поиск */
.top{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.back{width:40px;height:40px;border-radius:50%;background:var(--surface);color:var(--ink);display:grid;place-items:center;flex:none}
.back svg{width:20px;height:20px}
.brand{font-family:var(--display);font-weight:800;font-size:20px;letter-spacing:-.02em}
.search{display:flex;align-items:center;gap:8px;background:var(--field);border-radius:999px;padding:0 14px;height:44px}
.search svg{width:18px;height:18px;flex:none;color:var(--muted)}
.search input{flex:1;min-width:0;background:none;border:0;outline:0;height:100%}
.search input::placeholder{color:var(--muted)}

/* плитки разделов */
.tiles{display:grid;grid-template-columns:repeat(var(--cols,2),1fr);gap:10px;margin-top:16px}
.tile{position:relative;overflow:hidden;border-radius:20px;padding:14px;min-height:118px;text-align:left;display:flex;flex-direction:column;justify-content:space-between;background:var(--hue);color:var(--hue-ink)}
.tile .glyph{position:absolute;right:-6px;bottom:-12px;font-size:64px;line-height:1;opacity:.92;pointer-events:none;filter:saturate(1.1)}
.tile h3{font-size:clamp(13px,3.6vw,16px);max-width:78%;position:relative}
.tile .n{font-size:12px;font-weight:600;opacity:.8;position:relative}
.tiles[style*="3"] .tile{min-height:104px;padding:11px}.tiles[style*="3"] .tile .glyph{font-size:48px}
.tiles[style*="3"] .tile h3{font-size:12px;max-width:100%}
.hue0{--hue:var(--h0);--hue-ink:var(--h0i)}.hue1{--hue:var(--h1);--hue-ink:var(--h1i)}.hue2{--hue:var(--h2);--hue-ink:var(--h2i)}
.hue3{--hue:var(--h3);--hue-ink:var(--h3i)}.hue4{--hue:var(--h4);--hue-ink:var(--h4i)}.hue5{--hue:var(--h5);--hue-ink:var(--h5i)}
.hue6{--hue:var(--h6);--hue-ink:var(--h6i)}.hue7{--hue:var(--h7);--hue-ink:var(--h7i)}
.note{background:var(--surface);border-radius:16px;padding:12px 14px;margin-top:16px;font-size:13px;color:var(--muted)}
.note b{color:var(--ink)}

/* чипы брендов */
.chips{display:flex;gap:8px;overflow-x:auto;margin:0 calc(var(--gutter)*-1) 14px;padding:2px var(--gutter);scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;border-radius:999px;padding:8px 14px;background:var(--surface);font-weight:600;font-size:13px;white-space:nowrap;border:1.5px solid transparent}
.chip[aria-pressed=true]{background:var(--ink);color:var(--bg)}
.chip.sm{padding:6px 12px}

/* ценник — главная деталь */
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px 12px}
.tag{position:relative;background:var(--tag);color:var(--tag-ink);border-radius:8px 8px 16px 16px;text-align:left;display:flex;flex-direction:column;overflow:hidden;
  clip-path:polygon(0 0,calc(100% - 20px) 0,100% 20px,100% 100%,0 100%)}
.tag .ph{aspect-ratio:1/.92;background:var(--hue,#C9D0E6);color:var(--hue-ink,#12162B);display:grid;place-items:center;position:relative;overflow:hidden}
.tag .ph img{width:100%;height:100%;object-fit:cover}
.tag .ph .mono{font-family:var(--display);font-weight:800;font-size:30px;opacity:.9;padding:8px;text-align:center;word-break:break-word;line-height:1}
.tag::before{content:"";position:absolute;left:10px;top:10px;width:11px;height:11px;border-radius:50%;background:var(--bg);box-shadow:inset 0 1px 2px rgba(0,0,0,.25);z-index:2}
.tag .body{padding:10px 12px 12px;display:flex;flex-direction:column;gap:8px;flex:1;border-top:2px dashed color-mix(in srgb,var(--tag-ink) 18%,transparent)}
.tag .nm{font-size:13.5px;font-weight:600;line-height:1.25;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;min-height:2.5em}
.tag .bt{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:auto}
.price{font-family:var(--display);font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:-.02em;font-size:17px;white-space:nowrap}
.price small{font-size:.62em;font-weight:700;margin-left:1px}
.plus{width:36px;height:36px;border-radius:50%;background:var(--cobalt);color:var(--on-cobalt);display:grid;place-items:center;flex:none}
.plus svg{width:18px;height:18px}
.mini{display:flex;align-items:center;background:var(--cobalt);color:var(--on-cobalt);border-radius:999px;height:36px}
.mini button{width:34px;height:36px;display:grid;place-items:center;font-size:18px;font-weight:700}
.mini span{min-width:18px;text-align:center;font-weight:700;font-variant-numeric:tabular-nums}
.stock-low{position:absolute;left:8px;bottom:8px;background:var(--berry);color:#fff;font-size:11px;font-weight:700;border-radius:999px;padding:3px 9px}
.emoji{font-family:"Noto Color Emoji","Apple Color Emoji","Segoe UI Emoji",sans-serif;line-height:1;filter:saturate(1.1)}
.tag .ph .emoji{font-size:58px}.hero .emoji{font-size:104px}.thumb .emoji{font-size:28px}

/* карточка товара */
.hero{position:relative;border-radius:22px;overflow:hidden;background:var(--hue,#C9D0E6);color:var(--hue-ink,#12162B);aspect-ratio:1/.8;display:grid;place-items:center;margin-bottom:16px}
.hero img{width:100%;height:100%;object-fit:cover}
.hero .mono{font-family:var(--display);font-weight:800;font-size:44px;padding:16px;text-align:center;line-height:1}
.hero .back{position:absolute;left:12px;top:12px}
.bigtag{display:inline-flex;align-items:baseline;gap:4px;background:var(--tag);color:var(--tag-ink);padding:8px 18px 8px 22px;border-radius:8px 8px 8px 8px;clip-path:polygon(14px 0,100% 0,100% 100%,14px 100%,0 50%);font-family:var(--display);font-weight:800;font-size:26px;font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.bigtag small{font-size:.55em}
.avail{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600}
.avail i{width:8px;height:8px;border-radius:50%;background:var(--mint)}.avail.low i{background:var(--berry)}.avail.low{color:var(--berry)}
.desc{white-space:pre-wrap;color:var(--ink);opacity:.9}
.bar{position:fixed;left:0;right:0;bottom:calc(var(--tabs-h) + env(safe-area-inset-bottom));padding:10px var(--gutter);background:linear-gradient(to top,var(--bg) 70%,transparent);z-index:20}
.bar .inner{max-width:600px;margin:0 auto;display:flex;gap:10px}

/* кнопки и поля */
.btn{height:48px;border-radius:14px;padding:0 20px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--surface)}
.btn.primary{background:var(--cobalt);color:var(--on-cobalt)}
.btn.danger{background:color-mix(in srgb,var(--berry) 14%,transparent);color:var(--berry)}
.btn svg{width:20px;height:20px}
.btn.full{width:100%}.btn.sm{height:38px;padding:0 14px;font-size:13px;border-radius:12px}
.btn[disabled]{opacity:.5;pointer-events:none}
.stepper{display:flex;align-items:center;background:var(--surface);border-radius:14px;height:48px;flex:none}
.stepper button{width:44px;height:48px;font-size:20px;font-weight:700}.stepper span{min-width:28px;text-align:center;font-weight:700;font-variant-numeric:tabular-nums}
.field{display:block}.field>span{display:block;font-size:13px;color:var(--muted);margin-bottom:6px;font-weight:600}
.field input,.field textarea,.field select{width:100%;background:var(--field);border:1.5px solid transparent;border-radius:14px;padding:12px 14px;outline:0}
.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--cobalt)}
.field textarea{min-height:96px;resize:vertical}
.field .err{color:var(--berry);font-size:13px;margin-top:6px}
.switch{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0}
.switch button{width:50px;height:30px;border-radius:999px;background:var(--field);position:relative;flex:none;transition:background .15s}
.switch button::after{content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .15s}
.switch button[aria-checked=true]{background:var(--mint)}.switch button[aria-checked=true]::after{transform:translateX(20px)}

/* списки */
.list{background:var(--surface);border-radius:18px;overflow:hidden}
.li{display:flex;align-items:center;gap:12px;padding:12px 14px}
.li+.li{border-top:1px solid var(--line)}
.thumb{width:54px;height:54px;border-radius:12px;background:var(--hue,#C9D0E6);color:var(--hue-ink,#12162B);flex:none;overflow:hidden;display:grid;place-items:center;font-family:var(--display);font-weight:800;font-size:15px}
.thumb img{width:100%;height:100%;object-fit:cover}
.li .t{font-weight:600;line-height:1.25}.li .p{font-family:var(--display);font-weight:700;font-size:14px;font-variant-numeric:tabular-nums}
.sum{display:flex;justify-content:space-between;align-items:baseline;margin:16px 2px 12px}
.sum b{font-family:var(--display);font-weight:800;font-size:24px;font-variant-numeric:tabular-nums}
.empty{text-align:center;padding:56px 12px;color:var(--muted)}
.empty h2{color:var(--ink);margin-bottom:8px}.empty .btn{margin-top:18px}
.pill{display:inline-block;border-radius:999px;padding:3px 10px;font-size:12px;font-weight:700;background:var(--field)}
.pill.new{background:color-mix(in srgb,var(--cobalt) 18%,transparent);color:var(--cobalt)}
.pill.ready{background:color-mix(in srgb,var(--mint) 20%,transparent);color:var(--mint)}
.pill.cancelled{background:color-mix(in srgb,var(--berry) 16%,transparent);color:var(--berry)}
.order{background:var(--surface);border-radius:18px;padding:14px}
.order+.order{margin-top:10px}.order ul{margin:10px 0;padding:0;list-style:none}.order li{display:flex;justify-content:space-between;gap:12px;padding:3px 0}
.order .acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.seg{display:flex;background:var(--field);border-radius:14px;padding:3px;margin-bottom:14px}
.seg button{flex:1;height:36px;border-radius:11px;font-weight:700;font-size:13px;color:var(--muted)}
.seg button[aria-selected=true]{background:var(--surface);color:var(--ink)}
.more{margin:16px 0}
.sec-row .sw{width:14px;height:44px;border-radius:6px;background:var(--hue);flex:none}
.sec-row.off{opacity:.55}
.icon-btn{width:38px;height:38px;border-radius:12px;background:var(--field);display:grid;place-items:center;flex:none}
.icon-btn svg{width:18px;height:18px}
.photo-edit{display:flex;gap:14px;align-items:center}
.photo-edit .thumb{width:96px;height:96px;border-radius:16px;font-size:22px}
.stat{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.stat div{background:var(--surface);border-radius:16px;padding:12px 14px}.stat b{display:block;font-family:var(--display);font-size:20px;font-variant-numeric:tabular-nums}
.skeleton{height:200px;border-radius:18px;background:linear-gradient(90deg,var(--field),var(--surface),var(--field));background-size:200% 100%;animation:sk 1.2s linear infinite}
@keyframes sk{to{background-position:-200% 0}}

/* нижняя панель */
#tabs{position:fixed;left:0;right:0;bottom:0;z-index:30;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
#tabs .in{max-width:600px;margin:0 auto;display:flex;height:var(--tabs-h)}
#tabs button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11px;font-weight:600;color:var(--muted);position:relative}
#tabs button[aria-current=page]{color:var(--cobalt)}
#tabs svg{width:24px;height:24px}
#tabs .badge{position:absolute;top:7px;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--berry);color:#fff;font-size:11px;font-weight:700;display:grid;place-items:center}
#toast{position:fixed;left:50%;bottom:calc(var(--tabs-h) + 78px + env(safe-area-inset-bottom));transform:translate(-50%,20px);background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:12px;font-weight:600;font-size:14px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:50;max-width:calc(100vw - 32px);text-align:center}
#toast.show{opacity:1;transform:translate(-50%,0)}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
@media (min-width:480px){.grid{grid-template-columns:repeat(3,1fr)}}
