@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

:root {
    --bg-main: #01120b; /* Very dark emerald */
    --bg-surface: #021a11; /* Dark emerald surface */
    --bg-glass: rgba(2, 26, 17, 0.6);
    --accent: #F59E0B; /* Octane Gold */
    --accent-hover: #D97706;
    
    --text-main: #FFFFFF;
    --text-muted: #9CA3AF;
    
    --font-body: 'Tajawal', system-ui, -apple-system, sans-serif;
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent; /* Remove blue tap highlight on mobile */
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Splash Screen --- */
.splash-screen {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #022518 0%, var(--bg-main) 100%);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: scaleUpSplash 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleUpSplash {
    0% { transform: scale(0.8); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.splash-logo-wrap {
    width: 140px;
    height: 140px;
    margin-bottom: 25px;
    border-radius: 50%;
    position: relative;
    background: #000; /* Pure black to host the logo crop perfectly */
    box-shadow: 0 0 50px rgba(245, 158, 11, 0.4); /* Gold Glow */
}

.splash-img {
    width: 115%;
    height: 115%;
    object-fit: cover;
    clip-path: circle(43% at 50% 50%);
    -webkit-clip-path: circle(43% at 50% 50%);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.splash-title {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 6px;
    margin-bottom: 5px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUpText 1s forwards 0.5s;
}

.splash-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUpText 1s forwards 0.7s;
}

@keyframes fadeUpText {
    to { opacity: 1; transform: translateY(0); }
}

.loader {
    width: 60px;
    height: 3px;
    background: rgba(245, 158, 11, 0.15);
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    opacity: 0;
    animation: fadeUpText 1s forwards 1s;
}

.loader::after {
    content: '';
    position: absolute;
    left: -50%;
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: loadingBar 1.5s infinite ease-in-out;
}

@keyframes loadingBar {
    0% { left: -50%; }
    100% { left: 100%; }
}

@keyframes pulseLogo {
    0% { transform: scale(0.96); opacity: 0.9; }
    100% { transform: scale(1.04); opacity: 1; box-shadow: 0 0 50px rgba(245, 158, 11, 0.8); }
}

@keyframes pulseLogoScale {
    0% { transform: scale(0.96); opacity: 0.9; }
    100% { transform: scale(1.04); opacity: 1; }
}

/* --- App Container --- */
.app-container {
    opacity: 0;
    transition: opacity 0.8s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container.visible {
    opacity: 1;
}

/* --- App Header --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 10px;
    background: var(--bg-main);
}

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

.header-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid rgba(245, 158, 11, 0.3);
    object-fit: cover;
    clip-path: circle(43% at 50% 50%);
    -webkit-clip-path: circle(43% at 50% 50%);
    transform: scale(1.1); /* Zoom slightly to remove edges */
}

.header-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 1px;
}

.header-icon {
    font-size: 1.5rem;
    color: var(--text-main);
    background: var(--bg-surface);
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition-fast);
}

.header-icon:active {
    transform: scale(0.9);
}

/* --- Premium Floating Navigation --- */
.nav-container {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 15px 15px 5px;
    background: linear-gradient(to bottom, var(--bg-main) 80%, transparent 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chips-nav {
    display: flex;
}

.category-chips {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    list-style: none;
    gap: 12px;
    padding: 5px 5px 15px;
}
.category-chips::-webkit-scrollbar { display: none; }

.category-item {
    padding: 8px 16px;
    font-size: 0.95rem; /* Significantly reduced font size */
    font-weight: 700; /* Regular bold */
    color: var(--text-muted);
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    background: rgba(2, 26, 17, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.category-item.active {
    color: var(--accent);
    background: var(--bg-surface);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.15);
    transform: translateY(-2px);
}

/* --- Animated Background Orbs --- */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.3;
    animation: floatOrb 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: rgba(245, 158, 11, 0.15); /* Gold */
    top: -50px;
    right: -100px;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: rgba(2, 44, 34, 0.8); /* Lighter Emerald */
    bottom: 20%;
    left: -50px;
    animation-delay: -10s;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-30px, 50px) scale(1.2); }
}

/* --- Main Content & List --- */
.main-content {
    flex: 1;
    padding: 10px 0 40px; /* Removed side padding to allow full width sections */
}

/* --- Premium Hero Section --- */
.premium-hero {
    position: relative;
    width: calc(100% - 40px);
    margin: 0 auto 30px;
    height: 220px;
    border-radius: 24px;
    overflow: hidden;
    background: var(--bg-surface);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    border: 1px solid rgba(245, 158, 11, 0.15);
    animation: slideUp 0.8s forwards 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(20px);
}

.hero-image-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: panImage 15s infinite alternate linear;
}

