/* =====================================================
   MIRDEX DIGITAL MENU — Customer-Facing Dark Theme
   ===================================================== */

:root {
    --bg: #09090b;
    --surface: #18181b;
    --border: #27272a;
    --border-hi: #3f3f46;
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --primary: #f59e0b;        /* Amber — premium warmth for a restaurant */
    --primary-glow: rgba(245, 158, 11, 0.25);
    --radius: 16px;
    --font: 'Outfit', -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

/* ---- HERO ---- */
.hero {
    position: relative;
    height: 38vh;
    min-height: 240px;
    max-height: 420px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 40px;
    padding-left: 20px;
    padding-right: 20px;
}

.hero-overlay {
    position: absolute; inset: 0;
    background-image: var(--hero-bg, url('https://images.unsplash.com/photo-1414235077428-338989a2e8c0?q=80&w=2000&auto=format&fit=crop'));
    background-size: cover;
    background-position: center;
    filter: brightness(0.4);
    transition: background-image 0.4s ease;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    animation: fadeUp 0.8s ease both;
    max-width: 800px;
    width: 100%;
}

.hero-eyebrow {
    font-size: clamp(0.72rem, 1.5vw, 0.85rem);
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 8px;
}

.hero-content h1 {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.15;
    background: linear-gradient(135deg, #fff 30%, #a1a1aa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
    word-break: break-word;
}

.hero-subtitle {
    font-size: clamp(0.85rem, 2vw, 1rem);
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.5px;
    font-weight: 300;
}

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

/* ---- STICKY CATEGORY BAR ---- */
.sticky-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(9, 9, 11, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    width: 100%;
}

.category-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 14px 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}
.category-scroll::-webkit-scrollbar { display: none; }

.cat-pill {
    flex-shrink: 0;
    padding: 8px 18px;
    border-radius: 30px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.cat-pill:hover {
    border-color: var(--border-hi);
    color: var(--text);
}

.cat-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    font-weight: 600;
    box-shadow: 0 0 16px var(--primary-glow);
}

/* ---- MENU MAIN ---- */
.menu-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.item-count {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ---- GRID ---- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.menu-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: fadeIn 0.4s ease both;
}

.menu-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hi);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

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

.card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 200px;
    overflow: hidden;
    background: #121215;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    box-sizing: border-box;
    transition: transform 0.4s ease;
}

.menu-card:hover .card-img-wrap img {
    transform: scale(1.04);
}

.card-img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1c1c1e, #2c2c2e);
    color: #444;
}

.card-img-placeholder svg { width: 48px; height: 48px; }

.card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
}

.card-name {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    flex: 1;
    word-break: break-word;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.45;
    font-weight: 300;
    word-break: break-word;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 6px;
}

.card-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 8px;
    letter-spacing: -0.2px;
}

/* ---- EMPTY STATE ---- */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(40px, 8vw, 80px) 20px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    gap: 16px;
}

.empty-state svg { width: clamp(48px, 8vw, 64px); height: clamp(48px, 8vw, 64px); opacity: 0.3; }
.empty-state p { font-size: clamp(0.95rem, 2vw, 1.1rem); max-width: 400px; }

/* ---- FOOTER ---- */
.menu-footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

.menu-footer strong { color: var(--primary); }

