:root {
    --blush: #fde6e1;
    --blush-soft: #fff8f6;
    --chocolate: #2f1b16;
    --muted: #7a625d;
    --coral: #ff5a4f;
    --coral-dark: #e84d43;
    --line: #ead4cf;
    --white: #ffffff;
    --shadow: 0 10px 28px rgba(47, 27, 22, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--blush);
    color: var(--chocolate);
    font-family: "DM Sans", Inter, Arial, sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    width: min(100%, 920px);
    margin: 0 auto;
    min-height: 100vh;
    background: rgba(255, 248, 246, 0.78);
    box-shadow: 0 20px 70px rgba(47, 27, 22, 0.06);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px clamp(16px, 4vw, 28px);
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    margin: 0 0 2px;
    color: var(--coral);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

h1,
h2 {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    line-height: 1.05;
}

h1 {
    font-size: clamp(26px, 5.4vw, 44px);
    letter-spacing: -0.02em;
}

h2 {
    font-size: 26px;
}

.cart-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--blush-soft);
    color: var(--chocolate);
    padding: 7px 9px 7px 13px;
    font-size: 14px;
    box-shadow: var(--shadow);
}

.cart-button strong {
    display: grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: var(--coral);
    color: var(--white);
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.status-link,
.signout-button {
    border: 0;
    background: transparent;
    color: var(--chocolate);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    padding: 8px 5px;
}

.signout-button {
    color: var(--muted);
}

.collection-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px clamp(16px, 4vw, 28px);
    background: #fff2d8;
    border-bottom: 1px solid #ead4a7;
    color: var(--chocolate);
}

.collection-banner div {
    display: grid;
    gap: 2px;
}

.collection-banner span {
    color: var(--muted);
    font-size: 12px;
}

.collection-banner .collection-badge {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 6px 9px;
    background: var(--chocolate);
    color: var(--white);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
}

.controls {
    position: sticky;
    top: 93px;
    z-index: 15;
    padding: 10px clamp(16px, 4vw, 28px);
    background: rgba(255, 248, 246, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.search-wrap {
    display: block;
    margin-bottom: 12px;
}

.search-wrap span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.search-wrap input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 16px;
    background: var(--white);
    color: var(--chocolate);
    font-size: 14px;
    box-shadow: 0 3px 12px rgba(47, 27, 22, 0.04);
}

.tabs-wrap {
    position: relative;
}

.tabs-wrap::before,
.tabs-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 4px;
    z-index: 1;
    width: 24px;
    pointer-events: none;
}

.tabs-wrap::before {
    left: 0;
    background: linear-gradient(90deg, rgba(255, 248, 246, 0.98), rgba(255, 248, 246, 0));
}

.tabs-wrap::after {
    right: 0;
    background: linear-gradient(270deg, rgba(255, 248, 246, 0.98), rgba(255, 248, 246, 0));
}

.tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 4px 4px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--chocolate);
    padding: 8px 13px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.tab.active {
    border-color: var(--coral);
    background: var(--coral);
    color: var(--white);
}

.menu-list {
    display: grid;
    gap: 12px;
    padding: 22px clamp(16px, 4vw, 28px) 120px;
}

.menu-card {
    display: grid;
    grid-template-columns: 82px 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 78px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 5px 16px rgba(47, 27, 22, 0.06);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.menu-card:hover {
    transform: none;
    box-shadow: 0 8px 18px rgba(47, 27, 22, 0.08);
}

.thumb {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border: 1px solid #f0dfda;
    border-radius: 7px;
    background: #fff;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1 / 1;
}

.thumb img {
    width: auto;
    height: auto;
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.thumb.retail img {
    border-radius: 6px;
    transform: none;
    box-shadow: none;
    object-fit: contain;
    padding: 0;
}

.thumb.real-product {
    background: #fff;
    padding: 0;
}

.thumb.real-product img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center;
}

.thumb.real-product .retail-label {
    display: none;
}

.thumb.real-product.image-failed .retail-label {
    display: flex;
}

.thumb.food img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
}

.thumb.retail {
    color: #fff;
    padding: 0;
}

.retail-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 5px;
    border-radius: 6px;
    color: inherit;
    text-align: center;
    font-size: 9px;
    line-height: 1.12;
    font-weight: 900;
    background: rgba(255,255,255,0.04);
}

