:root {
    color-scheme: light;
    --bg: #ddc29b;
    --paper: #fbf0d8;
    --paper-deep: #ecd3a9;
    --surface: #fff9ec;
    --surface-2: #f4e3c4;
    --ink: #351f14;
    --muted: #775a42;
    --line: #d4b27e;
    --brand: #286251;
    --brand-ink: #ffffff;
    --accent: #a85635;
    --rose: #8f3d4f;
    --sage: #6e8467;
    --danger: #a33b3f;
    --ok: #286251;
    --shadow: 0 18px 38px rgba(53, 31, 20, .17);
    --drawer-width: min(calc(100% - 28px), 732px);
}

* { box-sizing: border-box; }

html, body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

body {
    position: relative;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 249, 236, .95), transparent 30%),
        radial-gradient(circle at 92% 14%, rgba(143, 61, 79, .13), transparent 28%),
        radial-gradient(circle at 22% 88%, rgba(40, 98, 81, .14), transparent 34%),
        linear-gradient(145deg, #d5b485 0%, #ead1a8 44%, #c49a70 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(rgba(255, 246, 226, .82), rgba(255, 246, 226, .58)),
        url('/images/price/price-list.jpg') center 18px / min(84vw, 620px) auto no-repeat;
    opacity: .28;
    filter: saturate(.9) sepia(.08);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(115deg, rgba(255, 255, 255, .18), transparent 36%),
        radial-gradient(circle at 65% 105%, rgba(255, 248, 232, .38), transparent 32%);
}

button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; }

.app-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 760px);
    margin: 0 auto;
    padding: max(12px, env(safe-area-inset-top)) 14px calc(128px + env(safe-area-inset-bottom));
}

.app-shell.cart-expanded {
    padding-bottom: calc(172px + env(safe-area-inset-bottom));
}

.loading-shell { min-height: 100vh; display: grid; place-items: center; }
.loading-card, .notice, .checkout-panel, .product-card, .order-card {
    background: var(--surface);
    border: 1px solid rgba(83, 48, 25, .2);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.loading-card, .notice { padding: 14px; }
.notice { margin: 12px 0; }
.notice.error { border-color: rgba(163, 59, 63, .4); color: var(--danger); }
.notice.success { border-color: rgba(40, 98, 81, .4); color: var(--ok); }
.notice.success:focus-visible { outline: 3px solid rgba(40, 98, 81, .28); outline-offset: 3px; scroll-margin-top: 12px; }

.hero-band {
    position: relative;
    min-height: 238px;
    border-radius: 8px;
    padding: 26px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 18px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(255, 248, 232, .98) 0%, rgba(255, 248, 232, .94) 52%, rgba(255, 248, 232, .58) 76%, rgba(255, 248, 232, .24) 100%),
        url('/images/price/price-list.jpg') right center / auto 112% no-repeat,
        var(--paper);
    border: 1px solid rgba(83, 48, 25, .26);
    box-shadow: 0 22px 48px rgba(53, 31, 20, .2);
}

.hero-band::before,
.hero-band::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.hero-band::before {
    inset: 10px;
    border: 1px dashed rgba(83, 48, 25, .22);
    border-radius: 6px;
}

.hero-band::after {
    width: 118px;
    height: 28px;
    top: 18px;
    left: 22px;
    rotate: -6deg;
    background: rgba(181, 145, 94, .34);
    box-shadow: 0 2px 8px rgba(53, 31, 20, .1);
}

.hero-copy-block, .hero-actions { position: relative; z-index: 1; }
.hero-copy-block { max-width: 500px; }

.eyebrow {
    margin: 0 0 7px;
    color: var(--accent);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 800;
}

h1, h2 { margin: 0; letter-spacing: 0; }
h1 {
    font-family: Georgia, "Times New Roman", serif;
    max-width: 440px;
    font-size: clamp(42px, 9vw, 72px);
    line-height: .94;
    font-weight: 500;
}
h2 { font-size: 18px; line-height: 1.15; }
.script-line {
    margin: 10px 0 0;
    color: var(--muted);
    font-family: "Segoe Script", "Comic Sans MS", cursive;
    font-size: clamp(18px, 4.6vw, 25px);
}
.hero-copy { max-width: 440px; margin: 12px 0 0; color: var(--muted); line-height: 1.45; }
.hero-actions { display: grid; gap: 8px; justify-items: end; }

.admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 8px;
    color: var(--brand-ink);
    background: var(--brand);
    text-decoration: none;
    white-space: nowrap;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(53, 31, 20, .14);
}

.category-strip { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0; scrollbar-width: none; }

.catalog-category-strip {
    flex-wrap: wrap;
    overflow: visible;
}
.category-strip::-webkit-scrollbar { display: none; }
.pill {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(83, 48, 25, .23);
    background: rgba(255, 249, 236, .88);
    color: var(--muted);
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(53, 31, 20, .08);
}
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.product-list, .orders-list, .cart-lines { display: grid; gap: 12px; }
.product-list { padding-bottom: 20px; }
.product-card {
    position: relative;
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.54), transparent 34%),
        var(--paper);
}
.product-card img {
    width: 128px;
    height: 146px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--surface-2);
    border: 7px solid #fff8e8;
    box-shadow: 0 10px 20px rgba(53, 31, 20, .17);
}
.product-body { min-width: 0; }
.product-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.product-price { display: grid; justify-items: end; gap: 2px; min-width: max-content; }
.product-price strong { white-space: nowrap; font-family: Georgia, "Times New Roman", serif; font-size: 21px; }
.product-price-unit { color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1; }
.product-category, .muted { color: var(--muted); }
.product-category { margin: 0 0 4px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.product-body p { margin: 8px 0; color: var(--muted); line-height: 1.35; }
.product-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.icon-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #ead4ad;
    color: var(--ink);
    font-weight: 900;
    line-height: 1;
}
.icon-button.primary { background: var(--brand); color: #fff; }
.icon-button.mini { width: 30px; height: 30px; font-size: 15px; }
.quantity { min-width: 68px; text-align: center; font-weight: 900; white-space: nowrap; }
.line-comment, .field {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffaf0;
    color: var(--ink);
    padding: 9px 11px;
}
.line-comment { margin-top: 10px; min-height: 40px; }
.field { min-height: 42px; }
select.field {
    appearance: none;
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23351f14' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}
textarea.field { resize: vertical; }

.checkout-panel {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 30;
    width: var(--drawer-width);
    transform: translateX(-50%);
    margin: 0;
    padding: 12px;
    background: rgba(255, 248, 232, .98);
    backdrop-filter: blur(8px);
    box-shadow: 0 18px 50px rgba(53, 31, 20, .24);
}
.checkout-panel.collapsed { width: min(calc(100% - 28px), 380px); min-height: 112px; padding-bottom: 14px; background: rgba(255, 248, 232, .80); }
.checkout-panel.collapsed.empty { min-height: 104px; background: rgba(255, 248, 232, .64); }
.checkout-panel.expanded {
    width: var(--drawer-width);
    background: rgba(255, 248, 232, .98);
    max-height: min(78vh, 690px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}
.checkout-header, .order-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.checkout-total { display: grid; gap: 10px; justify-items: end; padding-right: 4px; }
.checkout-total strong { white-space: nowrap; font-family: Georgia, "Times New Roman", serif; font-size: 18px; }
.drawer-toggle {
    min-height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}
.checkout-content {
    min-height: 0;
    overflow-y: auto;
    padding: 10px 2px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.checkout-content::-webkit-scrollbar { display: none; }
.collapsed-hint { margin: 10px 0 0; padding-bottom: 0; font-size: 14px; line-height: 1.3; }
.cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dotted var(--line);
}
.cart-line-info { min-width: 0; display: grid; gap: 3px; }
.cart-line-info span { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.cart-line-info small { color: var(--muted); line-height: 1.25; }
.cart-line-side { display: grid; gap: 7px; justify-items: end; }
.cart-line-side strong { white-space: nowrap; }
.cart-quantity { display: flex; align-items: center; gap: 8px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; margin: 12px 0; border-radius: 8px; background: #ead4ad; }
.segmented button { min-height: 38px; border-radius: 6px; background: transparent; color: var(--muted); }
.segmented button.active { background: #fffaf0; color: var(--ink); box-shadow: 0 6px 18px rgba(53, 31, 20, .12); }
.field-label, label span { display: block; margin: 10px 0 5px; color: var(--muted); font-size: 13px; }
.field-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.compact-note { margin: 6px 0 0; font-size: 13px; line-height: 1.35; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.address-card {
    padding: 10px;
    border-radius: 8px;
    background: rgba(244, 227, 196, .64);
    border: 1px solid rgba(212, 178, 126, .9);
}
.address-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.address-card .field-label { margin-top: 0; }
.address-field { min-height: 74px; }
.field.invalid { border-color: rgba(163, 59, 63, .78); background: rgba(255, 246, 238, .96); box-shadow: 0 0 0 3px rgba(163, 59, 63, .1); }
.field-error { margin: 7px 0 0; color: var(--danger); font-size: 13px; font-weight: 800; line-height: 1.25; }
.map-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(40, 98, 81, .12);
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
}
.order-comment { min-height: 72px; }
.pickup-box { padding: 11px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.pickup-box span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.pickup-link { color: var(--brand); font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.submit-button { width: 100%; min-height: 48px; margin-top: 12px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 900; }
.submit-button:disabled { opacity: .55; }

.admin-shell { max-width: 860px; }
.admin-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 18px 0 6px; }
.admin-header-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.production-date-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0; }
.production-date-tabs .pill { flex: 0 0 auto; }
.production-summary, .production-empty { margin-top: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.production-summary-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.production-summary-heading h2 { margin: 2px 0 0; font-family: Georgia, "Times New Roman", serif; }
.production-summary-heading > strong { color: var(--brand); }
.production-items { display: grid; gap: 10px; margin-top: 16px; }
.production-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; background: var(--surface-2); }
.production-item h3, .production-item p { margin: 0; }
.production-item > strong { flex: 0 0 auto; font-size: 18px; color: var(--brand); }
.order-card { padding: 14px; }
.order-card p { margin: 6px 0 0; }
.status-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.status-row span { padding: 6px 10px; border-radius: 999px; background: #ead4ad; color: var(--muted); font-size: 12px; }
.customer-line a { color: var(--brand); margin-left: 8px; }
.customer-id { display: inline-block; margin-left: 8px; font-size: 13px; }
.order-items { display: grid; gap: 8px; margin: 12px 0; }
.order-items div { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px; border-radius: 8px; background: var(--surface-2); }
.order-items small { grid-column: 1 / -1; color: var(--muted); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.admin-actions button { min-height: 44px; padding: 0 12px; border-radius: 8px; background: #ead4ad; color: var(--ink); transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease; }
.admin-actions button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(53, 31, 20, .12); }
.admin-actions button:focus-visible,
.admin-confirmation-footer button:focus-visible { outline: 3px solid rgba(40, 98, 81, .32); outline-offset: 2px; }
.admin-actions button:disabled,
.admin-confirmation-footer button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
.admin-actions button.payment-toggle.active { background: var(--brand); color: var(--brand-ink); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .2); }
.admin-actions button.danger { background: rgba(163, 59, 63, .14); color: var(--danger); }
.admin-confirmation-dialog { width: min(calc(100% - 28px), 480px); max-width: 480px; padding: 0; border: 1px solid rgba(83, 48, 25, .24); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 28px 80px rgba(53, 31, 20, .34); }
.admin-confirmation-dialog::backdrop { background: rgba(53, 31, 20, .52); backdrop-filter: blur(3px); }
.admin-confirmation-content { padding: 20px; }
.admin-confirmation-content h2 { font-family: Georgia, "Times New Roman", serif; font-size: 25px; }
.admin-confirmation-order { margin-top: 14px; color: var(--muted); }
.admin-confirmation-description { margin-top: 8px; padding: 12px; border-radius: 8px; background: var(--surface-2); color: var(--ink); font-weight: 800; line-height: 1.4; }
.admin-dialog-error { margin: 12px 0 0; box-shadow: none; }
.admin-confirmation-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.admin-confirmation-footer button { min-height: 44px; padding: 0 16px; border-radius: 8px; background: var(--surface-2); color: var(--ink); font-weight: 800; }
.admin-confirmation-footer .dialog-confirm { background: var(--brand); color: var(--brand-ink); }
.admin-confirmation-footer .dialog-confirm.danger { background: var(--danger); color: #fff; }
.admin-reply-box { display: grid; gap: 8px; margin-top: 12px; padding: 10px; border-radius: 8px; background: rgba(244, 227, 196, .55); border: 1px solid rgba(212, 178, 126, .72); }
.admin-reply-field { min-height: 68px; }
.admin-reply-send { min-height: 38px; padding: 0 12px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 900; justify-self: start; }
.admin-reply-send:disabled { opacity: .55; }
.admin-reply-status { margin: 0; font-size: 13px; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px; background: #a33b3f; color: #fff; z-index: 1000; }
#blazor-error-ui .reload { color: #fff; margin-left: 10px; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

@media (max-width: 560px) {
    :root { --drawer-width: calc(100% - 20px); }
    .app-shell { padding-left: 10px; padding-right: 10px; padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
    .app-shell.cart-expanded { padding-bottom: calc(158px + env(safe-area-inset-bottom)); }
    body::before { background-size: 92vw auto; background-position: center 8px; opacity: .23; }
    .hero-band {
        min-height: 218px;
        padding: 20px;
        grid-template-columns: 1fr;
        align-items: start;
        background:
            linear-gradient(180deg, rgba(255, 248, 232, .98) 0%, rgba(255, 248, 232, .9) 56%, rgba(255, 248, 232, .44) 100%),
            url('/images/price/price-list.jpg') right bottom / auto 92% no-repeat,
            var(--paper);
    }
    h1 { font-size: clamp(40px, 14vw, 58px); max-width: 310px; }
    .hero-copy { max-width: 300px; }
    .hero-actions { width: 100%; justify-items: stretch; }
    .admin-header { flex-direction: column; align-items: stretch; }
    .admin-header > div:first-child { min-width: 0; }
    .admin-header-links { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .production-header h1 { max-width: 100%; font-size: clamp(34px, 11vw, 48px); overflow-wrap: anywhere; }
    .admin-link { width: 100%; }
    .category-strip { flex-wrap: wrap; overflow: visible; padding: 12px 0; }
    .category-strip::-webkit-scrollbar { display: none; }
    .pill { min-height: 36px; padding: 0 12px; }
    .product-card { grid-template-columns: 104px minmax(0, 1fr); gap: 10px; }
    .product-card img { width: 104px; height: 132px; border-width: 5px; }
    .product-heading { grid-template-columns: 1fr; gap: 5px; }
    .product-price { justify-items: start; min-width: 0; }
    .product-price strong { font-size: 19px; }
    .form-grid { grid-template-columns: 1fr; }
    .checkout-panel { bottom: max(6px, env(safe-area-inset-bottom)); padding: 10px; }
    .checkout-panel.collapsed { width: calc(100% - 20px); min-height: 104px; padding-bottom: 12px; }
    .checkout-panel.collapsed.empty { min-height: 92px; background: rgba(255, 248, 232, .58); }
    .collapsed-hint { margin-top: 8px; }
    .checkout-total { gap: 9px; padding-right: 3px; }
    .checkout-panel.expanded { max-height: 82vh; }
    .checkout-header h2 { font-size: 17px; }
    .cart-line { grid-template-columns: 1fr; gap: 8px; }
    .cart-line-side { grid-template-columns: 1fr auto; align-items: center; justify-items: stretch; }
    .cart-line-side strong { justify-self: start; }
    .cart-quantity { justify-self: end; }
    .address-card-top { display: grid; grid-template-columns: 1fr auto; }
}
