:root {
    --bg: #f7f7f8;
    --panel: #ffffff;
    --card: #ffffff;
    --soft: #f2f4f7;
    --line: #e4e7ec;
    --text: #1d2939;
    --muted: #667085;
    --brand: #ea1d2c;
    --brand-dark: #b42318;
    --accent: #ff8a00;
    --green: #039855;
    --shadow: 0 12px 28px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    margin: 0;
}
body.cart-open {
    overflow: hidden;
}
button, input, select, textarea { font: inherit; }
button, a { cursor: pointer; }

.public-alert {
    background: #fff1f0;
    border: 1px solid #fecdca;
    border-radius: 8px;
    color: var(--brand-dark);
    left: 14px;
    padding: 12px 14px;
    position: fixed;
    right: 14px;
    top: 14px;
    z-index: 20;
}

.public-hero {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    max-width: 100%;
    overflow: hidden;
}
.public-hero nav {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1180px;
    padding: 14px 16px;
}
.nav-logo {
    align-items: center;
    color: var(--brand);
    display: inline-flex;
    gap: 10px;
    text-decoration: none;
}
.nav-logo img {
    border-radius: 8px;
    height: 38px;
    object-fit: cover;
    width: 38px;
}
.public-hero nav strong { color: var(--brand); font-size: 20px; }
.store-card {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 70px 1fr;
    margin: 0 auto;
    max-width: 1180px;
    padding: 18px 16px 22px;
}
.store-logo {
    align-items: center;
    background: var(--soft);
    border-radius: 8px;
    display: flex;
    height: 70px;
    justify-content: center;
    overflow: hidden;
    width: 70px;
}
.store-logo img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}
.store-card p {
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    margin: 0 0 4px;
    text-transform: uppercase;
}
.store-card h1 {
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1;
    margin: 0 0 8px;
}
.store-card span { color: var(--muted); }
.store-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.store-meta strong, .store-meta span {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    padding: 6px 9px;
}
.store-meta strong {
    background: #ecfdf3;
    border-color: #abefc6;
    color: var(--green);
}

.cart-toggle, .cart-close, .menu-card button, .confirm-btn, .continue-btn, .success-card a {
    background: var(--brand);
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-weight: 900;
    min-height: 46px;
    padding: 0 15px;
    text-decoration: none;
}
.cart-toggle {
    align-items: center;
    bottom: 14px;
    box-shadow: 0 12px 26px rgba(234, 29, 44, .3);
    display: flex;
    gap: 10px;
    justify-content: center;
    left: 14px;
    position: fixed;
    right: 14px;
    z-index: 8;
}
.cart-toggle strong {
    border-left: 1px solid rgba(255, 255, 255, .38);
    padding-left: 10px;
}
.cart-toggle em {
    background: #fff;
    border-radius: 999px;
    color: var(--brand);
    display: inline-flex;
    font-style: normal;
    margin-left: 6px;
    min-width: 24px;
    padding: 3px 7px;
}
.cart-close {
    background: var(--soft);
    border: 1px solid var(--line);
    color: var(--text);
}

.menu-layout {
    display: grid;
    gap: 16px;
    margin: 0 auto;
    max-width: 1180px;
    padding: 14px 14px 108px;
}
.menu-content {
    min-width: 0;
    width: 100%;
}
.order-flow {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    margin-bottom: 12px;
}
.order-flow span {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    padding: 10px 12px;
}
.category-tabs {
    background: rgba(247, 247, 248, .96);
    display: flex;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 5;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs a {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    flex: 0 0 auto;
    font-weight: 900;
    padding: 10px 14px;
    text-decoration: none;
}
.category-tabs a:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.menu-category { margin-top: 16px; }
.category-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.category-head h2 { font-size: 22px; margin: 0; }
.category-head span { color: var(--muted); font-size: 13px; font-weight: 800; }
.menu-list {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}
.menu-card {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 96px;
    padding: 14px;
    min-width: 0;
}
.menu-card:last-child { border-bottom: 0; }
.menu-info { min-width: 0; }
.menu-card h3 { font-size: 17px; margin: 0 0 6px; }
.menu-card p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.42;
    margin: 0 0 12px;
}
.menu-price-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}
.menu-card strong { color: var(--text); font-size: 18px; }
.menu-card button {
    background: #fff1f0;
    color: var(--brand);
    min-height: 38px;
    padding: 0 12px;
}
.menu-photo {
    align-items: center;
    aspect-ratio: 1 / 1;
    background: var(--soft);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    overflow: hidden;
    width: 96px;
}
.menu-photo img { height: 100%; object-fit: cover; width: 100%; }
.menu-photo span { color: var(--brand); font-size: 42px; font-weight: 900; }