/* ---- RESPONSIVE ---- */
@media (min-width: 1200px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

@media (max-width: 1024px) and (min-width: 681px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .menu-main {
        padding: 28px 20px 50px;
    }
}

@media (max-width: 680px) {
    .hero {
        height: auto;
        min-height: 220px;
        padding-top: 50px;
        padding-bottom: 28px;
    }

    .sticky-bar {
        padding: 0 16px;
    }

    .category-scroll {
        padding: 12px 0;
        gap: 8px;
    }

    .cat-pill {
        padding: 7px 14px;
        font-size: 0.82rem;
    }

    .menu-main {
        padding: 24px 16px 48px;
    }

    .section-header {
        margin-bottom: 20px;
        gap: 12px;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .item-count {
        font-size: 0.8rem;
        padding: 3px 10px;
    }

    .menu-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .menu-card:active {
        transform: scale(0.99);
    }

    .card-body {
        padding: 14px;
    }

    .menu-footer {
        padding: 24px 16px;
        font-size: 0.82rem;
    }
}

@media (max-width: 360px) {
    .sticky-bar {
        padding: 0 10px;
    }
    .menu-main {
        padding: 20px 10px 40px;
    }
    .card-body {
        padding: 12px;
    }
}

/* =====================================================
   CART & ORDERING SYSTEM STYLES
   ===================================================== */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 8px;
}

.btn-add-item {
    background: rgba(245, 158, 11, 0.12);
    color: var(--primary);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.btn-add-item:hover {
    background: var(--primary);
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    background: var(--surface-hi);
    border: 1px solid var(--border-hi);
    border-radius: 20px;
    overflow: hidden;
}

.qty-btn {
    background: none;
    border: none;
    color: var(--text);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: background 0.2s;
}

.qty-btn:hover { background: var(--hover); color: var(--primary); }

.qty-count {
    padding: 0 6px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* Floating Bottom Cart Bar */
.cart-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 460px);
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-hi);
    border-radius: 40px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 158, 11, 0.2);
    z-index: 1000;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from { transform: translate(-50%, 40px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.cart-bar-info {
    display: flex;
    flex-direction: column;
}

.cart-bar-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cart-bar-total {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.btn-cart {
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-cart:hover {
    background: #fbbf24;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

/* Cart Drawer / Modal */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}

@media (min-width: 600px) {
    .drawer-overlay {
        align-items: center;
    }
}

.cart-drawer {
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 600px) {
    .cart-drawer {
        border-radius: 24px;
        max-height: 88vh;
    }
}

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--surface);
}

.drawer-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.drawer-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.drawer-close:hover {
    color: var(--text);
}

/* Scrollable Container */
.cart-drawer-body {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--border-hi) transparent;
}

.cart-drawer-body::-webkit-scrollbar {
    width: 5px;
}

.cart-drawer-body::-webkit-scrollbar-track {
    background: transparent;
}

.cart-drawer-body::-webkit-scrollbar-thumb {
    background: var(--border-hi);
    border-radius: 4px;
}

.cart-items-list {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--surface-hi);
    border: 1px solid var(--border);
    border-radius: 12px;
    gap: 12px;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 2px;
}

.cart-item-price {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.cart-details-form {
    padding: 14px 18px;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.cart-details-form .form-group {
    margin-bottom: 12px;
}

.cart-details-form .form-group:last-child {
    margin-bottom: 0;
}

.cart-details-form label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.cart-details-form input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}

.cart-details-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.cart-drawer-footer {
    flex-shrink: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}

.cart-summary {
    padding: 14px 20px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 600;
}

.cart-summary strong {
    font-size: 1.3rem;
    color: var(--primary);
}

.checkout-actions {
    padding: 10px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-checkout {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-whatsapp {
    background: #25D366;
    color: #fff;
}

.btn-whatsapp:hover {
    background: #20ba59;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
}

.btn-direct {
    background: var(--primary);
    color: #000;
}

.btn-direct:hover {
    background: #fbbf24;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

/* Order Confirmation Dialog */
.order-success-modal {
    text-align: center;
    padding: 28px 20px;
}

.order-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

/* ---- TOAST (bottom) ---- */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 20px;
    border-radius: 40px;
    font-size: 0.92rem;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
    max-width: min(90vw, 440px);
    width: max-content;
    text-align: center;
    word-break: break-word;
}

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

.toast.success { border-color: var(--green, #22c55e); color: var(--green, #22c55e); }
.toast.error { border-color: var(--danger, #ef4444); color: var(--danger, #ef4444); }

/* ---- TOAST TOP (errors & warnings) ---- */
.toast-top {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #1c1010;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 12px 22px;
    border-radius: 40px;
    font-size: 0.92rem;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 99999;
    max-width: min(90vw, 440px);
    width: max-content;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    word-break: break-word;
}

.toast-top::before {
    content: '⚠';
    font-size: 1rem;
    flex-shrink: 0;
}

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