/* ===== The Golden Glaze — Order page · 3-column list · black-glossy + orange ===== */
:root {
    --accent: #ff7a2f;
    --accent-2: #ff9a55;
    --accent-soft: rgba(255, 122, 47, 0.14);
    --bg: #08080a;
    --surface: #131316;
    --surface-2: #1b1b20;
    --line: rgba(255, 255, 255, 0.08);
    --text: #f3f3f5;
    --muted: #9a9aa4;
    --radius: 14px;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    --header-h: 4.4rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Poppins", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
img { display: block; }

/* ---------- Header ---------- */
.order-header {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1rem, 3vw, 2rem);
    background: rgba(8, 8, 10, 0.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.order-brand__logo { height: 3rem; width: auto; }
.order-link { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.order-link:hover { color: var(--text); }

/* ---------- Shell ---------- */
.shop {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 340px;
    gap: 1.4rem;
    max-width: 1320px;
    margin: 0 auto;
    padding: 1.4rem clamp(1rem, 3vw, 2rem) 4rem;
    align-items: start;
}

/* ---------- Categories ---------- */
.cats {
    position: sticky;
    top: calc(var(--header-h) + 1.4rem);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-height: calc(100vh - var(--header-h) - 2.8rem);
    overflow-y: auto;
    scrollbar-width: thin;
}
.cat-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.92rem;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: all 0.15s;
}
.cat-link:hover { color: var(--text); background: var(--surface); }
.cat-link.is--active { color: var(--accent); background: var(--accent-soft); border-color: rgba(255, 122, 47, 0.35); font-weight: 600; }
.cat-link__ico { font-size: 1.05rem; }

/* ---------- Menu (middle) ---------- */
.menu__search {
    position: relative;
    margin-bottom: 1.2rem;
}
.menu__search-ico { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); opacity: 0.6; font-size: 0.9rem; }
.menu__search input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 999px;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font: inherit;
    font-size: 0.95rem;
}
.menu__search input:focus { outline: none; border-color: var(--accent); }

