:root {
    --red: #A31D24;
    --cream: #F4EAE0;
    --yellow: #FFD13B;
    --dark: #2A1A1A;
    --text: #702626;
    --surface: #FFFFFF;
    --cart-bar-height: 120px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    background-color: var(--cream);
    color: var(--red);
    padding-bottom: calc(var(--cart-bar-height) + 16px);
}

body.no-scroll {
    overflow: hidden;
}

button,
input,
select {
    font: inherit;
}

.checkerboard {
    height: 20px;
    background-image:
        linear-gradient(45deg, var(--red) 25%, transparent 25%),
        linear-gradient(-45deg, var(--red) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--red) 75%),
        linear-gradient(-45deg, transparent 75%, var(--red) 75%);
    background-size: 20px 20px;
    background-color: var(--cream);
}

header {
    padding: 14px 12px;
    border-bottom: 4px solid var(--red);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: clamp(56px, 14vw, 84px);
    height: auto;
    display: block;
}

header h1 {
    margin: 0;
    color: var(--red);
    text-transform: uppercase;
    font-weight: 900;
    font-size: 2.2rem;
    line-height: 1;
}

.subtitle {
    display: inline-block;
    margin-top: 6px;
    font-family: Arial, sans-serif;
    font-size: 0.95rem;
}

.container {
    width: min(100%, 720px);
    margin: 0 auto;
    padding: 12px;
}

h2 {
    background-color: var(--red);
    color: #ffffff;
    padding: 9px 12px;
    text-transform: uppercase;
    font-size: 1rem;
    margin: 20px 0 12px;
    display: inline-block;
}