.tile-blue { background: #0878c9; }
.tile-orange { background: #f97316; }
.tile-green { background: #84cc16; }
.tile-yellow { background: #facc15; color: #2f1b16; }
.tile-red { background: #dc2626; }
.tile-brown { background: #92400e; }
.tile-water { background: #7dd3fc; color: #2f1b16; }
.tile-dark { background: #111827; }
.tile-neutral { background: #7a625d; }

.item-title {
    margin: 0;
    font-family: "DM Sans", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0;
}

.price {
    margin: 4px 0 0;
    color: var(--coral);
    font-weight: 800;
    font-size: 13px;
}

.quantity-control,
.add-button {
    justify-self: end;
}

.add-button,
.qty-button,
.checkout-button,
.copy-button,
.icon-button {
    border: 0;
}

.add-button,
.qty-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 999px;
    background: var(--coral);
    color: var(--white);
    font-size: 22px;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(255, 90, 79, 0.28);
    transition: transform 0.14s ease, background 0.14s ease;
}

.add-button:hover,
.qty-button:hover {
    background: var(--coral-dark);
    transform: translateY(-1px);
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--blush-soft);
}

.quantity-control span {
    min-width: 24px;
    text-align: center;
    font-weight: 800;
}

.qty-button {
    width: 34px;
    height: 34px;
    font-size: 20px;
}

.cart-panel {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cart-panel.open {
    pointer-events: auto;
    opacity: 1;
}

.cart-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(47, 27, 22, 0.42);
}

.cart-drawer {
    position: absolute;
    inset: 0 0 0 auto;
    display: flex;
    flex-direction: column;
    width: min(100%, 430px);
    background: var(--blush-soft);
    box-shadow: -18px 0 35px rgba(47, 27, 22, 0.18);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.icon-button {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: var(--blush-soft);
    color: var(--chocolate);
    font-size: 20px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 16px;
}

.empty-cart {
    margin: 42px 0;
    color: var(--muted);
    text-align: center;
}

.cart-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.cart-line h3 {
    margin: 0;
    font-size: 15px;
}

.cart-line p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.line-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    grid-column: 1 / -1;
}

.line-actions button {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--blush-soft);
    color: var(--chocolate);
    width: 30px;
    height: 30px;
}

.line-actions .remove {
    margin-left: auto;
    width: auto;
    padding: 0 12px;
    color: #b42318;
}

.checkout {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-top: 1px solid var(--line);
    background: var(--white);
    max-height: 58vh;
    overflow-y: auto;
}

.total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
}

.total-row strong {
    color: var(--chocolate);
}

.total-row.grand {
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: var(--chocolate);
    font-size: 18px;
}

.total-row.grand strong {
    color: var(--coral);
}

.checkout label {
    display: grid;
    gap: 5px;
    color: var(--chocolate);
    font-size: 13px;
    font-weight: 700;
}

.checkout input,
.checkout select,
.checkout textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    background: var(--blush-soft);
    color: var(--chocolate);
}

.collection-note {
    display: grid;
    gap: 3px;
    padding: 11px 12px;
    border: 1px solid #ead4a7;
    border-radius: 8px;
    background: #fff8e9;
    color: var(--chocolate);
    font-size: 13px;
}

.collection-note span {
    color: var(--muted);
    font-size: 12px;
}

.checkout-button,
.copy-button {
    min-height: 46px;
    border-radius: 999px;
    font-weight: 800;
}

.checkout-button {
    background: var(--coral);
    color: var(--white);
}

.checkout-button:disabled {
    cursor: wait;
    opacity: .7;
}

.checkout-message {
    min-height: 18px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.checkout-message.success {
    color: #176b3a;
}

.checkout-message.error {
    color: #b42318;
}

.copy-button {
    background: var(--blush-soft);
    color: var(--chocolate);
    border: 1px solid var(--line);
}

@media (max-width: 620px) {
    .app-shell {
        width: 100%;
    }

    .topbar {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        padding-top: 11px;
        padding-bottom: 11px;
    }

    .topbar-actions {
        width: 100%;
        max-width: none;
        justify-content: flex-start;
        gap: 2px 8px;
    }

    .status-link,
    .signout-button {
        font-size: 12px;
        padding: 4px 3px;
    }

    .topbar-actions .cart-button {
        margin-left: auto;
    }

    .collection-banner {
        align-items: flex-start;
    }

    .collection-banner .collection-badge {
        margin-top: 2px;
    }

    .controls {
        top: 0;
    }

    .menu-card {
        grid-template-columns: 76px 1fr auto;
        min-height: 92px;
        gap: 11px;
        padding: 9px 11px;
    }

    .thumb {
        width: 76px;
        height: 76px;
        flex: 0 0 76px;
    }

    .item-title {
        font-size: 13px;
    }

    .add-button {
        width: 36px;
        height: 36px;
    }

    .price {
        font-size: 13px;
    }

    .eyebrow {
        font-size: 13px;
    }

    h1 {
        font-size: 30px;
    }

    .tab {
        font-size: 10.5px;
        padding: 8px 12px;
    }
}

@media (min-width: 980px) {
    body {
        background:
            linear-gradient(90deg, rgba(253, 230, 225, 0.85), rgba(255, 248, 246, 0.55)),
            var(--blush);
    }

    .app-shell {
        width: min(100%, 1160px);
        margin: 0 auto;
    }

    .topbar {
        padding: 20px 34px;
    }

    .controls {
        top: 99px;
        padding: 14px 34px;
    }

    .menu-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        padding: 24px 34px 130px;
    }

    .menu-card {
        grid-template-columns: 86px 1fr auto;
        min-height: 104px;
        padding: 11px 12px;
    }

    .item-title {
        font-size: 13.5px;
    }

    .price {
        font-size: 13px;
    }

    .add-button {
        width: 36px;
        height: 36px;
        font-size: 21px;
    }
}
