/* ============================================================
   طراحی: «سبزِ ریحان + آرد + سس گوجه»
   پالت: سبز شب #12261B | پنل #1B3526 | آرد #F4EFE3 | گوجه #E5472B | طلایی روغن زیتون #D9B04A
   فونت: Fraunces (عنوان‌ها) + Figtree (متن)
   تنها عنصر پررنگ صفحه: کارت «Compose your…» به رنگ سس گوجه
   ============================================================ */
:root{--bg:#12261B;--panel:#1B3526;--panel2:#25432F;--line:#35604A;--flour:#F4EFE3;--dim:#A9BCAE;--tomato:#E5472B;--gold:#D9B04A}
*{box-sizing:border-box;margin:0}
html{scroll-behavior:smooth}
body{background:var(--bg);color:var(--flour);font:400 16px/1.5 'Figtree',system-ui,sans-serif;-webkit-tap-highlight-color:transparent}
h1,h2,h3{font-family:'Fraunces',Georgia,serif;font-weight:700;letter-spacing:-.01em}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
:focus-visible{outline:3px solid var(--gold);outline-offset:2px}

/* هدر */
.top{display:flex;justify-content:space-between;align-items:center;padding:18px 20px 6px;max-width:900px;margin:auto}
.brand{font-size:1.75rem}
.top-r{display:flex;gap:10px;align-items:center}
.badge{padding:6px 12px;border-radius:999px;background:var(--panel2);color:var(--gold);font-weight:700;font-size:.9rem}
.cart-btn{padding:10px 16px;border-radius:999px;background:var(--flour);color:var(--bg);font-weight:700}
.cart-btn b{display:inline-grid;place-items:center;min-width:22px;height:22px;margin-left:6px;border-radius:11px;background:var(--tomato);color:#fff;font-size:.8rem}

/* تب‌های دسته‌بندی */
.tabs{position:sticky;top:0;z-index:5;display:flex;gap:8px;overflow-x:auto;padding:12px 20px;background:var(--bg);scrollbar-width:none;max-width:900px;margin:auto}
.tabs::-webkit-scrollbar{display:none}
.tab{padding:10px 20px;border-radius:999px;border:1px solid var(--line);color:var(--dim);white-space:nowrap;font-weight:500}
.tab[aria-selected=true]{background:var(--gold);border-color:var(--gold);color:#2a2008;font-weight:700}

/* شبکه‌ی محصولات */
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;padding:8px 20px 120px;max-width:900px;margin:auto}
.grid h2{grid-column:1/-1;font-size:1.6rem;margin-top:6px}
@media(min-width:720px){.grid{grid-template-columns:repeat(3,1fr)}}
.card{background:var(--panel);border-radius:22px;padding:12px;display:flex;flex-direction:column;gap:6px}
.ph{aspect-ratio:1;border-radius:14px;background:var(--panel2);display:grid;place-items:center;overflow:hidden}
.ph img{width:100%;height:100%;object-fit:cover}
.mono{font:700 3rem 'Fraunces',serif;color:var(--line)}
.card h3{font-size:1.15rem;line-height:1.2;margin-top:4px}
.card p{color:var(--dim);font-size:.9rem;flex:1}
.row{display:flex;justify-content:space-between;align-items:center;margin-top:4px}
.price{font-weight:700;color:var(--gold)}
.add{width:44px;height:44px;border-radius:50%;background:var(--tomato);color:#fff;font-size:1.6rem;line-height:1}
.add:active{transform:scale(.92)}
/* کارت سازنده: عنصر اصلی طراحی */
.card.builder{grid-column:1/-1;flex-direction:row;align-items:center;gap:16px;background:var(--tomato);padding:18px 20px;border-radius:26px}
.card.builder h3{font-size:1.6rem}
.card.builder p{color:#ffe3dc;flex:none;margin:4px 0 8px}
.card.builder .price{color:#fff}
.card.builder .ph{width:84px;flex:none;background:#c93a20}
.card.builder .mono{color:#ffb7a8;font-size:2.4rem}
.card.builder .go{margin-left:auto;padding:10px 18px;border-radius:999px;background:var(--flour);color:#7a1d0c;font-weight:700}

/* نوار پایین و دیالوگ‌ها */
dialog{border:0;color:var(--flour);background:var(--bg)}
dialog::backdrop{background:rgba(5,14,9,.7)}
.sheet{width:min(560px,100%);max-height:88vh;margin:auto auto 0;border-radius:26px 26px 0 0;padding:20px;overflow:auto}
@media(min-width:720px){.sheet{margin:auto;border-radius:26px}}
.sheet-h{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.x{color:var(--dim);padding:8px}
.line{display:flex;gap:12px;align-items:flex-start;padding:12px 0;border-bottom:1px solid var(--line)}
.line .nm{flex:1}.line small{display:block;color:var(--dim)}
.qty{display:flex;align-items:center;gap:10px;margin-top:6px}
.qty button{width:32px;height:32px;border-radius:50%;background:var(--panel2);font-size:1.1rem}
.empty{color:var(--dim);padding:20px 0}
.note{display:block;margin:14px 0;color:var(--dim);font-size:.9rem}
.note textarea{width:100%;margin-top:6px;padding:10px 12px;border-radius:14px;border:1px solid var(--line);background:var(--panel);color:var(--flour);font:inherit}
.err{color:#ff9d8a;min-height:1.4em;font-size:.9rem}
.cta{width:100%;display:flex;justify-content:space-between;padding:16px 22px;border-radius:999px;background:var(--tomato);color:#fff;font-weight:700;font-size:1.05rem}
.cta:disabled{background:var(--panel2);color:var(--dim);cursor:not-allowed}
.done{text-align:center;padding:30px 0}.done h2{font-size:1.8rem;margin-bottom:8px}

/* سازنده (تمام‌صفحه) */
.full{width:100%;max-width:560px;height:100%;max-height:100%;margin:auto;padding:16px 20px 20px;overflow:auto}
.full[open]{display:flex;flex-direction:column}
.bhead{display:flex;justify-content:space-between;align-items:center}
.bhead button{padding:8px 4px;color:var(--dim)}
.full h2{font-size:2rem;line-height:1.1;margin:10px 0}
.opts{display:flex;gap:4px;padding:4px;border-radius:999px;border:1px solid var(--line);width:max-content;margin-bottom:8px}
.opts button{padding:8px 20px;border-radius:999px;font-weight:700;color:var(--dim)}
.opts button[aria-pressed=true]{background:var(--flour);color:var(--bg)}
.stage{position:relative;width:100%;max-width:340px;aspect-ratio:1;margin:6px auto;flex:none}
.hint{text-align:center;color:var(--dim);font-size:.9rem;margin:2px 0 10px}
.ings{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:16px}
.ing{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:.78rem;text-align:center}
.ing-img{position:relative;width:100%;aspect-ratio:1;border-radius:50%;background:var(--panel);border:2px solid var(--line);display:grid;place-items:center;overflow:hidden;transition:border-color .15s}
.ing-img img{width:68%;height:68%;object-fit:contain}
.ing[aria-pressed=true] .ing-img{border-color:var(--tomato);background:var(--panel2)}
.ing[aria-pressed=true] .ing-img::after{content:'✓';position:absolute;top:2px;right:2px;width:20px;height:20px;border-radius:50%;background:var(--tomato);color:#fff;font-size:.7rem;display:grid;place-items:center}
.ing small{color:var(--dim)}
.chip{display:block;width:60%;aspect-ratio:1;border-radius:50%;box-shadow:inset 0 -3px 0 rgba(0,0,0,.2)}
.full .cta{margin-top:auto;position:sticky;bottom:0}

/* پیتزا */
.dough{position:absolute;inset:4%;border-radius:50%;background:radial-gradient(circle,#d9402a 0 52%,#b83320 62%,#e9c88b 63% 82%,#d6a45e 100%);box-shadow:0 20px 40px rgba(0,0,0,.45);transition:transform .35s}
.dough img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.pieces{position:absolute;inset:0}
.piece{position:absolute;width:17%;aspect-ratio:1;transform:translate(-50%,-50%) rotate(var(--r));animation:drop .5s cubic-bezier(.2,.9,.3,1.25) both}
.piece img,.piece .chip{width:100%;height:100%;object-fit:contain}
.piece.out{animation:none;opacity:0;transition:opacity .2s}
@keyframes drop{from{transform:translate(-50%,-190%) rotate(var(--r)) scale(1.6);opacity:0}to{transform:translate(-50%,-50%) rotate(var(--r)) scale(1);opacity:1}}

/* برگر: لایه‌ها روی هم چیده می‌شوند */
.stack{height:320px;max-width:340px}
.stack>*{position:absolute;left:50%;transform:translateX(-50%);transition:bottom .35s cubic-bezier(.2,.9,.3,1.2),opacity .25s}
.slate{bottom:0;width:92%;height:34px;border-radius:50%;background:#2c2f2d;box-shadow:0 14px 26px rgba(0,0,0,.5)}
.bun-bottom{bottom:22px;width:64%;height:28px;border-radius:6px 6px 22px 22px;background:linear-gradient(#e0a24c,#c07a2a)}
.bun-top{width:64%;height:50px;border-radius:50% 50% 14px 14px/100% 100% 14px 14px;background:radial-gradient(circle at 25% 30%,#f3dcae 0 2px,transparent 3px) 0 0/22px 18px,linear-gradient(#e0a24c,#b9691f)}
.layer{width:62%;height:24px;display:grid;place-items:center}
.layer img{height:34px;max-width:100%;object-fit:contain}
.layer .chip{width:100%;height:100%;border-radius:12px}

/* پیام کوتاه */
.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,120px);background:var(--flour);color:var(--bg);padding:12px 22px;border-radius:999px;font-weight:700;transition:transform .3s;z-index:50}
.toast.show{transform:translate(-50%,0)}
@media(prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}
