/* ==================== */
/* ENHANCED STANDARD MENU DESIGN */
/* Warm beige, elegant typography, view-only */
/* ==================== */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');

:root {
    --bg-warm: #ffffff;
    --bg-image: url('/images/bgqr.jpg');
    --text-primary: #000000;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-900: #111827;
    --border-color: #d1d5db;
    --white: #ffffff;
}

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

html,
body {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-warm);
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    font-family: 'Oswald', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Desktop: center the container */
@media (min-width: 992px) {

    html,
    body {
        background-color: #e5e7eb;
    }

    body>.w-full {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        background-color: #e5e7eb;
    }
}

/* Container */
.app-container {
    width: 100%;
    height: 100vh;
    background: url('/images/bgqr.jpg') center/cover no-repeat fixed;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .app-container {
        max-width: 480px;
        height: 900px;
        border-radius: 20px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }
}

/* ==================== */
/* MAIN PAGE - Landing */
/* ==================== */
.main-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    background: url('/images/bgqr.jpg') center/cover no-repeat;
}

.main-page.hidden {
    display: none;
}

/* Scrollable content area */
.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 80px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.app-content::-webkit-scrollbar {
    display: none;
}

/* Landing Page */
.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 24px 20px;
    text-align: center;
    min-height: 0;
    flex: 1;
}

.landing-hero {
    margin-top: auto;
    padding-top: 40px;
}

.hero-cover {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid #ffffff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.10);
    background: #ffffff;
}

.hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.landing-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-top: 24px;
    line-height: 1.3;
}

.landing-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
    max-width: 260px;
}

.landing-actions {
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 32px;
    margin-bottom: auto;
}

.landing-btn {
    height: 48px;
    border-radius: 28px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-family: inherit;
}

