/* ============================================================
   ARBA GO — Food delivery UI (Uber Eats–grade UX)
   ============================================================ */
:root {
    --brand: #FF5500;
    --brand-hover: #E84D00;
    --brand-soft: #FFF5EE;
    --brand-glow: rgba(255, 85, 0, 0.22);
    --bg: #FFFFFF;
    --bg-subtle: #F6F6F6;
    --bg-elevated: #FFFFFF;
    --text: #191919;
    --text-secondary: #545454;
    --text-tertiary: #A6A6A6;
    --border: #E8E8E8;
    --border-light: #F0F0F0;
    --success: #05944F;
    --success-soft: #E6F4ED;
    --danger: #E11900;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 999px;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.14);
    --shadow-bar: 0 -2px 20px rgba(0, 0, 0, 0.1);
    --topbar-h: 58px;
    --delivery-strip-h: 44px;
    --category-nav-h: 48px;
    --cart-bar-h: 72px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --scroll-offset: 16px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100dvh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.4;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    overscroll-behavior: none;
    overflow: hidden;
}

#app {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* ── Loading ─────────────────────────────────────────────── */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    transition: opacity 0.4s var(--ease);
}

#loading-screen:not(.active) {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.loading-content { text-align: center; }

.loading-content p {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 4px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── App shell ───────────────────────────────────────────── */
.app {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    background: var(--bg);
    overflow: hidden;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
    flex-shrink: 0;
    height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--bg);
    z-index: 100;
    box-shadow: 0 1px 0 var(--border-light);
}

.topbar__inner {
    display: flex;
    align-items: center;
    height: var(--topbar-h);
    padding: 0 20px;
    gap: 14px;
    max-width: 1100px;
    margin: 0 auto;
}

.topbar__cafe {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    position: relative;
    margin: 0 -8px;
    padding: 6px 8px;
    border-radius: var(--radius-md);
    transition: background 0.15s ease;
}

.topbar__cafe:active {
    background: var(--bg-subtle);
}

.topbar__logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--border-light);
}

.topbar__cafe-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.topbar__cafe-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
}

.topbar__cafe-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    line-height: 1.25;
}

.topbar__chevron {
    flex-shrink: 0;
    color: var(--text-tertiary);
    margin-top: 1px;
}

.topbar__cafe-meta {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.topbar__cafe-meta--accent {
    color: var(--brand);
}

.cafe-select-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    -webkit-appearance: none;
    appearance: none;
}

.topbar__cart {
    position: relative;
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: var(--text);
    transition: background 0.15s ease;
}

.topbar__cart:active {
    background: var(--bg-subtle);
}

.topbar__cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
}

/* ── Delivery strip ──────────────────────────────────────── */
.delivery-strip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: var(--delivery-strip-h);
    padding: 0 20px;
    border: none;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    transition: background 0.15s ease;
    max-width: 1100px;
    margin: 0 auto;
}

.delivery-strip:active { background: var(--bg-subtle); }

.delivery-strip__icon {
    flex-shrink: 0;
    color: var(--brand);
}

.delivery-strip__text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delivery-strip__arrow {
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.delivery-strip--pickup .delivery-strip__icon { color: var(--text-secondary); }

/* ── Menu area ───────────────────────────────────────────── */
.menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.menu-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding-bottom: calc(var(--cart-bar-h) + env(safe-area-inset-bottom, 0px) + 16px);
}

.category-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-shrink: 0;
    display: flex;
    gap: 0;
    overflow-x: auto;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 8px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-nav::-webkit-scrollbar { display: none; }

.category-btn {
    flex-shrink: 0;
    padding: 14px 16px;
    border: none;
    background: none;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.category-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 3px;
    background: var(--brand);
    border-radius: 3px 3px 0 0;
    transform: scaleX(0);
    transition: transform 0.25s var(--ease);
}

.category-btn.active {
    color: var(--text);
    font-weight: 700;
}

