/* ==========================================================================
   SOYA Menu Design System & Stylesheet (Premium Phone App Mockup)
   ========================================================================== */

@font-face {
    font-family: 'K24 Kurdish Bold';
    src: local('K24 Kurdish Bold'), 
         local('K24-Kurdish-Bold'), 
         local('Kurdistan 24 Bold'), 
         local('Kurdistan24-Bold'),
         url('fonts/K24-Kurdish-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-dark: #000000;
    --bg-surface: #0a0a0d;
    --bg-surface-glass: rgba(15, 15, 20, 0.7);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(224, 83, 60, 0.25);
    
    --primary: #ffffff;
    --muted: #8e8e93;
    --accent: #e0533c; /* Salmon / Neon Red-Orange */
    --accent-glow: rgba(224, 83, 60, 0.4);
    --gold: #d6a655;
    --success: #34c759;
    --danger: #ff3b30;
    
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Outfit', sans-serif;
    
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --border-radius-xl: 32px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-glow: 0 0 20px var(--accent-glow);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --shadow-nav: 0 -4px 24px rgba(0, 0, 0, 0.9);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #0b0b0f;
    color: var(--primary);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-ar);
    line-height: 1.5;
}

/* Dynamic Font/Dir Switch */
html[lang="ar"] body {
    font-family: var(--font-ar);
}

html[lang="ku"] body,
html[lang="ku"] button,
html[lang="ku"] input,
html[lang="ku"] select,
html[lang="ku"] textarea,
html[lang="ku"] .lang-btn,
html[lang="ku"] .item-card-title,
html[lang="ku"] .category-card-name {
    font-family: 'K24 Kurdish Bold', 'K24 Kurdish', 'Noto Sans Arabic', var(--font-ar), sans-serif;
    font-weight: 700;
}

html[lang="en"] body, html[lang="tr"] body {
    font-family: var(--font-en);
}

/* Direction utility */
[dir="rtl"] {
    direction: rtl;
}
[dir="ltr"] {
    direction: ltr;
}

.hidden {
    display: none !important;
}

/* Custom Scrollbars (App Feeling) */
::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ─── PHONE CONTAINER VIEWPORT ─── */
body.desktop-mockup {
    background-color: var(--bg-dark);
}

#app-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: var(--bg-dark);
    overflow: hidden;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

/* Style wrapper as a premium smartphone frame on desktop/tablet screens */
@media (min-width: 768px) {
    body.desktop-mockup {
        display: flex;
        justify-content: center;
        align-items: center;
        background: radial-gradient(circle at center, #1b1b24 0%, #060609 100%);
        padding: 20px;
    }
    
    #app-wrapper {
        width: 410px;
        height: 840px;
        max-height: 95vh;
        border-radius: 40px;
        border: 10px solid #1c1c1f;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 
                    0 0 0 2px rgba(255, 255, 255, 0.05),
                    0 0 30px rgba(224, 83, 60, 0.15);
    }
}

/* ─── SCREENS ARCHITECTURE ─── */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    display: none;
    flex-direction: column;
    z-index: 10;
    overflow: hidden;
}

.screen.active {
    display: flex;
    animation: fadeInScreen 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInScreen {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.screen-content {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 84px; /* space for floating navbar */
    padding-bottom: 90px; /* space for cart FAB */
}

/* ─── SCREEN 1: INTRO PRELOADER ─── */
#screen-preloader {
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#intro-video {
    width: 200px;
    height: auto;
    max-width: 65%;
    object-fit: contain;
    mix-blend-mode: screen;
}

.skip-btn {
    position: absolute;
    bottom: 40px;
    right: 24px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: var(--border-radius-xl);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1010;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.skip-btn:active {
    transform: scale(0.95);
    background: var(--accent);
}

/* ─── SCREEN 2: LANGUAGE SELECTOR ─── */
#screen-lang {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top, #151522 0%, #000000 100%);
    z-index: 900;
    padding: 24px;
}

.lang-screen-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.lang-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    mix-blend-mode: screen;
}

.lang-logo-video {
    width: 280px;
    height: auto;
    max-width: 85%;
    object-fit: contain;
    mix-blend-mode: screen;
}

.lang-prompt {
    font-size: 14px;
    color: #ffffff;
    font-weight: 600;
    opacity: 0.8;
}

.lang-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.lang-btn:hover {
    border-color: var(--accent);
    background: rgba(224, 83, 60, 0.08);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.lang-flag {
    font-size: 28px;
}

.lang-name {
    font-size: 14px;
    font-weight: 700;
}

.lang-native {
    font-size: 11px;
    color: var(--muted);
}

/* ─── APP HEADER ─── */
.app-header {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    width: calc(100% - 24px);
    border-radius: var(--border-radius-md);
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: var(--shadow-glow);
    cursor: pointer;
}

.header-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffffff;
}

