:root {
    --color-bg: #f7f7f8;
    --color-surface: #ffffff;
    --color-text: #1a1a1a;
    --color-text-muted: #767676;
    --color-accent: #d3341f;
    --color-accent-dark: #a8271a;
    --color-border: #ececec;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow: 0 2px 14px rgba(0,0,0,0.06);
    --header-h: 60px;
}

* { box-sizing: border-box; }

body[data-theme="dark"] {
    --color-bg: #121212;
    --color-surface: #1e1e1e;
    --color-text: #f2f2f2;
    --color-text-muted: #a0a0a0;
    --color-border: #2c2c2c;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

/* ---------- HEADER ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--color-bg);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.logo-eto { font-size: 20px; font-weight: 800; color: var(--color-accent); letter-spacing: 1px; }
.logo-doner { font-size: 12px; font-weight: 700; color: var(--color-accent); }

.header-actions { display: flex; gap: 8px; align-items: center; }
.header-account-btn {
    border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text);
    border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 700;
}

/* ---------- CLOSED BANNER ---------- */
.closed-banner {
    background: #fdecea;
    color: #b3261e;
    padding: 12px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    white-space: pre-line;
}

/* ---------- SEARCH ---------- */
.search-wrap { padding: 16px 16px 8px; }
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 13px 18px;
    box-shadow: var(--shadow);
}
.search-box svg { color: var(--color-text-muted); flex-shrink: 0; }
.search-box input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 15px;
    color: var(--color-text);
}

/* ---------- CATEGORY NAV ---------- */
.category-nav {
    position: sticky;
    top: var(--header-h);
    z-index: 30;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 16px;
    background: var(--color-bg);
    scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-chip {
    flex-shrink: 0;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
}
.category-chip.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

/* ---------- MENU CONTAINER ---------- */
.menu-container { padding: 0 16px 100px; }
.loading-state { text-align: center; padding: 60px 0; color: var(--color-text-muted); }

.category-section { margin-bottom: 26px; }

.category-banner {
    position: relative;
    height: 90px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 14px;
    background-size: cover;
    background-position: center;
    background-color: #2b2b2b;
}
.category-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.65), rgba(0,0,0,0.15));
}
.category-banner-title {
    position: relative;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.category-banner-count {
    position: relative;
    margin-left: auto;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255,255,255,0.18);
    padding: 4px 10px;
    border-radius: 999px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (min-width: 640px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
}

.product-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    position: relative;
}
.product-card-image-wrap { position: relative; aspect-ratio: 1.1/1; overflow: hidden; background: #eee; }
.product-card-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.like-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255,255,255,0.92);
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}
.popular-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--color-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
}
.out-of-stock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #999;
}
.product-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-card-name { font-size: 14px; font-weight: 700; margin: 0; }
.product-card-desc {
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.product-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.product-card-price { font-size: 15px; font-weight: 800; color: var(--color-accent); }
.add-btn {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--color-accent); color: #fff; border: none;
    font-size: 18px; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ---------- CART BAR ---------- */
.cart-bar {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 45;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(211,52,31,0.35);
}

/* ---------- MODAL / DRAWER SHARED ---------- */
.modal-overlay, .drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
}
.modal-overlay.open, .drawer-overlay.open { display: flex; }
@media (min-width: 640px) {
    .modal-overlay { align-items: center; }
}

.modal-sheet, .drawer-sheet {
    background: var(--color-surface);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    position: relative;
    padding-bottom: 20px;
}
@media (min-width: 640px) {
    .modal-sheet, .drawer-sheet { border-radius: 24px; }
}

.modal-close {
    position: absolute; top: 12px; right: 12px;
    width: 34px; height: 34px; border-radius: 50%;
    border: none; background: rgba(0,0,0,0.06);
    font-size: 20px; color: var(--color-text);
    z-index: 5;
}

.modal-product-image { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.modal-body { padding: 18px 20px; }
.modal-body h2 { margin: 0 0 6px; font-size: 19px; }
.modal-desc { color: var(--color-text-muted); font-size: 13px; margin: 0 0 10px; }
.modal-price { font-size: 18px; font-weight: 800; color: var(--color-accent); margin-bottom: 16px; }
.modal-section { margin-bottom: 16px; }
.modal-section h4 { font-size: 13px; margin: 0 0 8px; }
.extras-list { display: flex; flex-direction: column; gap: 8px; }
.extra-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    font-size: 13px;
}
.extra-item input { width: 18px; height: 18px; }
#modalNote, .checkout-form textarea {
    width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    padding: 10px 12px; font-size: 13px; resize: vertical; min-height: 60px; background: var(--color-bg); color: var(--color-text);
}

.modal-footer { display: flex; align-items: center; gap: 12px; }
.qty-control {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid var(--color-border); border-radius: 999px; padding: 6px 14px;
}
.qty-control button { width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--color-bg); font-size: 16px; font-weight: 700; }

