/* =========================================
   VARIABLES & RESET — قعب Coffee
   ========================================= */
:root {
    /* Earthy Olive — Default Theme */
    --primary: #706D54;
    --secondary: #A08963;
    --tertiary: #C9B194;
    --neutral: #DBDBDB;
    --bg-main: #F5F2EC;
    --bg-card: #FFFFFF;
    --bg-nav: rgba(245, 242, 236, 0.88);
    --text-primary: #2C2A22;
    --text-secondary: #706D54;
    --accent: #A08963;
    --accent-dark: #706D54;
    --accent-glow: rgba(160, 137, 99, 0.18);
    --border: rgba(112, 109, 84, 0.1);
    --shadow-sm: 0 2px 8px rgba(112, 109, 84, 0.06);
    --shadow-md: 0 4px 20px rgba(112, 109, 84, 0.1);
    --shadow-lg: 0 8px 40px rgba(112, 109, 84, 0.16);
    --radius: 18px;
    --radius-sm: 12px;
    --font: 'Tajawal', sans-serif;
    --hero-gradient: linear-gradient(180deg, #C9B194 0%, #F5F2EC 100%);
    --badge-bg: var(--primary);
    --badge-text: #FFFFFF;
    --price-bg: rgba(160, 137, 99, 0.13);
    --price-text: #706D54;
}

[data-theme="dark"] {
    /* Midnight Coffee — Dark Theme */
    --primary: #C9B194;
    --secondary: #A08963;
    --tertiary: #706D54;
    --neutral: #3A3830;
    --bg-main: #1A1815;
    --bg-card: #252219;
    --bg-nav: rgba(26, 24, 21, 0.92);
    --text-primary: #F0EBE3;
    --text-secondary: #C9B194;
    --accent: #C9B194;
    --accent-dark: #A08963;
    --accent-glow: rgba(201, 177, 148, 0.15);
    --border: rgba(201, 177, 148, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.55);
    --hero-gradient: linear-gradient(180deg, #2E2A22 0%, #1A1815 100%);
    --badge-bg: #C9B194;
    --badge-text: #1A1815;
    --price-bg: rgba(201, 177, 148, 0.12);
    --price-text: #C9B194;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

body {
    font-family: var(--font);
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background 0.4s ease, color 0.4s ease;
}

/* =========================================
   HERO HEADER
   ========================================= */
.hero {
    position: relative;
    text-align: center;
    padding: 50px 20px 36px;
    background: var(--hero-gradient);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Logo */
.logo-wrapper {
    width: 115px;
    height: 115px;
    margin: 0 auto 14px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 6px 28px rgba(112, 109, 84, 0.25);
    animation: fadeInDown 0.6s ease-out;
    background: var(--bg-card);
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-name {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 1.5px;
    animation: fadeInUp 0.6s ease-out 0.15s both;
}

.brand-tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

/* Theme Toggle — stays at hero/logo area */
.toggle-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--accent);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        background 0.3s, color 0.3s;
}

.toggle-btn:active {
    transform: rotate(180deg) scale(0.9);
}

/* =========================================
   STICKY NAVIGATION
   ========================================= */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--bg-nav);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: background 0.3s;
}

.nav-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 10px 12px;
    gap: 6px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link i {
    font-size: 1.15rem;
    transition: transform 0.3s;
}

.nav-link.active {
    color: var(--badge-text);
    background: var(--badge-bg);
}

.nav-link.active i {
    transform: scale(1.15);
}

/* =========================================
   SCROLL TO TOP BUTTON
   ========================================= */
.scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 20px;
    transform: translateY(100px);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(112, 109, 84, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.3s, visibility 0.3s;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:active {
    transform: scale(0.9);
}

/* =========================================
   MAIN CONTENT
   ========================================= */
.main-content {
    padding: 0 14px 36px;
    max-width: 700px;
    margin: 0 auto;
}

/* =========================================
   SECTION TITLES — Badge Style
   ========================================= */
.menu-section {
    padding: 28px 0 8px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 0 4px;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--badge-bg);
    color: var(--badge-text);
    padding: 6px 14px;
    border-radius: 24px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(112, 109, 84, 0.15);
}

.section-badge i {
    font-size: 0.8rem;
}

.title-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* =========================================
   MENU GRID & CARDS
   ========================================= */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.menu-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 0.5s ease-out forwards;
}