.header-sub {
    font-size: 10px;
    color: var(--muted);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    transition: all var(--transition-fast);
}

.icon-btn:active {
    transform: scale(0.9);
    border-color: var(--accent);
}

.table-pill {
    background: rgba(224, 83, 60, 0.12);
    border: 1px solid var(--border-accent);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: var(--border-radius-md);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── SCREEN 3: HOME (SQUARE CATEGORIES GRID) ─── */
.home-hero {
    padding: 20px 20px 12px 20px;
}

.hero-greeting {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
}

.hero-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.search-bar-wrapper {
    position: relative;
    padding: 8px 20px 16px 20px;
}

.search-bar {
    width: 100%;
    background: var(--bg-surface-glass);
    border: 1px solid var(--border-glass);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
}

[dir="rtl"] .search-bar {
    padding-left: 40px;
}
[dir="ltr"] .search-bar {
    padding-right: 40px;
}

.search-bar:focus {
    border-color: var(--accent);
    background: rgba(15, 15, 25, 0.95);
    box-shadow: 0 0 12px rgba(224, 83, 60, 0.15);
}

.search-ico {
    position: absolute;
    top: 50%;
    transform: translateY(-80%);
    font-size: 18px;
    color: var(--muted);
    pointer-events: none;
}

[dir="rtl"] .search-ico {
    left: 32px;
}
[dir="ltr"] .search-ico {
    right: 32px;
}

.clear-ico {
    position: absolute;
    top: 50%;
    transform: translateY(-80%);
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
}

[dir="rtl"] .clear-ico {
    left: 32px;
}
[dir="ltr"] .clear-ico {
    right: 32px;
}

.section-label {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    padding: 8px 20px;
    opacity: 0.9;
}

/* ─── CATEGORY SQUARE CARDS ─── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 8px 20px 24px 20px;
}

.category-card {
    position: relative;
    aspect-ratio: 1.05 / 1;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--border-glass);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    box-shadow: var(--shadow-card);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.85) 100%);
    z-index: 1;
    transition: background var(--transition-fast);
}

.category-card:active {
    transform: scale(0.96);
    border-color: var(--accent);
}

.category-card-info {
    position: relative;
    z-index: 2;
}

.category-card-name {
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 2px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.category-card-count {
    font-size: 10px;
    color: var(--muted);
    font-weight: 600;
}

/* ─── SCREEN 4: CATEGORY ITEMS ─── */
.back-btn {
    font-size: 20px;
}

.header-center {
    text-align: center;
    flex-grow: 1;
}

.header-center h2 {
    font-size: 14px;
    font-weight: 800;
}

.header-center p {
    font-size: 10px;
    color: var(--muted);
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
}

.item-card {
    background: var(--bg-surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    display: flex;
    gap: 10px;
    padding: 8px;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.item-card:active {
    transform: scale(0.98);
}

.item-card-img-wrap {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: #09090c;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

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

.item-card-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    min-width: 0;
}

.item-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-card-desc {
    font-size: 10px;
    color: var(--muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
    margin-bottom: auto;
}

.item-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.item-card-price {
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
}

/* ─── ADD/REMOVE CONTROLLER ─── */
.item-card-action {
    display: flex;
    align-items: center;
    position: relative;
}

.btn-add-item {
    width: 28px;
    height: 28px;
    border-radius: var(--border-radius-sm);
    background: rgba(224, 83, 60, 0.12);
    border: 1px solid var(--border-accent);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.btn-add-item:active {
    transform: scale(0.9);
    background: var(--accent);
    color: #ffffff;
}

.qty-controller {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qty-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.qty-btn.minus { color: var(--muted); }
.qty-btn.plus { color: var(--accent); }

.qty-val {
    width: 20px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: #ffffff;
}

/* ─── FLOATING CART FAB ─── */
.cart-fab {
    position: absolute;
    bottom: 24px;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(20, 20, 25, 0.95) 0%, rgba(10, 10, 15, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(224, 83, 60, 0.25);
    border-radius: var(--border-radius-lg);
    padding: 10px 16px;
    z-index: 100;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), var(--shadow-glow);
    animation: slideUpFloating 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFloating {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cart-fab-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
}

.cart-fab-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #ff795d 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #ffffff;
    position: relative;
    box-shadow: var(--shadow-glow);
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ffffff;
    color: var(--accent);
    font-size: 10px;
    font-weight: 900;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 3px;
    border: 1px solid var(--accent);
}

.cart-fab-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin: 0 12px;
}

.cart-fab-label {
    font-size: 10px;
    color: var(--muted);
    font-weight: 600;
}

.cart-fab-total {
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
}

.cart-fab-arrow {
    font-size: 18px;
    color: var(--accent);
}

/* ─── BOTTOM SHEETS & MODALS ─── */
.sheet {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    visibility: hidden;
    transition: visibility var(--transition-medium);
}

.sheet.open {
    visibility: visible;
}

.sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.sheet.open .sheet-backdrop {
    opacity: 1;
}

.sheet-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    max-height: 85dvh;
    background: #09090c;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    transform: translateY(100%);
    transition: transform var(--transition-medium) cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    z-index: 510;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.sheet.open .sheet-panel {
    transform: translateY(0);
}

.sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 8px auto 4px auto;
    flex-shrink: 0;
}

.sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sheet-head h3 {
    font-size: 15px;
    font-weight: 800;
}

/* Cart Specific */
.cart-table-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 12px;
}

.cart-table-row i {
    color: var(--accent);
    font-size: 16px;
}

.cart-table-row select {
    background: #000000;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}

.cart-items-wrap {
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 10px;
    border-radius: var(--border-radius-md);
}

.cart-item-img {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    background: #09090c;
    flex-shrink: 0;
}

.cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cart-item-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
}


.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--muted);
    text-align: center;
    gap: 10px;
}

.cart-empty i {
    font-size: 36px;
    color: rgba(255, 255, 255, 0.05);
}

.cart-notes-wrap {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.cart-notes-wrap label {
    display: block;
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 4px;
}

.cart-notes-wrap textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius-sm);
    color: #ffffff;
    padding: 8px;
    font-size: 12px;
    resize: none;
    font-family: inherit;
    outline: none;
}

