/*
Theme Name: Yomnah QR Menu
Theme URI: https://qrmenu.yomnah.com
Author: Yomnah
Description: Custom theme for Yomnah QR Menu
Version: 1.0
Text Domain: yomnah
*/

:root {
    /* Colors */
    --primary-color: #2563EB; /* Royal Blue */
    --primary-dark: #1E40AF;
    --secondary-color: #10B981; /* Emerald Green */
    --secondary-dark: #059669;
    --accent-color: #F59E0B; /* Amber */
    --text-dark: #111827;
    --text-medium: #4B5563;
    --text-light: #9CA3AF;
    --bg-light: #F9FAFB;
    --bg-white: #FFFFFF;
    --border-color: #E5E7EB;
    
    /* Typography */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Spacing */
    --container-width: 1200px;
    --section-padding: 80px 20px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.text-center { text-align: center; }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }

.w-full { width: 100%; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* Robust Grid Utilities (Backup for inline styles) */
.responsive-grid-2 { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: center; }
.responsive-grid-3 { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: center; align-items: flex-start; }

.responsive-grid-2 > *, .responsive-grid-3 > * {
    flex: 1 1 300px; /* Grow, shrink, base width */
    max-width: 100%;
}

@media (max-width: 768px) {
    .responsive-grid-2, .responsive-grid-3 {
        flex-direction: column;
    }
    .responsive-grid-2 > *, .responsive-grid-3 > * {
        width: 100%;
    }
}

.section {
    padding: var(--section-padding);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: white;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--bg-light);
    border-color: var(--text-light);
}

/* Header */
.site-header {
    background-color: white;
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

/* Adjust header for WP Admin Bar */
.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

.site-header .logo img {
    height: 75px;
    width: auto;
    max-width: none;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
    /* WP Menu Support */
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin: 0;
    padding: 0;
}

.nav-links a:not(.btn),
.nav-links li a:not(.btn) {
    font-weight: 500;
    color: var(--text-medium);
}
.nav-links a:not(.btn):hover,
.nav-links li a:not(.btn):hover {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-md);
        z-index: 999;
    }
    /* WP Menu Mobile Fixes */
    .nav-links li {
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }
    
    .nav-links.active {
        display: flex;
    }
    .mobile-menu-btn {
        display: block;
    }
    
    /* Mobile Typography Adjustments */
    .hero-content h1 {
        font-size: 1.8rem !important; /* Significantly reduced */
        line-height: 1.2;
    }
    .section-title h2 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
    .hero-content p {
        font-size: 1rem !important;
    }
    .hero {
        padding-top: 120px; /* Less top padding on mobile */
        padding-bottom: 40px;
    }
}

/* Footer */
.site-footer {
    background-color: #1F2937;
    color: white;
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-col h4 {
    margin-bottom: 20px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: #9CA3AF;
}
.footer-col a:hover {
    color: white;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Hero Section (Index) */
.hero {
    padding-top: 160px;
    padding-bottom: 80px;
    background: linear-gradient(to bottom, #EFF6FF, white);
}
.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}
.hero-content p {
    font-size: 1.25rem;
    color: var(--text-medium);
    margin-bottom: 2.5rem;
}
.hero-image {
    position: relative;
}
.hero-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* Feature Cards (Index) */
.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
    border: 1px solid transparent;
}
.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}
.icon-box {
    width: 60px;
    height: 60px;
    background: #EFF6FF;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* Pricing Page */
.price-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.price-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.price-card.featured {
    border: 2px solid var(--primary-color);
    background: #EFF6FF;
    position: relative;
}
.price-card .btn {
    margin-top: auto;
}
.badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}
.table-container {
    overflow-x: auto;
    margin-top: 4rem;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
th:first-child, td:first-child {
    text-align: left;
    font-weight: 600;
}
.check { color: var(--secondary-color); }
.cross { color: #D1D5DB; }

/* Demo Menu Page */
body.page-demo-menu {
    background-color: #E5E7EB; /* Darker bg for desktop to highlight phone */
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

body.page-demo-menu.rtl .back-to-home i {
    transform: rotate(180deg);
    margin-right: 0;
    margin-left: 0.5rem;
}

body.page-demo-menu.rtl .restaurant-info {
    text-align: right;
}

body.page-demo-menu.rtl .item-details {
    padding-right: 0;
    padding-left: 15px;
}

body.page-demo-menu.rtl .add-btn {
    right: auto;
    left: -10px;
}

body.page-demo-menu.rtl .sticky-cart {
    flex-direction: row;
}

body.page-demo-menu.rtl .cart-count {
    margin-right: 0;
    margin-left: 10px;
}

.phone-wrapper {
    width: 100%;
    max-width: 414px; /* iPhone Max width */
    background: white;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    padding-bottom: 80px; /* Space for sticky cart */
}

/* Menu Header */
.menu-header {
    background: white;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.restaurant-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.restaurant-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #eee;
    object-fit: cover;
}
.restaurant-name h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-dark);
}
.restaurant-name p {
    margin: 0;
    font-size: 0.8rem;
    color: #6B7280;
}

/* Categories */
.categories-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none; /* Firefox */
}
.categories-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}
.cat-pill {
    padding: 8px 16px;
    background: #F3F4F6;
    border-radius: 20px;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4B5563;
    cursor: pointer;
    transition: all 0.2s;
}
.cat-pill.active {
    background: var(--text-dark);
    color: white;
}

/* Menu Items */
.menu-section {
    padding: 20px;
}
.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.menu-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid #F3F4F6;
    padding-bottom: 20px;
}
.item-details {
    flex: 1;
    padding-right: 15px;
}
.item-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-dark);
}
.item-desc {
    font-size: 0.85rem;
    color: #6B7280;
    margin-bottom: 10px;
    line-height: 1.4;
}
.item-price {
    font-weight: 600;
    color: var(--text-dark);
}
.item-image {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    background: #F3F4F6;
    position: relative;
}
.add-btn {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
}

/* Sticky Cart */
.sticky-cart {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 374px;
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    z-index: 200;
}
.cart-count {
    background: white;
    color: var(--primary-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 10px;
}

.back-to-home {
    position: fixed;
    top: 20px;
    left: 20px;
    background: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: none;
}
@media (min-width: 800px) {
    .back-to-home { display: block; }
}

/* Login Page */
body.page-login {
    background-color: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}
.auth-card {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
}
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}
.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.lang-switcher-container {
    position: absolute;
    top: 20px;
    right: 20px;
}

/* Register Page */
body.page-register {
    background-color: #F3F4F6;
    padding: 40px 20px;
    position: relative;
}
.steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}
.steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #E5E7EB;
    z-index: -1;
}
.step {
    background: white;
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid #E5E7EB;
    color: #9CA3AF;
    font-weight: 600;
}
.step.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #EFF6FF;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.plan-summary {
    background: #F9FAFB;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.payment-method {
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
}
.payment-method.selected {
    border-color: var(--primary-color);
    background: #EFF6FF;
}
.payment-method img {
    height: 30px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .steps { font-size: 0.8rem; }
}