.landing-btn.primary {
    background: linear-gradient(135deg, #272757 0%, #4f46e5 100%);
    color: #ffffff;
}

.landing-btn.primary:hover {
    background: linear-gradient(135deg, #1f1f4a 0%, #4338ca 100%);
}

.landing-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid #e5e7eb;
}

.landing-btn.secondary:hover {
    border-color: #272757;
    color: #272757;
}

/* ==================== */
/* CATEGORY PAGE WRAPPER */
/* ==================== */
.category-page {
    display: none;
    flex-direction: column;
    height: 100%;
    background: url('/images/bgqr.jpg') center/cover no-repeat fixed;
}

.category-page.active {
    display: flex;
}

/* ==================== */
/* STICKY HEADER */
/* ==================== */
.menu-header {
    background: transparent;
    padding: 12px 0px;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.menu-header .header-subtitle {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.header-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.header-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.header-btn svg {
    width: 22px;
    height: 22px;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== */
/* STICKY CATEGORY TABS */
/* ==================== */
.category-tabs {
    background: transparent;
    padding: 12px 20px;
    overflow-x: auto;
    position: sticky;
    top: 65px;
    z-index: 19;
    border-bottom: none;
    flex-shrink: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

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

.category-tabs-inner {
    display: flex;
    gap: 10px;
}

.category-tab {
    padding: 8px 20px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--gray-100);
    color: var(--text-primary);
}

.category-tab.active {
    background: var(--gray-900);
    color: var(--white);
}

.category-tab:hover:not(.active) {
    background: var(--gray-200);
}

/* ==================== */
/* SCROLLABLE MENU CONTENT */
/* ==================== */
.menu-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.menu-content::-webkit-scrollbar {
    display: none;
}

/* ==================== */
/* MENU SECTION */
/* ==================== */
.menu-section {
    padding: 32px 20px;
    scroll-margin-top: 140px;
}

.section-title-wrap {
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--text-primary);
}

.section-items-count {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Grid layout: 1 col on mobile, 2 cols on desktop */
.section-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
}

@media (min-width: 480px) and (max-width: 991px) {
    .section-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        width: 100%;
    }
}

.section-col {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Section hero image */
.section-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
}

.section-image-placeholder {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-image-placeholder svg {
    width: 40px;
    height: 40px;
    color: var(--gray-400);
}

/* ==================== */
/* MENU ITEM - Elegant typography */
/* ==================== */
.menu-item {
    padding: 12px 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.menu-item:hover {
    opacity: 0.8;
}

.menu-item.sold-out {
    opacity: 0.4;
    pointer-events: none;
}

.item-name-price {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    flex-shrink: 1;
}

.item-dots {
    flex: 1;
    border-bottom: 1px dotted var(--gray-400);
    margin-bottom: 6px;
    min-width: 20px;
}

.item-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
    white-space: nowrap;
}

.item-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    width: 100%;
}

.sold-out-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #dc2626;
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

/* ==================== */
/* ITEM DETAIL DRAWER */
/* ==================== */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    background: var(--white);
    border-radius: 20px 20px 0 0;
    z-index: 101;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 992px) {
    .drawer-sheet {
        max-width: 480px;
        margin: 0 auto;
    }
}

.drawer-overlay.active .drawer-sheet {
    transform: translateY(0);
}

.drawer-handle {
    width: 36px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    margin: 10px auto;
    flex-shrink: 0;
}

.drawer-image {
    width: 100%;
    height: 220px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.drawer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drawer-image .no-image {
    width: 100%;
    height: 100%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-image .no-image svg {
    width: 48px;
    height: 48px;
    color: var(--gray-400);
}

.drawer-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.drawer-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.drawer-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.drawer-desc-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.drawer-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.drawer-close-btn {
    width: 100%;
    padding: 14px;
    background: var(--gray-900);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.drawer-close-btn:hover {
    background: #1f2937;
}

.drawer-close-btn svg {
    width: 18px;
    height: 18px;
}

/* ==================== */
/* SEARCH OVERLAY */
/* ==================== */
.search-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-warm);
    z-index: 50;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.search-overlay.active {
    transform: translateY(0);
}

@media (min-width: 992px) {
    .search-overlay {
        max-width: 480px;
        margin: 0 auto;
        left: 0;
        right: 0;
    }
}

.search-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.search-back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
}

.search-back-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.search-input-wrapper {
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 0.95rem;
    background: var(--white);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.search-input:focus {
    border-color: var(--gray-900);
}

.search-clear-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.search-clear-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.search-clear-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-results-header {
    padding: 12px 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
}

.search-results-header.visible {
    opacity: 1;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
}

.search-results-list .menu-item {
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 0;
}

.search-results-list .menu-item:last-child {
    border-bottom: none;
}

.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    opacity: 0;
    transition: opacity 0.2s;
}

.search-empty.visible {
    opacity: 1;
}

.search-empty svg {
    width: 48px;
    height: 48px;
    color: var(--gray-400);
    margin-bottom: 12px;
}

.search-empty-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==================== */
/* LANGUAGE SWITCHER */
/* ==================== */
.lang-switcher {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 30;
}

@media (min-width: 992px) {
    .lang-switcher {
        bottom: auto;
        right: auto;
        position: absolute;
        bottom: 16px;
        right: 16px;
    }
}

.lang-current-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.lang-trigger-wrap {
    position: relative;
}

.lang-trigger-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lang-trigger-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.lang-dropup {
    position: absolute;
    bottom: 48px;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-width: 130px;
}

.lang-dropup-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.lang-dropup-item:hover {
    background: var(--gray-100);
}

.lang-dropup-item.active {
    font-weight: 600;
    color: var(--gray-900);
}

/* ==================== */
/* TOAST NOTIFICATION */
/* ==================== */
.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 200;
    transition: bottom 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    bottom: 24px;
}

.toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ==================== */
/* LOADING SCREEN */
/* ==================== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #272757 0%, #1f1f4a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* RTL Support */
[dir="rtl"] .menu-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .header-left {
    flex-direction: row-reverse;
}

[dir="rtl"] .category-tabs-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .item-name-price {
    flex-direction: row-reverse;
}

[dir="rtl"] .search-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-switcher {
    right: auto;
    left: 16px;
}

[dir="rtl"] .lang-dropup {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-dropup-item {
    text-align: right;
}