.cat-section { margin-bottom: 2rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.cat-section__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cat-section__title small { color: var(--muted); font-weight: 400; font-size: 0.95rem; }

/* product rows */
.prow {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: 0.7rem;
    transition: border-color 0.15s, transform 0.15s;
}
.prow:hover { border-color: rgba(255, 122, 47, 0.4); }
.prow__thumb {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--surface-2);
}
.prow__ph {
    width: 64px; height: 64px; flex: 0 0 64px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
    background: radial-gradient(60px 40px at 50% 30%, rgba(255, 122, 47, 0.18), transparent 70%), linear-gradient(160deg, #1d1d22, #121215);
}
.prow__main { flex: 1; min-width: 0; }
.prow__name { font-weight: 600; font-size: 0.98rem; }
.prow__desc { color: var(--muted); font-size: 0.8rem; line-height: 1.35; margin-top: 0.1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prow__price { color: var(--accent); font-weight: 700; white-space: nowrap; }
.prow__price small { color: var(--muted); font-weight: 400; font-size: 0.7rem; }
.prow__add {
    width: 2.1rem; height: 2.1rem; flex: 0 0 2.1rem; border-radius: 50%;
    border: 1px solid rgba(255, 122, 47, 0.5); background: var(--accent-soft); color: var(--accent);
    font-size: 1.3rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.prow__add:hover { background: var(--accent); color: #160a02; }
.catalog-loading { color: var(--muted); padding: 3rem 0; text-align: center; }
.no-results { color: var(--muted); padding: 2rem 0; text-align: center; }

/* ---------- Order summary (right) ---------- */
.summary {
    position: sticky;
    top: calc(var(--header-h) + 1.4rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--header-h) - 2.8rem);
}
.summary__head { display: flex; align-items: center; justify-content: space-between; }
.summary__title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.summary__close { display: none; background: none; border: none; color: var(--muted); font-size: 1.6rem; cursor: pointer; }
.summary__sub { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 1.1rem 0 0.6rem; }

.seg { display: flex; gap: 0.5rem; margin-top: 1rem; }
.seg button {
    flex: 1; padding: 0.65rem; border-radius: 10px; border: 1px solid var(--line);
    background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; font-size: 0.9rem;
}
.seg button.is--active { background: var(--accent); color: #160a02; border-color: var(--accent); font-weight: 700; }

.cart__lines { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 0.7rem; min-height: 2rem; }
.cart__empty { color: var(--muted); text-align: center; padding: 1.5rem 0; font-size: 0.9rem; }
.cart-line { display: flex; gap: 0.6rem; align-items: flex-start; }
.cart-line__main { flex: 1; min-width: 0; }
.cart-line__name { font-weight: 600; font-size: 0.9rem; }
.cart-line__opts { color: var(--muted); font-size: 0.74rem; }
.cart-line__price { color: var(--accent); font-size: 0.83rem; margin-top: 0.1rem; font-weight: 600; }
.qty { display: flex; align-items: center; gap: 0.35rem; }
.qty button { width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; line-height: 1; }
.qty button:hover { border-color: var(--accent); color: var(--accent); }
.qty span { min-width: 1.1rem; text-align: center; font-size: 0.88rem; }
.cart__totals { border-top: 1px solid var(--line); margin-top: 0.8rem; padding-top: 0.8rem; display: flex; flex-direction: column; gap: 0.35rem; }
.cart__row { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--muted); }
.cart__row--grand { color: var(--text); font-weight: 800; font-size: 1.1rem; }
.cart__checkout {
    margin-top: 0.9rem; background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #160a02;
    border: none; padding: 0.8rem; border-radius: 999px; font-weight: 800; cursor: pointer; font-size: 1rem;
    box-shadow: 0 8px 22px rgba(255, 122, 47, 0.3);
}
.cart__checkout:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* ---------- Mobile basket bar ---------- */
.basket-bar {
    position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 45;
    display: none; align-items: center; justify-content: space-between;
    background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #160a02;
    border: none; border-radius: 14px; padding: 0.85rem 1.1rem; font: inherit; font-weight: 700;
    box-shadow: 0 10px 30px rgba(255, 122, 47, 0.4); cursor: pointer;
}
.summary-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 49; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(2px); }
.modal__panel { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; padding: 1.4rem; box-shadow: var(--shadow); }
.modal__title { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.3rem; }
.modal__close { position: absolute; top: 0.8rem; right: 1rem; background: none; border: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; }
.product__desc { color: var(--muted); font-size: 0.85rem; }
.opt-group { margin-top: 1.1rem; }
.opt-group__name { font-weight: 600; margin-bottom: 0.5rem; }
.opt-group__hint { color: var(--muted); font-size: 0.78rem; font-weight: 400; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 0.45rem; cursor: pointer; }
.opt:hover { border-color: var(--accent); }
.opt input { accent-color: var(--accent); }
.opt__label { display: flex; align-items: center; gap: 0.6rem; }
.opt__delta { color: var(--muted); font-size: 0.85rem; }
.field { margin-top: 0.95rem; }
.field label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.3rem; }
.field input, .field textarea { width: 100%; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 0.65rem 0.75rem; font: inherit; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.modal__cta { width: 100%; margin-top: 1.3rem; background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #160a02; border: none; padding: 0.85rem; border-radius: 999px; font-weight: 800; font-size: 1rem; cursor: pointer; }
.modal__cta:disabled { opacity: 0.5; cursor: not-allowed; }
.modal__err { color: #ff8a8a; font-size: 0.85rem; margin-top: 0.6rem; }
.pay-note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem; font-size: 0.85rem; color: var(--muted); margin-top: 1rem; white-space: pre-wrap; }
.confirm { text-align: center; }
.confirm__check { font-size: 3rem; }
.confirm__num { color: var(--accent); font-weight: 800; font-size: 1.3rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
    .shop { grid-template-columns: 190px minmax(0, 1fr); }
    .summary {
        position: fixed; top: 0; right: 0; height: 100%; width: 360px; max-width: 92vw;
        max-height: none; z-index: 60; border-radius: 0; border-left: 1px solid var(--line);
        box-shadow: -20px 0 60px rgba(0,0,0,0.5); transform: translateX(105%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    }
    .summary.is--open { transform: translateX(0); }
    .summary__close { display: block; }
    .basket-bar { display: flex; }
    body { padding-bottom: 5rem; }
}
@media (max-width: 680px) {
    .shop { grid-template-columns: 1fr; padding-top: 0.8rem; }
    .cats {
        position: sticky; top: var(--header-h); z-index: 25;
        flex-direction: row; max-height: none; overflow-x: auto; padding: 0.6rem 0;
        background: var(--bg); gap: 0.5rem; margin: -0.4rem -1rem 0.6rem; padding-inline: 1rem;
    }
    .cat-link { border: 1px solid var(--line); padding: 0.45rem 0.85rem; }
    .menu__search { margin-top: 0.4rem; }
}