.category-btn.active::after { transform: scaleX(1); }

.menu-list {
    position: relative;
}

.menu-section {
    scroll-margin-top: 52px;
}

.menu-section__title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    padding: 20px 16px 8px;
}

.menu-section__items {
    display: flex;
    flex-direction: column;
}

.menu-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.menu-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding-right: 2px;
    padding-top: 2px;
}

.menu-item__title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    line-height: 1.3;
}

.menu-item__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-item__price {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-top: 6px;
}

.menu-item__visual {
    position: relative;
    width: clamp(128px, 38vw, 156px);
    height: clamp(128px, 38vw, 156px);
    flex-shrink: 0;
}

.menu-item__image,
.menu-item__placeholder {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    object-fit: cover;
    cursor: pointer;
    background: var(--bg-subtle);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.menu-item__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
}

.menu-item__control {
    position: absolute;
    bottom: -4px;
    right: -4px;
    z-index: 2;
}

.item-add {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    transition: transform 0.15s ease, background 0.15s ease;
}

.item-add:active { transform: scale(0.92); }

.item-add--brand {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 12px var(--brand-glow);
}

.item-qty {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--brand);
    border-radius: var(--radius-full);
    box-shadow: 0 2px 12px var(--brand-glow);
    overflow: hidden;
    height: 40px;
}

.item-qty__btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.item-qty__btn:active { background: rgba(0, 0, 0, 0.1); }

.item-qty__count {
    min-width: 20px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    padding: 0 2px;
}

/* ── Cart bar (floating) ─────────────────────────────────── */
.cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, var(--bg) 70%, transparent);
    pointer-events: none;
}

.cart-bar__btn {
    pointer-events: auto;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 20px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--text);
    color: #fff;
    font-family: var(--font);
    cursor: pointer;
    box-shadow: var(--shadow-bar);
    transition: transform 0.15s var(--ease);
}

.cart-bar__btn:active { transform: scale(0.98); }

.cart-bar__label {
    font-size: 16px;
    font-weight: 600;
}

.cart-bar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-bar__count {
    font-size: 14px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.cart-bar__total {
    font-size: 16px;
    font-weight: 700;
}

/* ── PWA install banner ──────────────────────────────────── */
.install-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 5000;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
}

.install-banner__content {
    max-width: 560px;
    margin: 0 auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    pointer-events: auto;
}

.install-banner__text {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.35;
}

.install-banner__btn {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--font);
}