@keyframes panImage {
    0% { transform: scale(1.1) translateX(0); }
    100% { transform: scale(1.1) translateX(-5%); }
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.65) contrast(1.1);
    transition: var(--transition-smooth);
}

.premium-hero:hover .hero-img {
    transform: scale(1.05);
}

.hero-gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--bg-main) 10%, rgba(1, 18, 11, 0.4) 60%, transparent 100%);
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    width: fit-content;
}

.hero-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.2;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8);
    max-width: 60%;
}

/* --- Dynamic Category Header --- */
.category-header {
    padding: 0 20px 15px;
    margin-bottom: 5px;
}

.cat-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 5px;
    animation: fadeIn 0.4s ease-out;
}

.cat-line {
    height: 3px;
    width: 40px;
    background: var(--accent);
    border-radius: 3px;
    transition: var(--transition-smooth);
    animation: expandLine 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes expandLine {
    from { width: 0; }
    to { width: 40px; }
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 25px; /* Increased gap for overlapping images */
    padding: 10px 20px 20px;
}

.list-item {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-surface) 0%, #031c12 100%);
    border-radius: 20px;
    padding: 15px 95px 15px 15px; /* Leave space on the right for the overlapping image */
    cursor: pointer;
    transition: var(--transition-smooth);
    opacity: 0;
    transform: translateY(15px);
    animation: slideUp 0.5s forwards ease-out;
    border: 1px solid rgba(245, 158, 11, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

@keyframes slideUp {
    to { opacity: 1; transform: translateY(0); }
}

.list-item:hover {
    transform: translateY(-5px);
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 15px 40px rgba(245, 158, 11, 0.15);
}

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

.item-img-wrap {
    position: absolute;
    right: -15px; /* Pulls the image outside the card on the right for RTL */
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%; /* Circular image for overlapping */
    flex-shrink: 0;
    overflow: hidden;
    background: #000;
    border: 3px solid var(--accent);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    transition: var(--transition-smooth);
}

.list-item:hover .item-img-wrap {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4);
}

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

.item-badge-small {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--accent);
    color: #000;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 8px;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.item-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 2px;
}

.item-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.2;
}

.item-price {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--accent);
    margin-top: auto;
}

.item-price small {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.menu-footer {
    text-align: center;
    padding: 30px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Bottom-Sheet Modal --- */
.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: flex-end; /* Align sheet to bottom */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.bottom-sheet-content {
    width: 100%;
    background: var(--bg-main);
    border-radius: 30px 30px 0 0;
    max-height: 45vh; /* Drastically reduced to make it very compact */
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.8);
    position: relative;
}

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

/* Internal Sheet Animations */
.bottom-sheet-overlay.active .sheet-hero {
    opacity: 0;
    transform: translateY(15px);
    animation: slideUp 0.5s ease-out forwards 0.2s;
}

.bottom-sheet-overlay.active .sheet-details {
    opacity: 0;
    transform: translateY(15px);
    animation: slideUp 0.5s ease-out forwards 0.3s;
}

.bottom-sheet-overlay.active .sheet-action {
    opacity: 0;
    transform: translateY(15px);
    animation: slideUp 0.5s ease-out forwards 0.4s;
}

.drag-handle {
    width: 40px;
    height: 5px;
    background: var(--bg-surface);
    border-radius: 5px;
    margin: 12px auto;
}

.close-btn {
    position: absolute;
    top: 15px;
    left: 20px; /* Position left for Arabic RTL */
    background: var(--bg-surface);
    color: var(--text-main);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    z-index: 10;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.sheet-scrollable {
    overflow-y: auto;
    padding-bottom: 20px;
}

.sheet-hero {
    position: relative;
    width: 100%;
    height: 100px; /* Highly reduced to make it small */
    padding: 0 20px;
    margin-bottom: 15px;
}

.sheet-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.sheet-badge {
    position: absolute;
    bottom: -12px;
    right: 40px;
    background: var(--accent);
    color: #000;
    font-weight: 900;
    padding: 6px 15px;
    border-radius: 12px;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
    display: none;
}

.sheet-details {
    padding: 0 20px;
}

.sheet-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.sheet-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-main);
    flex: 1;
}

.sheet-price-box {
    text-align: left;
}

.sheet-price {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent);
}

.sheet-price-box small {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sheet-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.sheet-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.8);
    margin-bottom: 25px;
    background: var(--bg-surface);
    padding: 15px;
    border-radius: 16px;
}

.sheet-meta {
    display: flex;
    gap: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-main);
}

.meta-item ion-icon {
    color: var(--accent);
    font-size: 1.1rem;
}

.sheet-action {
    padding: 15px 20px 25px; /* Extra bottom padding for iOS home indicator */
    background: var(--bg-main);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.order-btn {
    width: 100%;
    background: var(--accent);
    color: #000;
    border: none;
    padding: 18px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    transition: var(--transition-fast);
}

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