.cart-panel {
    background: rgba(16, 24, 40, .36);
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity .18s ease;
    z-index: 10;
    max-width: 100vw;
    overflow: hidden;
}
.cart-panel.open { opacity: 1; pointer-events: auto; }
.cart-panel form {
    background: var(--panel);
    border-radius: 16px 16px 0 0;
    bottom: 0;
    display: grid;
    gap: 14px;
    left: 0;
    max-height: 88vh;
    overflow: auto;
    padding: 16px;
    position: absolute;
    right: 0;
    width: 100%;
}
.sheet-handle {
    background: #d0d5dd;
    border-radius: 999px;
    height: 5px;
    justify-self: center;
    margin-top: -4px;
    width: 54px;
}
.cart-panel header {
    align-items: center;
    display: flex;
    justify-content: space-between;
}
.cart-panel h2 { margin: 2px 0 0; }
.step-label {
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}
.checkout-block, .checkout-fields {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    padding: 12px;
}
.checkout-next {
    display: grid;
    gap: 14px;
}
.checkout-next[hidden] {
    display: none;
}
.block-title {
    align-items: center;
    display: flex;
    gap: 10px;
}
.block-title span {
    align-items: center;
    background: var(--brand);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    height: 28px;
    justify-content: center;
    width: 28px;
}
.block-title h3 { margin: 0; }
.cart-items { display: grid; gap: 10px; }
.empty-cart, .muted { color: var(--muted); }
.cart-item {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 12px;
}
.cart-item header { gap: 10px; }
.cart-item strong { flex: 1; }
.qty-row {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
}
.qty-row button {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-weight: 900;
    min-height: 40px;
}
.remove-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--brand);
    font-weight: 900;
    min-height: 40px;
    width: 100%;
}

label {
    color: #475467;
    display: grid;
    gap: 7px;
    font-size: 13px;
    font-weight: 900;
}
input, select, textarea {
    background: #fff;
    border: 1px solid #cfd6e2;
    border-radius: 8px;
    color: var(--text);
    min-height: 46px;
    padding: 10px 12px;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(234, 29, 44, .12);
    outline: 0;
}
.delivery-box {
    display: grid;
    gap: 12px;
}
.cart-totals {
    border-top: 1px dashed var(--line);
    display: grid;
    gap: 12px;
    padding-top: 12px;
}
.cart-totals div {
    align-items: center;
    display: flex;
    justify-content: space-between;
}
.grand-total strong { color: var(--brand); font-size: 28px; }
.confirm-btn {
    bottom: 0;
    position: sticky;
    width: 100%;
}
.continue-btn {
    width: 100%;
}

.confirmation {
    align-items: center;
    background: var(--bg);
    display: flex;
    min-height: 100vh;
    padding: 18px;
}
.success-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 0 auto;
    max-width: 560px;
    padding: 28px;
    text-align: center;
    width: 100%;
}
.success-icon {
    align-items: center;
    background: #ecfdf3;
    border: 1px solid #abefc6;
    border-radius: 999px;
    color: #067647;
    display: inline-flex;
    font-weight: 900;
    height: 64px;
    justify-content: center;
    width: 64px;
}
.success-card h1 { font-size: 52px; margin: 8px 0 20px; }
.confirm-details {
    display: grid;
    gap: 10px;
    text-align: left;
}
.confirm-details div {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    padding: 12px;
}
.confirm-details span { color: var(--muted); }
.success-card a {
    align-items: center;
    display: inline-flex;
    margin-top: 18px;
}