.menu-card:active {
    transform: scale(0.97);
}

/* Image Placeholder */
.img-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, var(--accent-glow), transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.img-placeholder .placeholder-icon {
    font-size: 1.8rem;
    opacity: 0.2;
    position: absolute;
}

.img-placeholder .placeholder-text {
    position: relative;
    z-index: 1;
    opacity: 0.6;
    font-size: 0.7rem;
}

/* Actual Image */
.menu-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-main);
}

.menu-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.menu-card:active .menu-image img {
    transform: scale(1.05);
}

/* Card Content */
.card-body {
    padding: 10px 10px 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.item-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 2px;
}

.item-desc {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.item-prices {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: auto;
}

.price-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--price-bg);
    color: var(--price-text);
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.price-chip .currency {
    font-weight: 500;
    font-size: 0.6rem;
    opacity: 0.7;
}

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    margin-top: 24px;
}

.social-links {
    margin-bottom: 12px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 1.2rem;
    margin: 0 6px;
    text-decoration: none;
    transition: transform 0.3s, background 0.3s;
}

.social-icon:active {
    transform: scale(0.9);
    background: var(--primary);
    color: white;
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.daoob-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    transition: opacity 0.3s;
}

.daoob-link:hover,
.daoob-link:active {
    opacity: 0.7;
    text-decoration: underline;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger card animations */
.menu-card:nth-child(1) {
    animation-delay: 0.05s;
}

.menu-card:nth-child(2) {
    animation-delay: 0.10s;
}

.menu-card:nth-child(3) {
    animation-delay: 0.15s;
}

.menu-card:nth-child(4) {
    animation-delay: 0.20s;
}

.menu-card:nth-child(5) {
    animation-delay: 0.25s;
}

.menu-card:nth-child(6) {
    animation-delay: 0.30s;
}

.menu-card:nth-child(7) {
    animation-delay: 0.35s;
}

.menu-card:nth-child(8) {
    animation-delay: 0.40s;
}

.menu-card:nth-child(9) {
    animation-delay: 0.45s;
}

.menu-card:nth-child(10) {
    animation-delay: 0.50s;
}

.menu-card:nth-child(11) {
    animation-delay: 0.55s;
}

.menu-card:nth-child(12) {
    animation-delay: 0.60s;
}

.menu-card:nth-child(13) {
    animation-delay: 0.65s;
}

.menu-card:nth-child(14) {
    animation-delay: 0.70s;
}

.menu-card:nth-child(15) {
    animation-delay: 0.75s;
}

.menu-card:nth-child(16) {
    animation-delay: 0.80s;
}

/* =========================================
   DESKTOP ENHANCEMENTS (600px+)
   ========================================= */
@media (min-width: 600px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .hero {
        padding: 64px 20px 44px;
    }

    .logo-wrapper {
        width: 140px;
        height: 140px;
    }

    .brand-name {
        font-size: 2.8rem;
    }

    .item-name {
        font-size: 1.05rem;
    }

    .item-desc {
        font-size: 0.82rem;
    }

    .card-body {
        padding: 14px;
    }

    .price-chip {
        font-size: 0.78rem;
        padding: 4px 10px;
    }

    .menu-card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow-lg);
    }

    .menu-card:hover .menu-image img {
        transform: scale(1.08);
    }

    .social-icon:hover {
        transform: translateY(-4px) scale(1.1);
        background: var(--primary);
        color: white;
    }

    .toggle-btn:hover {
        transform: rotate(180deg) scale(1.1);
        box-shadow: 0 0 20px var(--accent-glow);
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 8px 14px;
    }
}