.install-banner__close {
    background: var(--bg-subtle);
    border: none;
    color: var(--text-tertiary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
}

/* ── App promo modal ───────────────────────────────────────── */
.app-promo-modal-wrapper {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

.app-promo-modal {
    background: var(--bg);
    border-radius: var(--radius-xl);
    max-width: 360px;
    width: 100%;
    position: relative;
    animation: slideUpScale 0.35s var(--ease);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.app-promo-modal__close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    border: none;
    background: var(--bg-subtle);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 16px;
    color: var(--text-tertiary);
    z-index: 1;
}

.app-promo-modal__content { padding: 36px 24px 24px; text-align: center; }

.app-promo-modal__icon {
    width: 72px; height: 72px;
    margin: 0 auto 16px;
    border-radius: var(--radius-lg);
    background: var(--brand);
    box-shadow: 0 8px 24px var(--brand-glow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-promo-modal__icon span {
    color: #fff;
    font-size: 28px;
    font-weight: 800;
}

.app-promo-modal__title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.app-promo-modal__subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.app-promo-modal__features {
    list-style: none;
    margin-bottom: 24px;
    text-align: left;
}

.app-promo-modal__features li {
    padding: 8px 0 8px 28px;
    font-size: 15px;
    color: var(--text-secondary);
    position: relative;
}

.app-promo-modal__features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    width: 20px; height: 20px;
    border-radius: var(--radius-full);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-promo-modal__btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
}

.app-promo-modal__btn--primary {
    background: var(--brand);
    color: #fff;
    margin-bottom: 10px;
}

.app-promo-modal__btn--secondary {
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

/* ── Cart sheet ────────────────────────────────────────────── */
.cart-sheet-wrapper {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-sheet-wrapper.visible {
    opacity: 1;
    pointer-events: auto;
}

.cart-sheet {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.35s var(--ease);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    will-change: transform;
}

.cart-sheet-wrapper.visible .cart-sheet { transform: translateY(0); }

.cart-sheet.is-dragging .cart-sheet__content { overflow-y: hidden; }

.cart-sheet__header {
    flex-shrink: 0;
    padding: 0 20px 16px;
    touch-action: none;
}

.cart-sheet__handle {
    position: relative;
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    margin: 12px auto 16px;
    cursor: grab;
    touch-action: none;
}

.cart-sheet__handle::before {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 72px; height: 44px;
}

.cart-sheet__title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.cart-sheet__toggle-segment {
    display: flex;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 3px;
}

.cart-sheet__toggle-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-sheet__toggle-btn.active {
    background: var(--bg);
    color: var(--text);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.cart-sheet__content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 16px;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-sheet__items-block {
    background: var(--bg-subtle);
    border-radius: var(--radius-lg);
    padding: 4px 16px;
}

.cart-sheet__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.cart-sheet__item-image {
    width: 56px; height: 56px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--border-light);
}

.cart-sheet__item-info { flex: 1; min-width: 0; }

.cart-sheet__item-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.cart-sheet__item-price {
    font-size: 14px;
    color: var(--text-secondary);
}

.cart-sheet__quantity-block {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    overflow: hidden;
    height: 36px;
}

.cart-sheet__quantity-block button {
    width: 36px; height: 36px;
    border: none;
    background: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-sheet__quantity-block span {
    min-width: 24px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

.cart-sheet__summary {
    padding: 16px 0 4px;
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
}

.cart-sheet__summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    color: var(--text-secondary);
    margin: 6px 0;
}

.cart-sheet__summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 17px;
    font-weight: 700;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.cart-sheet__form {
    background: var(--bg-subtle);
    border-radius: var(--radius-lg);
    padding: 4px 16px;
}

.cart-sheet__form-label {
    display: flex;
    flex-direction: column;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.cart-sheet__form-label--clickable {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.cart-sheet__form-label--collapsible {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.cart-sheet__address-value {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    max-width: 60%;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-sheet__chevron { width: 12px; opacity: 0.4; }
.cart-sheet__chevron.rotated { transform: rotate(90deg); }

.cart-sheet__comment {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 15px;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 12px;
    background: var(--bg);
}

.cart-sheet__footer {
    flex-shrink: 0;
    padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-light);
    background: var(--bg);
}

.cart-sheet__submit-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--brand);
    color: #fff;
    font-family: var(--font);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.cart-sheet__submit-btn:active { opacity: 0.85; }
.cart-sheet__submit-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.cart-sheet__empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-tertiary);
    font-size: 15px;
}

/* ── Success screen ────────────────────────────────────────── */
.success-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.success-content {
    background: var(--bg);
    border-radius: var(--radius-xl);
    padding: 40px 28px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.success-icon {
    width: 64px; height: 64px;
    background: var(--success);
    color: #fff;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 20px;
    animation: scaleIn 0.5s var(--ease);
}

.success-content h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.order-number {
    font-size: 15px;
    color: var(--brand);
    font-weight: 600;
    margin: 8px 0;
}

.success-message {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 12px 0 24px;
    line-height: 1.5;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-subtle);
    color: var(--text);
}

/* ── Error modal ───────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 4000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show { display: flex; }

.modal-content {
    background: var(--bg);
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 { font-size: 18px; font-weight: 700; }

.btn-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-tertiary);
    width: 32px; height: 32px;
}

.modal-body { padding: 20px; }
.modal-body p { line-height: 1.6; color: var(--text-secondary); white-space: pre-line; }
.modal-footer { padding: 16px 20px 20px; text-align: right; }

/* ── Dish modal ────────────────────────────────────────────── */
.dish-modal-wrapper {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: flex;
    align-items: flex-end;
    animation: fadeIn 0.2s ease;
}

.dish-modal {
    background: var(--bg);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s var(--ease);
    will-change: transform;
}

.dish-modal.is-dragging .dish-modal__scroll { overflow-y: hidden; }

.dish-modal__handle {
    position: relative;
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    margin: 12px auto 8px;
    cursor: grab;
    touch-action: none;
    flex-shrink: 0;
}

.dish-modal__handle::before {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 72px; height: 44px;
}

.dish-modal__scroll {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dish-modal__image {
    width: 100%;
    min-height: 280px;
    max-height: 55vh;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    background: var(--bg-subtle);
    display: block;
    flex-shrink: 0;
}

.dish-modal__info { padding: 20px 20px 8px; }

.dish-modal__title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.dish-modal__description {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.dish-modal__footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-light);
    background: var(--bg);
}

.dish-modal__price {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.dish-modal__add-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--brand);
    color: #fff;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.dish-modal__add-btn:active { opacity: 0.85; }

/* ── Address modals ────────────────────────────────────────── */
.address-modal-wrapper,
.checkout-modal-wrapper {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.address-modal,
.checkout-modal {
    background: var(--bg);
    border-radius: var(--radius-xl);
    max-width: 400px;
    width: 100%;
    position: relative;
    animation: slideUpScale 0.3s var(--ease);
    box-shadow: var(--shadow-lg);
}

.address-modal__close,
.checkout-modal__close {
    position: absolute;
    top: 16px; right: 16px;
    width: 32px; height: 32px;
    border: none;
    background: var(--bg-subtle);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 16px;
    color: var(--text-tertiary);
}

.address-modal__content { padding: 32px 24px 24px; text-align: center; }

.address-modal__title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.address-modal__subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 24px;
}

.address-modal__btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    font-family: var(--font);
}

.address-modal__btn--primary { background: var(--brand); color: #fff; }
.address-modal__btn--secondary { background: var(--bg-subtle); color: var(--text); }

.checkout-modal__header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkout-modal__title { font-size: 20px; font-weight: 800; }

.checkout-modal__content { padding: 24px; }

.checkout-modal__label {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.checkout-modal__label span {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.checkout-modal__label input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: var(--font);
}

.checkout-modal__label input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.checkout-modal__footer { padding: 0 24px 24px; }

.checkout-modal__btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--brand);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
}

/* ── Address screen ────────────────────────────────────────── */
.address-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-subtle);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    animation: slideInFromRight 0.3s ease;
}

.address-screen__header {
    background: var(--bg);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
}

.address-screen__back {
    width: 40px; height: 40px;
    border: none;
    background: var(--bg-subtle);
    border-radius: var(--radius-full);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.address-screen__toggle {
    flex: 1;
    display: flex;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 3px;
}

.address-screen__toggle-btn {
    flex: 1;
    padding: 9px;
    border: none;
    background: none;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
}

.address-screen__toggle-btn.active {
    background: var(--bg);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.address-screen__content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.address-screen__search {
    margin: 16px;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
}

.address-screen__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: var(--font);
    background: transparent;
}

.address-screen__suggestions { margin: 0 16px; }

.address-screen__loading {
    padding: 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 15px;
}

.address-screen__suggestion-item {
    background: var(--bg);
    padding: 16px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-light);
    transition: background 0.15s ease;
}

.address-screen__suggestion-item:active { background: var(--bg-subtle); }

.address-screen__suggestion-icon {
    width: 36px; height: 36px;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.address-screen__suggestion-title { font-size: 15px; font-weight: 600; }
.address-screen__suggestion-subtitle { font-size: 13px; color: var(--text-secondary); }

.address-screen__pickup-card {
    background: var(--bg);
    margin: 16px;
    padding: 16px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border: 1px solid var(--border-light);
}

.address-screen__pickup-icon {
    width: 48px; height: 48px;
    background: var(--brand-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.address-screen__pickup-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.address-screen__pickup-address { font-size: 14px; color: var(--text-secondary); }

.addresses-list {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.addresses-list__item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
}

.addresses-list__item:last-child { border-bottom: none; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideUpScale {
    from { transform: translateY(40px) scale(0.96); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes scaleIn { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes slideInFromRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ── Tablet+: карточки с крупным фото сверху ─────────────── */
@media (min-width: 768px) {
    .menu-section__items {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        padding: 0 16px 20px;
    }

    .menu-item {
        flex-direction: column;
        padding: 0;
        border-bottom: none;
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-light);
        overflow: hidden;
        background: var(--bg);
        box-shadow: var(--shadow-sm);
        transition: box-shadow 0.2s ease, transform 0.2s ease;
    }

    .menu-item:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

    .menu-item__visual {
        order: -1;
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .menu-item__image,
    .menu-item__placeholder {
        border-radius: 0;
        box-shadow: none;
    }

    .menu-item__body {
        padding: 12px 14px 14px;
    }

    .menu-item__title {
        font-size: 17px;
    }

    .menu-item__control {
        bottom: 10px;
        right: 10px;
    }
}

/* ── Desktop ───────────────────────────────────────────────── */
@media (min-width: 1024px) {
    html, body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        background: #EDEDED;
    }

    #app {
        position: relative;
        max-width: 1100px;
        margin: 0 auto;
        min-height: 100vh;
    }

    .app {
        max-width: 1100px;
        margin: 0 auto;
        min-height: 100vh;
        height: auto;
        border-radius: 0;
        box-shadow: none;
    }

    .topbar {
        position: sticky;
        top: 0;
        border-radius: 0;
    }

    .menu-scroll {
        overflow: visible;
        padding-bottom: 100px;
    }

    .category-nav {
        position: sticky;
        top: var(--topbar-h);
    }

    .menu-list {
        overflow: visible;
    }

    .menu-section__items {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 20px 24px;
    }

    .menu-item { padding: 0; }

    .category-nav {
        position: sticky;
        top: var(--topbar-h);
        z-index: 50;
    }

    .cart-bar {
        left: 50%;
        transform: translateX(-50%);
        max-width: 480px;
    }

    .cart-sheet-wrapper { justify-content: flex-end; }

    .cart-sheet {
        position: fixed;
        left: auto; right: 0; top: 0; bottom: 0;
        width: 420px;
        max-width: 90vw;
        max-height: none;
        height: 100vh;
        border-radius: var(--radius-xl) 0 0 var(--radius-xl);
        transform: translateX(100%);
    }

    .cart-sheet-wrapper.visible .cart-sheet { transform: translateX(0); }
    .cart-sheet__handle { display: none; }

    .dish-modal-wrapper {
        align-items: center;
        justify-content: center;
        padding: 24px;
    }

    .dish-modal {
        max-width: 480px;
        max-height: 85vh;
        border-radius: var(--radius-xl);
        animation: slideUpScale 0.3s var(--ease);
    }

    .dish-modal__handle { display: none; }

    .address-screen {
        align-items: center;
        padding: 24px;
        background: rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }

    .address-screen .address-screen__header,
    .address-screen .address-screen__content {
        max-width: 520px;
        width: 100%;
        margin: 0 auto;
    }

    .address-screen .address-screen__header { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
    .address-screen .address-screen__content { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
}

@media (min-width: 1280px) {
    .menu-section__items {
        grid-template-columns: 1fr 1fr 1fr;
    }
}
