:root { --red:#162619; --ink:#101828; --gray:#6b7280; --line:#e5e7eb; --chip:#efefef; }
* { box-sizing:border-box; margin:0; padding:0; }
body { font-family:"Montserrat","Helvetica Neue",Arial,sans-serif; font-weight:400; color:var(--ink); background:#ddd; }
.app { max-width:430px; margin:0 auto; min-height:100vh; background:#fff; position:relative; }

header { background:var(--red); color:#fff; display:flex; align-items:center; justify-content:space-between; padding:14px 16px; height:76px; }
.brand { font-size:18px; font-weight:700; letter-spacing:.3px; }
.burger { background:none; border:0; width:32px; height:24px; cursor:pointer; display:flex; flex-direction:column; justify-content:space-between; }
.burger span { display:block; height:2px; background:#fff; }

main { padding:16px; }
.banner { height:170px; border-radius:22px; overflow:hidden; background:linear-gradient(135deg,#1f3d2b,#3d6b46); }
.banner img { width:100%; height:100%; object-fit:cover; object-position:center 30%; }

.search { margin-top:20px; background:var(--chip); width:100%; height:48px; border-radius:24px; font-size:17px; display:flex; align-items:center; justify-content:center; gap:10px; }
.search input { border:0; background:none; font:inherit; outline:none; width:140px; }

.tabs { display:flex; gap:26px; overflow-x:auto; margin:22px -16px 0; padding:0 16px; border-bottom:1px solid var(--line); scrollbar-width:none; }
.tabs::-webkit-scrollbar { display:none; }
.tab { background:none; border:0; font:inherit; font-size:15px; font-weight:500; color:var(--gray); padding:12px 0; white-space:nowrap; cursor:pointer; border-bottom:3px solid transparent; }
.tab.active { color:var(--ink); border-bottom-color:var(--red); }

.subtabs { display:none; gap:14px; margin:14px 0 0; padding:0; }
.subtabs.show { display:flex; }
.subtab { background:var(--chip); border:0; font:inherit; font-size:13px; font-weight:500; color:var(--gray); padding:8px 14px; border-radius:20px; cursor:pointer; white-space:nowrap; }
.subtab.active { background:var(--red); color:#fff; }

h1 { font-size:26px; font-weight:500; margin:24px 0 14px; }
.grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; padding-bottom:90px; }

.pic { position:relative; aspect-ratio:3/4; border-radius:18px; overflow:hidden; background:#f5f5f5; display:grid; place-items:center; }
.pic img { width:100%; height:100%; object-fit:contain; }

/* Круглые кнопки плюс */
.plus {
  position:absolute; bottom:10px;
  height:40px; min-width:40px; padding:0 12px; border-radius:20px;
  border:0; background:#fff; color:var(--red);
  font-family:"Montserrat",sans-serif; font-size:13px; font-weight:700;
  box-shadow:0 2px 8px rgba(0,0,0,.15); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.plus.right { right:10px; }
.plus.left  { right:58px; }

/* Капсула минусов/плюсов после добавления */
.qty {
  display:flex; align-items:center; justify-content:center; gap:3px;
  background:#fff; border-radius:22px; padding:4px 6px; margin-top:8px;
  box-shadow:0 2px 8px rgba(0,0,0,.08); border:1px solid var(--line);
  font-family:"Montserrat",sans-serif; font-weight:600; font-size:11px;
}
.qty button {
  border:0; background:none;
  font-family:"Montserrat",sans-serif; font-size:11px; font-weight:600;
  padding:4px 5px; cursor:pointer; color:var(--ink);
}
.qty span { min-width:38px; text-align:center; font-size:11px; font-weight:600; }

.price { font-size:19px; font-weight:600; margin-top:10px; }
.price small { font-size:13px; color:var(--gray); font-weight:600; }
.name { font-size:15px; font-weight:600; }
.desc { color:var(--gray); font-size:13px; font-weight:300; line-height:1.3; }
.empty { grid-column:1/-1; color:var(--gray); padding:20px 0; }

.fab { position:fixed; bottom:24px; right:max(16px,calc(50% - 215px + 16px)); width:56px; height:56px; border-radius:50%; border:0; background:var(--red); color:#fff; display:grid; place-items:center; cursor:pointer; box-shadow:0 4px 14px rgba(22,38,25,.4); z-index:5; }
.badge { position:absolute; top:-4px; right:-4px; min-width:20px; height:20px; border-radius:10px; background:#fff; color:var(--red); font-size:12px; font-weight:800; display:none; place-items:center; padding:0 5px; box-shadow:0 1px 4px rgba(0,0,0,.2); }
.fab.has .badge { display:grid; }

.overlay { position:fixed; top:0; bottom:0; left:max(0px,calc(50% - 215px)); right:max(0px,calc(50% - 215px)); background:rgba(0,0,0,.45); opacity:0; pointer-events:none; transition:opacity .25s; z-index:10; }
body.open .overlay, body.cartopen .overlay, body.detailopen .overlay { opacity:1; pointer-events:auto; }

.drawer { position:fixed; top:0; right:max(0px,calc(50% - 215px)); bottom:0; width:min(88%,380px); background:#fff; border-radius:28px 0 0 28px; transform:translateX(100%); transition:transform .25s; z-index:11; padding:24px 20px; overflow-y:auto; }
body.open .drawer { transform:none; }
.drawer-head { display:flex; justify-content:space-between; align-items:center; padding-bottom:16px; border-bottom:1px solid var(--line); }
.drawer-head h2 { font-size:34px; }
.close { background:none; border:0; font-size:30px; cursor:pointer; }
.drawer a { display:flex; align-items:center; gap:18px; padding:18px 0 18px 8px; border-bottom:1px solid var(--line); color:var(--ink); text-decoration:none; font-size:19px; }
.drawer a.plain { border-bottom:0; padding:14px 0 14px 8px; }
.ico { width:28px; text-align:center; color:#9ca3af; font-size:22px; }
.addr { color:var(--gray); font-size:14px; padding:6px 8px; }

.cart { position:fixed; bottom:0; left:max(0px,calc(50% - 215px)); right:max(0px,calc(50% - 215px)); max-height:75vh; background:#fff; border-radius:28px 28px 0 0; padding:22px 20px; transform:translateY(100%); transition:transform .25s; z-index:11; overflow-y:auto; }
body.cartopen .cart { transform:none; }
.cart h2 { font-size:28px; margin-bottom:12px; }
.row { display:block; padding:12px 0; border-bottom:1px solid var(--line); font-size:17px; }
.rtop { display:flex; justify-content:space-between; gap:10px; font-weight:600; }
.rctl { display:flex; align-items:center; gap:8px; margin-top:10px; flex-wrap:wrap; }
.rctl button { min-width:38px; height:36px; padding:0 10px; border-radius:18px; border:1.5px solid var(--line); background:#fff; font-size:13px; font-weight:600; cursor:pointer; }
.rctl .q { min-width:76px; text-align:center; font-weight:600; font-size:15px; }
.rctl .rdel { margin-left:auto; font-size:16px; border-color:#f0c8c8; }
.total { display:flex; justify-content:space-between; font-size:22px; font-weight:800; margin:16px 0; }
.order { width:100%; height:50px; border:0; border-radius:25px; background:var(--red); color:#fff; font:inherit; font-size:18px; font-weight:700; cursor:pointer; }

.script { font-family:"Mrs Saint Delafield","Snell Roundhand","Brush Script MT",cursive; font-style:normal; font-weight:400; }
.brand { display:flex; flex-direction:column; align-items:center; line-height:1; }
.brand .script { font-size:22px; margin-bottom:-2px; }
.brand b { font-size:20px; font-weight:300; letter-spacing:7px; margin-right:-7px; }
.card .pic, .card .name { cursor:pointer; }

.sheet { position:fixed; bottom:0; left:max(0px,calc(50% - 215px)); right:max(0px,calc(50% - 215px)); max-height:90vh; overflow-y:auto; background:#fff; border-radius:28px 28px 0 0; padding:20px 22px 28px; transform:translateY(100%); transition:transform .25s; z-index:12; }
body.detailopen .sheet { transform:none; }
.sheet-top { display:flex; justify-content:flex-end; }
.sheet .script { font-size:44px; line-height:1; margin:0 0 14px; }
.chips { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:18px; }
.chip { background:#efefef; padding:10px 12px; font-size:12px; font-weight:400; line-height:1.4; flex:1 1 45%; color:#555; }
.story p { font-size:14.5px; font-weight:400; line-height:1.65; margin-bottom:14px; color:#222; }
.story p:first-child { font-weight:600; }
.sheet .order { margin-top:10px; }

html { -webkit-text-size-adjust:100%; }
body { -webkit-tap-highlight-color:transparent; }
button, .card .pic, .card .name { touch-action:manipulation; -webkit-appearance:none; appearance:none; }
.app { min-height:100vh; min-height:100dvh; }
header { height:auto; min-height:76px; padding-top:calc(14px + min(env(safe-area-inset-top,0px), 20px)); }
.fab { bottom:calc(24px + min(env(safe-area-inset-bottom,0px), 20px)); }
.cart, .sheet { max-height:85vh; max-height:85dvh; padding-bottom:calc(24px + env(safe-area-inset-bottom,0px)); overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
.drawer { overscroll-behavior:contain; -webkit-overflow-scrolling:touch; padding-bottom:calc(24px + env(safe-area-inset-bottom,0px)); }
body.open, body.cartopen, body.detailopen { overflow:hidden; }
.search input { min-width:0; font-size:16px; }

@media (max-width:360px){
  .grid { gap:10px; }
  .qty { padding:3px 4px; }
  .qty button { font-size:10px; padding:3px 3px; }
  .qty span { min-width:32px; font-size:10px; }
  .plus { height:36px; min-width:36px; padding:0 10px; font-size:12px; }
  .plus.left { right:52px; }
}

@media (hover:hover){ .tab:hover { color:var(--ink); } .plus:hover, .qty button:hover { filter:brightness(.9); } .order:hover { filter:brightness(1.07); } }

@media (min-width:800px){
  body { background:#f3f3f3; }
  .app { max-width:1100px; box-shadow:0 0 40px rgba(0,0,0,.08); }
  header { padding-left:32px; padding-right:32px; }
  main { padding:28px 32px; }
  .banner { height:260px; }
  .search { max-width:520px; margin-left:auto; margin-right:auto; }
  .tabs { margin-left:-32px; margin-right:-32px; padding:0 32px; gap:40px; }
  .grid { grid-template-columns:repeat(4,1fr); gap:24px; }
  .overlay { left:0; right:0; }
  .drawer { right:0; width:400px; }
  .cart, .sheet { left:50%; right:auto; width:560px; transform:translate(-50%,100%); border-radius:28px 28px 0 0; }
  body.cartopen .cart, body.detailopen .sheet { transform:translate(-50%,0); }
  .fab { right:max(24px, calc(50% - 550px + 24px)); }
  .card { cursor:pointer; }
}
@media (min-width:1200px){ .grid { gap:28px; } }

.hl { display:flex; gap:4px; }
.hl button { flex:none; width:38px; height:32px; border-radius:16px; border:1.5px solid rgba(255,255,255,.55); background:transparent; color:#fff; font:inherit; font-size:12px; font-weight:600; cursor:pointer; }
.hl button.on { background:#fff; color:var(--red); border-color:#fff; }
@media (max-width:340px){ .hl button { width:34px; } .brand b { letter-spacing:5px; margin-right:-5px; } }