@media (max-width: 430px) {
    .public-hero nav {
        padding: 10px 12px;
    }
    .nav-logo {
        gap: 8px;
    }
    .nav-logo img {
        height: 32px;
        width: 32px;
    }
    .public-hero nav strong {
        font-size: 17px;
    }
    .store-card {
        align-items: start;
        gap: 10px;
        grid-template-columns: 58px 1fr;
        padding: 12px 12px 14px;
    }
    .store-logo {
        font-size: 26px;
        height: 58px;
        width: 58px;
    }
    .store-card p {
        font-size: 11px;
    }
    .store-card h1 {
        font-size: 28px;
        margin-bottom: 6px;
    }
    .store-card span {
        font-size: 13px;
        line-height: 1.35;
    }
    .store-meta {
        gap: 6px;
        margin-top: 9px;
    }
    .store-meta strong, .store-meta span {
        font-size: 11px;
        padding: 5px 7px;
    }
    .menu-layout {
        padding: 10px 10px 92px;
    }
    .order-flow {
        display: none;
    }
    .category-tabs {
        margin-left: -10px;
        margin-right: -10px;
        padding: 8px 10px;
        top: 0;
    }
    .category-tabs a {
        font-size: 13px;
        padding: 9px 12px;
    }
    .menu-category {
        margin-top: 14px;
    }
    .category-head h2 {
        font-size: 20px;
    }
    .menu-card {
        gap: 10px;
        grid-template-columns: minmax(0, 1fr) 82px;
        padding: 12px;
        width: 100%;
    }
    .menu-card h3 {
        font-size: 16px;
    }
    .menu-card p {
        display: -webkit-box;
        font-size: 13px;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .menu-price-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
    .menu-card button {
        min-height: 36px;
        width: 100%;
    }
    .menu-photo {
        width: 82px;
    }
    .cart-toggle {
        bottom: 10px;
        left: 10px;
        min-height: 52px;
        right: 10px;
    }
    .cart-panel form {
        border-radius: 18px 18px 0 0;
        max-height: 92vh;
        padding: 14px 12px calc(16px + env(safe-area-inset-bottom));
    }
    .checkout-block, .checkout-fields {
        padding: 11px;
    }
    .cart-item {
        padding: 10px;
    }
}

@media (min-width: 431px) and (max-width: 1099px) {
    .public-hero nav {
        padding: 12px 14px;
    }
    .store-card {
        grid-template-columns: 64px 1fr;
        padding: 14px;
    }
    .store-logo {
        height: 64px;
        width: 64px;
    }
    .store-card h1 {
        font-size: 34px;
    }
    .menu-layout {
        padding: 12px 12px 98px;
    }
    .order-flow {
        display: none;
    }
    .category-tabs {
        margin-left: -12px;
        margin-right: -12px;
        padding: 8px 12px;
    }
    .menu-card {
        grid-template-columns: minmax(0, 1fr) 90px;
    }
    .menu-photo {
        width: 90px;
    }
    .cart-toggle {
        left: 12px;
        min-height: 52px;
        right: 12px;
    }
    .cart-panel form {
        max-height: 92vh;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        width: 100%;
    }
}

@media (min-width: 1100px) {
    .cart-close { display: inline-flex; }
    .menu-layout {
        align-items: start;
        grid-template-columns: minmax(0, 1fr);
        padding-bottom: 40px;
    }
    .cart-panel {
        background: rgba(16, 24, 40, .36);
        opacity: 0;
        pointer-events: none;
        position: fixed;
        top: 0;
    }
    .cart-panel.open { opacity: 1; pointer-events: auto; }
    .cart-panel form {
        border: 1px solid var(--line);
        border-radius: 8px;
        box-shadow: var(--shadow);
        max-height: calc(100vh - 32px);
        max-width: 480px;
        min-height: auto;
        position: absolute;
        right: 18px;
        top: 18px;
        bottom: auto;
        left: auto;
        width: 480px;
    }
}
