:root {
    color-scheme: light;
    --bg: #f7f3ef;
    --card: #ffffff;
    --text: #241f1c;
    --muted: #746b64;
    --accent: #8f4f32;
    --line: #e7ddd5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    padding: 12px 14px;
}

button.secondary {
    background: #efe6de;
    color: var(--text);
}

.app {
    max-width: 840px;
    margin: 0 auto;
    padding: 16px;
}

.hero,
.toolbar,
.product-card,
.dialog-card,
.cart-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(60, 35, 20, .06);
}

.hero {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px;
}

.hero h1 {
    margin: 4px 0 8px;
    font-size: 28px;
}

.hero p {
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 12px;
}

.cart-button {
    white-space: nowrap;
}

.toolbar {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 10px;
    margin: 14px 0;
    padding: 12px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    padding: 12px;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.product-card img,
.product-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #eadfd6;
}

.product-body {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.product-body h3 {
    margin: 0;
    font-size: 16px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.price {
    display: grid;
    gap: 2px;
    font-weight: 700;
}

.load-more {
    display: block;
    width: 100%;
    margin: 16px 0 0;
}

dialog {
    width: min(720px, calc(100% - 24px));
    border: 0;
    border-radius: 24px;
    padding: 0;
    background: transparent;
}

dialog::backdrop {
    background: rgba(0, 0, 0, .45);
}

.dialog-card {
    padding: 16px;
}

.dialog-head,
.mode-row,
.quantity-row,
.cart-item {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.mode-row {
    justify-content: flex-start;
    margin: 12px 0;
}

.quantity-row input {
    max-width: 130px;
}

.attributes {
    display: grid;
    gap: 6px;
    margin: 12px 0;
}

.attributes div {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 5px;
}

.companions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.cart-item {
    margin: 10px 0;
    padding: 12px;
}

.order-form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.total {
    text-align: right;
    font-size: 18px;
}

@media (max-width: 640px) {
    .hero,
    .toolbar {
        grid-template-columns: 1fr;
    }

    .hero {
        display: grid;
    }
}