.btn-primary {
    background: var(--color-accent); color: #fff; border: none;
    border-radius: var(--radius-sm); padding: 13px 22px; font-size: 14px; font-weight: 700;
}
.btn-block { width: 100%; }
.btn-primary:active { background: var(--color-accent-dark); }

/* ---------- CART DRAWER ---------- */
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.drawer-header h2 { font-size: 17px; margin: 0; }
.cart-items-list { padding: 6px 20px; display: flex; flex-direction: column; gap: 12px; min-height: 60px; }
.cart-empty { text-align: center; color: var(--color-text-muted); padding: 40px 0; font-size: 13px; }
.cart-item-row { display: flex; gap: 10px; align-items: flex-start; border-bottom: 1px solid var(--color-border); padding-bottom: 12px; }
.cart-item-row img { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 13px; font-weight: 700; margin: 0 0 2px; }
.cart-item-extras { font-size: 11px; color: var(--color-text-muted); margin: 0 0 4px; }
.cart-item-controls { display: flex; align-items: center; justify-content: space-between; }
.cart-item-qty { display: flex; align-items: center; gap: 8px; }
.cart-item-qty button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-surface); font-size: 13px; }
.cart-item-price { font-weight: 700; font-size: 13px; color: var(--color-accent); }
.remove-item-btn { color: var(--color-text-muted); background: none; border: none; font-size: 12px; text-decoration: underline; padding: 0; }

.cart-summary { padding: 16px 20px 4px; border-top: 1px solid var(--color-border); }
.summary-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; color: var(--color-text-muted); }
.summary-row.total { font-size: 16px; font-weight: 800; color: var(--color-text); margin-top: 10px; }

/* ---------- CHECKOUT FORM ---------- */
.checkout-form { padding: 6px 20px 10px; display: flex; flex-direction: column; }
.checkout-form label { font-size: 12px; font-weight: 700; margin: 12px 0 5px; }
.checkout-form input[type=text], .checkout-form input[type=tel] {
    border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 11px 12px;
    font-size: 14px; background: var(--color-bg); color: var(--color-text);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; }

.segmented { display: flex; background: var(--color-bg); border-radius: 999px; padding: 4px; }
.seg-btn { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--color-text-muted); }
.seg-btn.active { background: var(--color-accent); color: #fff; }

.form-error { background: #fdecea; color: #b3261e; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 12px; margin-top: 14px; }

/* ---------- SUCCESS MODAL ---------- */
.success-sheet { text-align: center; padding: 36px 24px; }
.success-icon { font-size: 44px; margin-bottom: 12px; }
.order-number-display { font-size: 18px; font-weight: 800; color: var(--color-accent); margin: 10px 0 22px; }

/* ---------- TRACK MODAL ---------- */
#trackModal .modal-sheet { padding: 24px 20px; }
#trackModal h2 { margin-top: 0; font-size: 17px; }
#trackModal label { font-size: 12px; font-weight: 700; display: block; margin: 12px 0 5px; }
#trackModal input { width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 11px 12px; font-size: 14px; background: var(--color-bg); color: var(--color-text); }
#trackModal button { margin-top: 16px; }
.track-result { margin-top: 16px; font-size: 13px; }
.track-step { padding: 8px 0; color: var(--color-text-muted); }
.track-step.active { color: var(--color-accent); font-weight: 700; }

/* ---------- ACCOUNT MODAL ---------- */
#accountModal .modal-sheet { padding: 24px 20px 28px; }
.account-view h2 { font-size: 18px; margin: 0 0 16px; }
.auth-form { display: flex; flex-direction: column; margin-top: 16px; }
.auth-form label { font-size: 12px; font-weight: 700; margin: 10px 0 5px; }
.auth-form input {
    border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 11px 12px;
    font-size: 14px; background: var(--color-bg); color: var(--color-text);
}
.verify-info { font-size: 13px; color: var(--color-text-muted); margin: 0 0 4px; }
.account-info-box {
    background: var(--color-bg); border-radius: var(--radius-sm); padding: 12px 14px;
    font-size: 13px; margin-bottom: 6px;
}
.account-info-box strong { display: block; font-size: 14px; }

.order-history-card {
    background: var(--color-bg); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px;
}
.order-history-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.order-history-total { color: var(--color-accent); }
.order-progress { display: flex; align-items: center; gap: 4px; }
.order-progress-step { flex: 1; text-align: center; font-size: 10px; color: var(--color-text-muted); position: relative; }
.order-progress-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--color-border); margin: 0 auto 4px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; }
.order-progress-step.done .order-progress-dot { background: var(--color-accent); }
.order-progress-step.cancelled .order-progress-dot { background: #b3261e; }
.order-history-cancelled { color: #b3261e; font-size: 12px; font-weight: 700; text-align: center; }