.cart-notes-wrap textarea:focus {
    border-color: var(--accent);
}

.cart-summary {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.01);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
}

.summary-row.total {
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
}

.cart-actions {
    padding: 12px 20px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-send-kitchen {
    background: linear-gradient(135deg, var(--accent) 0%, #d83d25 100%);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(224, 83, 60, 0.3);
    transition: all var(--transition-fast);
}

.btn-send-kitchen:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(224, 83, 60, 0.4);
}

.btn-send-kitchen:active {
    transform: scale(0.98);
}

/* ─── ITEM DETAILS SHEET ─── */
.item-panel {
    position: absolute;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    width: calc(100% - 24px);
    height: auto;
    max-height: calc(82dvh - env(safe-area-inset-bottom, 0px));
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(calc(100% + 34px + env(safe-area-inset-bottom, 0px)));
    overflow-y: auto;
    background: rgba(10, 10, 13, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.85), 0 0 20px rgba(224, 83, 60, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sheet.open .item-panel {
    transform: translateY(0);
}

.item-modal-close {
    position: absolute;
    top: 16px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.item-modal-close:hover {
    background: rgba(224, 83, 60, 0.8);
    transform: scale(1.05);
}

[dir="rtl"] .item-modal-close { left: 16px; right: auto; }
[dir="ltr"] .item-modal-close { right: 16px; left: auto; }

.modal-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #09090c;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-body h2 {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.modal-desc {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-inline-start: 3px solid var(--accent);
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(224, 83, 60, 0.2);
}

.modal-qty-wrap {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    padding: 2px;
}

.qty-btn.minus, .qty-btn.plus {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.qty-btn.minus:hover, .qty-btn.plus:hover {
    background: rgba(255, 255, 255, 0.08);
}

.qty-btn.minus:active, .qty-btn.plus:active {
    transform: scale(0.9);
}

.modal-qty-wrap .qty-val {
    width: 36px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    color: #ffffff;
}

.btn-add-modal {
    background: linear-gradient(135deg, var(--accent) 0%, #ff795d 100%);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(224, 83, 60, 0.35);
    margin-top: 16px;
    transition: opacity var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-add-modal:hover {
    box-shadow: 0 12px 28px rgba(224, 83, 60, 0.45);
    transform: translateY(-1px);
}

.btn-add-modal:active {
    transform: translateY(1px) scale(0.98);
}

/* ─── KITCHEN DASHBOARD MODAL ─── */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    visibility: hidden;
    transition: visibility var(--transition-medium);
}

.modal.open {
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.modal.open .modal-backdrop {
    opacity: 1;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    height: 85%;
    background: #09090b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transition: all var(--transition-medium) cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
    z-index: 2010;
}

.modal.open .modal-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: #0d0d10;
}

.modal-header h2 {
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-body {
    padding: 12px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kitchen-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 8px;
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.stat-card h3 {
    font-size: 18px;
    font-weight: 800;
}

.stat-card span {
    font-size: 9px;
    color: var(--muted);
}

.stat-card.preparing h3 { color: var(--accent); }
.stat-card.completed h3 { color: var(--success); }

.kitchen-columns {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.kitchen-col {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
    display: flex;
    flex-direction: column;
    max-height: 200px;
}

.col-title {
    font-size: 11px;
    font-weight: 800;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    gap: 4px;
}

.orders-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex-grow: 1;
}

.k-order-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.k-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
    padding-bottom: 4px;
    font-size: 11px;
}

.k-order-table { font-weight: 800; color: var(--accent); }
.k-order-time { color: var(--muted); }

.k-order-items {
    font-size: 10px;
    color: #e2e8f0;
}

.k-order-item-row { margin-bottom: 2px; }

.k-order-notes {
    font-size: 9px;
    color: var(--gold);
    background: rgba(214, 166, 85, 0.06);
    padding: 2px 4px;
    border-radius: 2px;
}

.k-order-actions {
    display: flex;
    gap: 4px;
}

.k-btn {
    flex: 1;
    border: none;
    padding: 4px;
    border-radius: 2px;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.k-btn-primary { background: var(--accent); color: #ffffff; }
.k-btn-success { background: var(--success); color: #ffffff; }
.k-btn-danger { background: rgba(255, 255, 255, 0.05); color: var(--muted); }

.btn-dashboard-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--muted);
    padding: 8px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 20px auto;
}

/* ─── TOASTS ─── */
.toast {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-accent);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: var(--border-radius-xl);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6), var(--shadow-glow);
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast i {
    color: var(--success);
    font-size: 16px;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(224, 83, 60, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(224, 83, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(224, 83, 60, 0); }
}

.cart-fab-icon {
    animation: pulseGlow 2s infinite;
}

/* ─── FLOATING WAITER / CAPTAIN CALLS ─── */
.floating-call-buttons {
    display: none;
    position: fixed;
    bottom: 95px;
    left: 16px;
    flex-direction: column;
    gap: 10px;
    z-index: 400;
}

.call-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: all var(--transition-fast);
}

.call-btn span {
    font-size: 8px;
    font-weight: 700;
    margin-top: -2px;
    font-family: var(--font-ar);
}

.call-btn.waiter {
    background: linear-gradient(135deg, #1d61b4 0%, #3b82f6 100%);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.call-btn.captain {
    background: linear-gradient(135deg, #b46d1d 0%, #f59e0b 100%);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.call-btn:active {
    transform: scale(0.92);
}

/* ─── SCREEN: TABLE SELECTOR STYLES ─── */
.table-selection-card {
    width: calc(100% - 48px);
    max-width: 320px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-lg);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-top: -20px; /* Slight optical adjustment */
}

.table-selection-title {
    font-size: 20px;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
    margin: 0;
}

.table-selection-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin: 0 -8px;
    line-height: 1.5;
}

.table-select-wrapper {
    position: relative;
    width: 100%;
    margin-top: 8px;
}

.table-select-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: var(--accent);
    pointer-events: none;
    z-index: 2;
}

/* Adjust positions based on direction */
html[dir="rtl"] .table-select-icon {
    right: 16px;
}
html[dir="ltr"] .table-select-icon {
    left: 16px;
}

.premium-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    outline: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
}

/* Padding based on dir */
html[dir="rtl"] .premium-select {
    padding: 14px 48px 14px 20px;
}
html[dir="ltr"] .premium-select {
    padding: 14px 20px 14px 48px;
}

/* Premium chevron/arrow for select dropdown */
.table-select-wrapper::after {
    content: '\ebbd'; /* boxicons chevron-down */
    font-family: 'boxicons' !important;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 2;
}

html[dir="rtl"] .table-select-wrapper::after {
    left: 16px;
}
html[dir="ltr"] .table-select-wrapper::after {
    right: 16px;
}

.premium-select:focus {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    background: rgba(0, 0, 0, 0.7);
}

.premium-select option {
    background: #0a0a0d;
    color: #ffffff;
    padding: 12px;
}

.premium-confirm-btn {
    width: 100%;
    background: var(--accent);
    border: none;
    border-radius: var(--border-radius-md);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(224, 83, 60, 0.3);
    margin-top: 8px;
}

.premium-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224, 83, 60, 0.5);
    background: #f1644c;
}

.premium-confirm-btn:active {
    transform: translateY(0);
}

.confirm-icon {
    font-size: 20px;
}

/* ─── FEATURED PROMO CATEGORY CARD ─── */
.category-card.featured-promo {
    grid-column: span 2;
    aspect-ratio: 2.2 / 1;
    position: relative;
    border-color: rgba(224, 83, 60, 0.4);
    box-shadow: 0 0 15px rgba(224, 83, 60, 0.2);
}

.promo-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

.category-card.featured-promo .category-card-info {
    z-index: 2;
}

.category-card.featured-promo::before {
    z-index: 1; /* Dark overlay sits between video and text */
}