.item-card {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--red);
    margin-bottom: 12px;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-img {
    width: 100%;
    min-height: 78px;
    background-image: url("burger_chester.jpeg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #eeeeee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-details h3 {
    margin: 0;
    color: var(--red);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.item-details p {
    font-family: Arial, sans-serif;
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 600;
    text-transform: lowercase;
    margin: 6px 0;
}


.options {
    font-family: Arial, sans-serif;
    font-size: 0.84rem;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
    background: #f9f9f9;
    padding: 8px;
    border-radius: 4px;
}

.price-tag {
    color: var(--red);
    font-weight: 800;
    font-size: 1.2rem;
    margin-top: 6px;
}

.btn-add,
.btn-order,
.qty-btn,
.btn-remove,
.btn-clear {
    border: 2px solid var(--red);
    font-weight: bold;
    cursor: pointer;
    min-height: 44px;
}

.btn-add {
    background: var(--yellow);
    color: var(--red);
    border: none;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    width: auto;
    min-width: 110px;
    align-self: flex-end;
    margin-left: auto;
    padding: 0 16px;
}

.cart-panel {
    background: var(--surface);
    padding: 10px;
}

.cart-empty {
    font-family: Arial, sans-serif;
    color: #555555;
    margin: 8px 0;
}

.cart-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px dashed #c8c8c8;
    padding: 8px 0;
}

.cart-row:last-child {
    border-bottom: none;
}

.cart-item-name {
    font-family: Arial, sans-serif;
    color: var(--text);
    font-size: 0.92rem;
}

.cart-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.qty-btn,
.btn-remove,
.btn-clear {
    background: #ffffff;
    color: var(--red);
    padding: 6px 10px;
}

.qty-value {
    min-width: 20px;
    text-align: center;
    font-family: Arial, sans-serif;
    color: #222222;
}

.cart-subtotal {
    width: 100%;
    font-family: Arial, sans-serif;
    color: var(--text);
    font-size: 0.9rem;
    text-align: left;
}

.cart-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.cart-drawer {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(var(--cart-bar-height) - 6px);
    max-height: 58vh;
    background: var(--surface);
    border: 3px solid var(--red);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding: 8px 10px 10px;
    z-index: 110;
    overflow: auto;
    transform: translateY(calc(100% + 10px));
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.cart-drawer.is-open {
    transform: translateY(0);
    opacity: 1;
}

.cart-drawer[hidden] {
    display: none;
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-drawer-header h2 {
    margin-top: 0;
}

.cart-drawer-subtotal {
    margin-top: 10px;
    font-family: Arial, sans-serif;
    color: var(--text);
    font-weight: bold;
}


.form-label {
    display: block;
    margin-top: 10px;
    margin-bottom: 4px;
    font-family: Arial, sans-serif;
    color: var(--text);
    font-weight: bold;
    font-size: 0.9rem;
}

.form-input,
.form-select {
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    border: 2px solid #b4b4b4;
    border-radius: 6px;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    color: var(--text);
    background: #ffffff;
}

.checkout-totals {
    margin-top: 12px;
    border-top: 1px dashed #bbbbbb;
    padding-top: 8px;
    font-family: Arial, sans-serif;
    color: var(--text);
    display: grid;
    gap: 5px;
}

.checkout-grand-total {
    font-weight: bold;
}

.checkout-detail {
    margin-top: 12px;
    border-top: 1px dashed #bbbbbb;
    padding-top: 8px;
}

.checkout-detail h3 {
    margin: 4px 0 8px;
    font-size: 1rem;
    color: var(--red);
}

.checkout-detail-list {
    display: grid;
    gap: 6px;
}

.checkout-detail-item {
    font-family: Arial, sans-serif;
    color: var(--text);
    font-size: 0.9rem;
}

.checkout-detail-subtotal {
    margin-top: 8px;
    font-family: Arial, sans-serif;
    color: var(--text);
    font-weight: bold;
}

.checkout-modal {
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.checkout-modal[hidden] {
    display: none;
}

.checkout-modal.is-open {
    opacity: 1;
}

.checkout-sheet {
    width: 100%;
    max-height: 86vh;
    overflow-y: auto;
    background: #FFFFFF;
    border-top: 4px solid var(--red);
    padding: 10px 12px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(40px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkout-modal.is-open .checkout-sheet {
    transform: translateY(0);
}

.checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.checkout-header h2 {
    margin-top: 0;
}

.btn-close {
    min-height: 44px;
    min-width: 44px;
    border: 2px solid var(--red);
    background: #ffffff;
    color: var(--red);
    font-weight: bold;
    cursor: pointer;
}

.btn-submit-order {
    margin-top: 12px;
}

.cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--yellow);
    border-top: 4px solid var(--red);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    display: grid;
    gap: 8px;
    z-index: 100;
}

.cart-bar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cart-bar-summary {
    text-align: center;
    font-size: 0.95rem;
}

.btn-order {
    background: var(--red);
    color: #ffffff;
    border-radius: 999px;
    width: 100%;
}

.btn-cart-toggle {
    border: 2px solid var(--red);
    background: #ffffff;
    color: var(--red);
    border-radius: 999px;
    min-height: 44px;
    font-weight: bold;
    cursor: pointer;
}

.feedback {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 102px;
    background: var(--dark);
    color: #ffffff;
    padding: 9px 12px;
    border-radius: 999px;
    font-family: Arial, sans-serif;
    font-size: 0.88rem;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 120;
}

.feedback.show {
    opacity: 1;
}

.btn-add:focus-visible,
.btn-order:focus-visible,
.btn-cart-toggle:focus-visible,
.qty-btn:focus-visible,
.btn-remove:focus-visible,
.btn-clear:focus-visible,
.btn-close:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible {
    outline: 3px solid var(--dark);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 680px) {
    body {
        --cart-bar-height: 74px;
        padding-bottom: calc(var(--cart-bar-height) + 14px);
    }

    .container {
        padding: 16px;
    }

    .header-logo {
        width: clamp(72px, 10vw, 96px);
    }

    .item-card {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }

    .item-img {
        width: 82px;
        min-height: 82px;
    }

    .btn-add {
        width: auto;
        min-width: 110px;
        align-self: center;
        margin-left: auto;
    }

    .cart-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .cart-subtotal {
        width: auto;
        text-align: right;
        min-width: 110px;
    }

    .cart-bar {
        grid-template-columns: 1fr auto;
        align-items: center;
        padding: 12px 18px;
    }

    .cart-bar-actions {
        display: flex;
        gap: 8px;
    }

    .btn-cart-toggle {
        padding: 0 18px;
    }

    .cart-bar-summary {
        text-align: left;
    }

    .btn-order {
        width: auto;
        padding: 0 24px;
    }

    .feedback {
        left: 50%;
        right: auto;
        bottom: 86px;
        transform: translateX(-50%);
        width: min(92vw, 460px);
    }

    .checkout-modal {
        align-items: center;
        padding: 14px;
    }

    .cart-drawer {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(720px, calc(100% - 20px));
    }

    .checkout-sheet {
        width: min(540px, 100%);
        border: 3px solid var(--red);
        border-top: 3px solid var(--red);
        border-radius: 10px;
        padding-bottom: 16px;
    }
}

