/* =====================================================
    My Order
   ===================================================
   
   👨‍💻 Designer & Developer: Ibrahim Mohamed
   📧 Email: ibra7im.engineer@gmail.com
   📱 Instagram: @ibra7im_mo7amad
   💼 LinkedIn: Ibrahim Mohamed
   🌐 Website: https://www.linkedin.com/in/ibra7im-mo7amed
   🌈 Color System: Premium Gradients & Animations
   ✨ Version: 2.0 - 5 Stars Design Quality
   
   ===================================================== */

/* --- 1. إعدادات الألوان والخطوط الأساسية (محسّنة) --- */
:root {
    --primary: #FF6B35;
    --primary-dark: #E85A1F;
    --primary-light: #FF8E5F;
    --primary-ultra-light: #FFF0E6;
    --dark: #17385b;
    --dark-light: #1a2332;
    --light-bg: #F5F8FC;
    --white: #ffffff;
    --accent: #FFB347;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --gray-100: #183775;
    --gray-200: #34476e;
    --gray-300: #D1D5DB;
    --gray-600: #4B5563;
    --gray-800: #1F2937;
    --shadow: 0 10px 30px rgba(255, 107, 53, 0.12);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.1);
    --shadow-xl: 0 25px 60px rgba(0,0,0,0.15);
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 88px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* make media elements adapt to container width */
img, picture, video, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* fluid container utility */
.container {
    width: 100%;
    max-width: 72rem; /* ~1152px */
    margin: 0 auto;
    padding: 0 1rem;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #f8fafc 0%, #f0f4f8 50%, #e0e8f0 100%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--gray-800);
}

main {
    margin-top: 0;
    padding-top: var(--header-height);
    flex: 1;
}


/* --- 2. الهيدر وشريط التنقل (Navbar) - محسّن --- */
header {
    background: linear-gradient(135deg, #0F1419 0%, #1a2332 50%, #162447 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    border-bottom: 3px solid var(--primary);
}

.navbar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 5%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    z-index: 1000;
}

.logo {
    font-size: 1.75rem;
    font-weight: 900;
    cursor: pointer;
    background: linear-gradient(135deg, #FF6B35, #FF8E5F, #FFB347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    text-shadow: 0 2px 8px rgba(255, 107, 53, 0.1);
}

.logo:hover {
    transform: scale(1.08) rotate(-2deg);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links li {
    color: #E0E0E0;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    padding: 0.75rem 0.5rem; /* larger tap area */
    touch-action: manipulation;
    padding-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-icon {
    font-size: 18px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.nav-links li:hover .nav-icon {
    transform: scale(1.2) rotate(5deg);
}

.nav-links li::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #FF6B35, #FF8E5F);
    transition: width 0.35s ease;
    border-radius: 2px;
}

.nav-links li:hover {
    color: #FFD700;
    transform: translateY(-2px);
}

.nav-links li:hover::after {
    width: 100%;
}

.nav-icons {
    display: flex;
    gap: 1.125rem;
    color: var(--white);
    font-size: 1.375rem;
    align-items: center;
}

.nav-icons i {
    cursor: pointer;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: 10px;
}

.nav-icons i:hover {
    color: var(--primary);
    background: rgba(255, 107, 53, 0.15);
    transform: scale(1.2) rotate(12deg);
    filter: drop-shadow(0 4px 12px rgba(255, 107, 53, 0.4));
}

.cart-icon {
    position: relative;
}

#cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #FF6B35, #FF8E5F);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* --- 3. تصميم الصفحات والحركات - محسّن --- */
.page {
    display: none;
    padding: 45px 8%;
    animation: fadeIn 0.5s ease-in-out;
    min-height: calc(100vh - 80px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 248, 252, 0.95) 100%);
    margin-top: 0;
    border-top: 6px solid var(--primary);
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInCenter {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 10px 30px rgba(255, 107, 53, 0.15); }
    50% { box-shadow: 0 14px 50px rgba(255, 107, 53, 0.35); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes shimmer {
    0%, 100% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes bounce-in {
    0% { transform: scale(0.3); opacity: 0; }
    50% { opacity: 1; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- Prediction Modal Fixes (High-end AI) --- */
#prediction-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.70);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    overflow: hidden;
}

#prediction-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 850px;
    max-height: 85vh;
    overflow-y: auto;
    background: rgba(7, 15, 45, 0.92);
    border-radius: 16px;
    border: 1px solid rgba(130, 132, 250, 0.45);
    box-shadow: 0 0 36px rgba(94, 87, 255, 0.75);
    padding: 20px;
}

#predictionModalChart {
    width: 100% !important;
    height: 350px !important;
    max-height: 350px !important;
    display: block;
}

/* --- 4. الصفحة الرئيسية (Hero Section) - محسّن --- */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    /* fluid padding for responsiveness */
    padding: 3.75rem 3rem;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.08) 0%, rgba(255, 142, 95, 0.04) 100%);
    border-radius: 1.75rem;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
    border-left: 6px solid var(--primary);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
    animation: float 10s ease-in-out infinite;
    pointer-events: none;
}

.hero-section:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.35;
    margin-bottom: 1.5625rem;
    font-weight: 900;
    animation: slideInRight 0.8s ease;
    color: var(--dark);
}

.hero-content {
    flex: 1 1 520px;
    text-align: right;
}

.hero-graphic {
    flex: 0 0 auto;
    max-width: 26.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content h1 span {
    background: linear-gradient(135deg, #FF6B35, #FF8E5F, #FFB347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.1875rem;
    color: #555;
    margin-bottom: 2.1875rem;
    font-weight: 500;
    line-height: 1.85;
}

.hero-graphic img {
    width: 100%;
    max-width: 420px;
    height: auto;
    border-radius: 28px;
    box-shadow: 0 25px 70px rgba(255, 107, 53, 0.25);
    transition: var(--transition);
    animation: float 3s ease-in-out infinite;
}

.hero-graphic img:hover {
    transform: translateY(-15px);
    box-shadow: 0 35px 90px rgba(255, 107, 53, 0.35);
}

/* --- 5. المنيو والكروت - محسّن --- */
.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 40px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--dark), var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    margin: 15px auto 0;
    border-radius: 2px;
}

.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto 35px;
}

.search-wrapper input {
    width: 100%;
    padding: 16px 20px 16px 55px;
    border-radius: 50px;
    border: 2px solid var(--gray-200);
    font-size: 16px;
    transition: var(--transition);
    background: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.2);
    transform: translateY(-3px);
    background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
}

.search-wrapper i {
    position: absolute;
    left: 20px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 20px;
    transition: transform 0.3s ease;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
}

.res-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    border: 2px solid rgba(255, 107, 53, 0.08);
    animation: fadeIn 0.7s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.res-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.res-card:hover {
    transform: translateY(-18px);
    box-shadow: 0 20px 55px rgba(255, 107, 53, 0.2);
    border-color: rgba(255, 107, 53, 0.3);
    animation: pulse-glow 2s infinite;
}

.res-card:hover::before {
    transform: scaleX(1);
}

.res-card:hover img {
    transform: scale(1.15) rotate(2deg);
    filter: brightness(1.1) contrast(1.1);
}

.res-card img {
    width: 100%;
    height: auto;
    max-height: 20rem;
    object-fit: cover;
    transition: var(--transition);
    filter: brightness(1) contrast(1);
}

.res-info {
    padding: 24px;
    text-align: center;
    background: linear-gradient(135deg, white 0%, var(--gray-100) 100%);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: background 0.3s ease;
}

.res-card:hover .res-info {
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
}

/* --- 6. الأزرار - محسّن احترافي --- */
.main-btn, .confirm-btn, .add-btn-card, .auth-btn {
    width: 100%;
    padding: 16px 20px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    border: none !important;
    border-radius: 14px !important;
    cursor: pointer !important;
    background: linear-gradient(135deg, #FF6B35, #FF8E5F) !important;
    color: white !important;
    transition: var(--transition) !important;
    margin-top: 8px !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.35) !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    letter-spacing: 0.5px;
}

.main-btn::before, .confirm-btn::before, .add-btn-card::before, .auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-btn:hover::before, .confirm-btn:hover::before, .add-btn-card:hover::before, .auth-btn:hover::before {
    left: 100%;
}

.main-btn:hover, .add-btn-card:hover {
    background: linear-gradient(135deg, #E85A1F, #FF6B35) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.5) !important;
}

.main-btn:active, .add-btn-card:active {
    transform: translateY(-1px) !important;
}

.confirm-btn {
    background: linear-gradient(135deg, #10B981, #34D399) !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35) !important;
}

.confirm-btn:hover {
    background: linear-gradient(135deg, #059669, #10B981) !important;
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.5) !important;
}

/* --- 7. السلة (Cart) وبيانات العميل --- */
.billing-info {
    background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    margin-top: 24px;
    border: 2px solid #E5E7EB;
}

.billing-info h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--primary);
    font-weight: 800;
    position: relative;
    padding-bottom: 12px;
}

.billing-info h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
}

/* مربعات الإدخال (الحجم الطبيعي 50px) */
input[type="text"], 
input[type="tel"], 
input[type="number"], 
input[type="password"],
textarea, 
select {
    width: 100% !important;
    height: 50px !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
    margin-bottom: 16px !important;
    border: 2px solid #E5E7EB !important;
    border-radius: 12px !important;
    outline: none !important;
    display: block !important;
    background: #FAFAFA !important;
    transition: var(--transition) !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: #1F2937 !important;
}

input[type="text"]::placeholder,
input[type="tel"]::placeholder,
input[type="number"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: #9CA3AF !important;
}

input[type="text"]::-webkit-outer-spin-button,
input[type="text"]::-webkit-inner-spin-button,
input[type="number"] {
    -webkit-appearance: none;
    -moz-appearance: none; /* غيرناها لـ none عشان التحذير يختفي */
    appearance: none;      /* ضيف السطر ده عشان المتصفحات الجديدة */
    margin: 0;
}

/* Cart dark orange theme */
.cart-items {
    display: grid;
    gap: 18px;
}

.cart-item {
    background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
    border: 1px solid rgba(255, 107, 53, 0.18);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.24);
}

.cart-item-image img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-item-content {
    flex: 1;
    min-width: 220px;
}

.cart-item-title {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
}

.cart-item-meta {
    margin: 0 0 14px;
    color: #d1d5db;
    opacity: 0.85;
    font-size: 0.95rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 14px;
    background: #ffb347;
    color: #111827;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(255, 107, 53, 0.24);
}

.qty-value {
    min-width: 44px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #f9fafb;
    font-weight: 700;
}

.cart-item-total {
    text-align: right;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-price {
    color: #ffb347;
    font-size: 1.05rem;
    font-weight: 800;
}

.item-unit {
    color: #d1d5db;
    font-size: 0.95rem;
}

.cart-item-remove {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.08);
    color: #ff8e5f;
    border: 1px solid rgba(255, 107, 53, 0.2);
    padding: 10px 14px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease;
}

.cart-item-remove:hover {
    transform: translateY(-1px);
    background: rgba(255, 107, 53, 0.16);
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #d1d5db;
}

.cart-empty i {
    font-size: 64px;
    color: #ff8e5f;
    margin-bottom: 18px;
}

.cart-empty h3 {
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 24px;
}

.cart-empty p {
    margin-bottom: 22px;
    color: #cbd5e1;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b35, #ff8e5f);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(255, 107, 53, 0.24);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    color: #f8fafc;
}

.order-summary-box {
    background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.order-summary-box > div {
    padding: 24px;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary) !important;
    background-color: #FFFFFF !important;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.15) !important;
    transform: translateY(-2px) !important;
}

.total-box {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8E5F 50%, #FFB347 100%);
    padding: 28px 20px;
    border-radius: 16px;
    text-align: center;
    font-size: 28px;
    font-weight: 900;
    margin: 28px 0;
    border: none;
    color: white;
    box-shadow: 0 12px 40px rgba(255, 107, 53, 0.35);
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.total-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.6s ease;
    z-index: 1;
}

.total-box:hover::before {
    left: 100%;
}

.total-box span {
    position: relative;
    z-index: 2;
}

.confirm-btn {
    background: linear-gradient(135deg, var(--success), #2ECC71) !important;
    font-size: 18px !important;
}


/* --- 8. الأدمن والتقييمات --- */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

/* تثبيت لوحة الإضافة في لوحة الإدارة لتبقى ظاهرة عند التمرير */
.admin-grid .add-item-form {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    align-self: start;
}

.add-item-form, .current-items-manage {
    background: linear-gradient(135deg, white 0%, #F9FAFB 100%);
    padding: 36px;
    border-radius: 20px;
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 107, 53, 0.12);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.add-item-form::before, .current-items-manage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--accent));
}

.add-item-form:hover, .current-items-manage:hover {
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 107, 53, 0.25);
    transform: translateY(-5px);
}

/* --- 9. قسم المميزات (About) --- */
.features-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.feature-box {
    background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
    padding: 35px 25px;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    transition: var(--transition);
    border: 2px solid rgba(255, 107, 53, 0.1);
    position: relative;
    overflow: hidden;
}

.feature-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 45px rgba(255, 107, 53, 0.15);
    border-color: rgba(255, 107, 53, 0.3);
}

.feature-box:hover::before {
    transform: scaleX(1);
}

.feature-box i {
    font-size: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    display: block;
    transition: transform 0.3s ease;
}

.feature-box:hover i {
    transform: scale(1.15) rotate(-5deg);
}

/* --- Branch / Locations cards (refactor from inline styles) --- */
.branch-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-left: 5px solid var(--primary);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    cursor: pointer;
}

.branch-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 800;
}

.branch-card p {
    color: #6B7280;
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 14px;
}

.branch-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 15px 50px rgba(255, 107, 53, 0.2);
}

/* --- 12. Branches row: centered Flexbox, equal-size cards, horizontal scroll on overflow --- */
.branches-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* align cards to top so they have equal vertical start */
    justify-content: center; /* keep group centered in the page */
    gap: 24px; /* fixed spacing between cards */
    padding: 12px 8px; /* breathing room */
    overflow-x: auto; /* allow horizontal scrolling if there are more cards than fit */
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity; /* smooth snap behavior when scrolling */
}

.branches-row::-webkit-scrollbar { height: 10px; }
.branches-row::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 8px; }

/* Fixed-size cards: do NOT use width:100% on .branch-card */
.branches-row .branch-card {
    flex: 0 0 320px; /* fixed width, no shrinking */
    width: 320px; /* ensure exact width */
    height: 420px; /* fixed height so all cards match exactly */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    scroll-snap-align: center; /* card snaps to center when scrolling */
}

/* Make sure image area keeps exact height and doesn't shrink */
.branches-row .branch-img { height: 180px; flex: 0 0 180px; }
.branches-row .branch-img img { height: 100%; width: 100%; object-fit: cover; }

/* Content area expands to fill remaining height and keeps layout consistent */
.branches-row .branch-card > h3,
.branches-row .branch-card > p { margin: 0 0 10px 0; }
.branches-row .branch-card .branch-content { padding: 14px; flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-start; }

/* Note: Branch responsive styles moved to comprehensive media queries above */

/* Branch image styling */
.branch-img {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 14px;
}
.branch-img img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    border-radius: 12px;
}
.branch-img img:hover, .branch-img img:focus {
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.25);
}
.branch-img .interactive-img { cursor: zoom-in; }

/* --- 10. الفوتر وتأثير الثلج --- */
footer {
    background: linear-gradient(135deg, #0F1419 0%, #1a2332 50%, #162447 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    font-size: 14px;
    border-top: 2px solid rgba(255, 107, 53, 0.2);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}

footer a {
    color: #FF8E5F;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 600;
}

footer a:hover {
    color: #FFB347;
    text-decoration: underline;
}

.snowflake {
    color: white;
    position: fixed;
    top: -5%;
    z-index: 9999;
    pointer-events: none;
    animation: fall linear infinite;
}

@keyframes fall {
    to { transform: translateY(105vh); }
}

/* --- 11. الموبايل (Responsive) --- */

/* Mobile First: Extra Small Screens (320px - 480px) */
@media (max-width: 480px) {
    :root {
        --header-height: 70px;
    }
    
    body {
        font-size: 14px;
    }
    
    main {
        padding-top: var(--header-height);
    }
    
    .navbar {
        padding: 12px 3%;
        gap: 8px;
    }
    
    .logo {
        font-size: 18px;
        gap: 5px;
    }
    
    .logo span {
        display: none;
    }
    
    .nav-links {
        display: none;
    }
    
    .navbar {
        justify-content: space-between;
    }
    
    .nav-icons {
        display: flex;
        align-items: center;
        gap: 1rem;
        font-size: 1.1rem;
    }

    .navbar-brand {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .nav-icons > div {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 14px;
        color: white;
    }

    .nav-icons i {
        font-size: 1.25rem;
    }

    .admin-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.06);
        color: white;
        cursor: pointer;
        transition: var(--transition);
    }

    .cart-icon {
        position: relative;
    }

    #cart-count {
        top: -8px;
        right: -8px;
        font-size: 11px;
        padding: 4px 7px;
    }

    /* Hamburger Menu Styles */
    .hamburger-menu {
        display: flex;
        flex-direction: column;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px 12px;
        gap: 5px;
        z-index: 1001;
        transition: all 0.3s ease;
    }
    
    .hamburger-menu span {
        width: 24px;
        height: 3px;
        background: #FF6B35;
        border-radius: 2px;
        transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .hamburger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(10px, 10px);
    }
    
    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    /* Mobile Navigation Overlay */
    .mobile-nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-nav-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Mobile Navigation Menu */
    .mobile-nav-menu {
        position: fixed;
        right: -100%;
        top: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
        z-index: 1000;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
    }
    
    .mobile-nav-menu.active {
        right: 0;
    }
    
    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 24px 20px;
        border-bottom: 3px solid #FF6B35;
        background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 107, 53, 0.05));
        flex-shrink: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    .mobile-nav-header h3 {
        margin: 0;
        color: #FF6B35;
        font-size: 22px;
        font-weight: 900;
        letter-spacing: 0.5px;
    }
    
    .close-menu {
        background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 107, 53, 0.1));
        border: 2px solid #FF6B35;
        color: #FF6B35;
        font-size: 28px;
        cursor: pointer;
        transition: all 0.3s ease;
        padding: 4px 8px;
        border-radius: 8px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }
    
    .close-menu:hover {
        transform: rotate(90deg) scale(1.1);
        background: linear-gradient(135deg, rgba(255, 107, 53, 0.3), rgba(255, 107, 53, 0.2));
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    }
    
    .mobile-nav-links {
        list-style: none;
        padding: 8px 0;
        margin: 0;
        flex: 1;
        overflow-y: auto;
    }
    
    .mobile-nav-links li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    .mobile-nav-link {
        display: flex;
        align-items: center;
        padding: 16px 20px;
        color: #E0E0E0;
        text-decoration: none;
        font-size: 16px;
        font-weight: 600;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: pointer;
        gap: 14px;
        position: relative;
        touch-action: manipulation;
    }
    
    .mobile-nav-link::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: linear-gradient(180deg, #FF6B35, transparent);
        transform: scaleY(0);
        transform-origin: top;
        transition: transform 0.3s ease;
    }
    
    .mobile-nav-link:hover, .mobile-nav-link:active {
        background: linear-gradient(90deg, rgba(255, 107, 53, 0.25), transparent);
        color: #FFD700;
        padding-right: 28px;
        padding-left: 22px;
    }
    
    .mobile-nav-link:hover::before {
        transform: scaleY(1);
    }
    
    .mobile-nav-link::after {
        content: '';
        margin-left: auto;
        width: 0;
        height: 0;
        border-top: 5px solid transparent;
        border-bottom: 5px solid transparent;
        border-right: 5px solid rgba(255, 215, 0, 0);
        transition: border-color 0.3s ease;
    }
    
    .mobile-nav-link:hover::after {
        border-right-color: rgba(255, 215, 0, 0.8);
    }
    
    /* Mobile Navigation Actions */
    .mobile-nav-actions {
        padding: 20px;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
        border-top: 2px solid rgba(255, 255, 255, 0.15);
        background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
        flex-shrink: 0;
    }
    
    .mobile-nav-btn {
        display: flex;
        touch-action: manipulation;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        background: linear-gradient(135deg, rgba(255, 107, 53, 0.25), rgba(255, 142, 95, 0.12));
        border: 2.5px solid #FF6B35;
        color: #FF6B35;
        padding: 16px 12px;
        border-radius: 12px;
        cursor: pointer;
        font-size: 13px;
        font-weight: 700;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }

    .mobile-nav-btn.admin-btn {
        display: flex !important;
    }
    /* additional responsive rules for broader breakpoints */
    @media (max-width: 768px) {
        .navbar {
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            padding: 14px 1.25rem;
        }
        .navbar-brand {
            flex: 0 0 auto;
            justify-content: flex-end;
            gap: 0.75rem;
        }
        .nav-icons {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 0.85rem;
            min-width: 0;
        }
        .nav-icons > div,
        .nav-icons > button.hamburger-menu {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 44px;
            height: 44px;
            min-width: 44px;
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.06);
        }
        .hamburger-menu {
            padding: 10px 12px;
            background: rgba(255, 255, 255, 0.06);
        }
        .items-grid { grid-template-columns: 1fr !important; }
        .admin-grid { grid-template-columns: 1fr !important; }
        .branches-row { flex-direction: column !important; }
        .billing-info, .add-item-form, .current-items-manage {
            width: 100% !important;
            margin: 0 auto 1.5rem !important;
        }
        .hero-section {
            flex-direction: column;
            gap: 2rem;
            padding: 2rem 1rem;
        }
        .nav-links {
            display: none;
        }

        .mobile-nav-actions .admin-btn,
        .mobile-nav-menu .admin-btn,
        .admin-icon {
            display: none !important;
        }

        .mobile-nav-actions {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    @media (min-width: 768px) and (max-width: 1024px) {
        /* tablet tweaks */
        .hero-section {
            padding: 3rem 2rem;
        }
        .items-grid {
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        }
        .nav-links {
            gap: 1rem;
        }
    }
    
    .mobile-nav-btn::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-nav-btn:active {
        transform: scale(0.95);
    }
    
    .mobile-nav-btn:hover {
        background: linear-gradient(135deg, rgba(255, 107, 53, 0.35), rgba(255, 142, 95, 0.22));
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
        transform: translateY(-3px);
        border-color: #FFD700;
    }
    
    .mobile-nav-btn:hover::before {
        opacity: 1;
    }
    
    .mobile-nav-btn i {
        font-size: 24px;
        transition: transform 0.3s ease;
    }
    
    .mobile-nav-btn:hover i {
        transform: scale(1.15);
    }
    
    .mobile-nav-btn span {
        text-align: center;
        letter-spacing: 0.3px;
        line-height: 1.2;
    }
    
    .cart-badge {
        position: absolute;
        top: -6px;
        right: -6px;
        background: linear-gradient(135deg, #FF6B35, #FF8E5F);
        color: white;
        font-size: 11px;
        padding: 3px 7px;
        border-radius: 12px;
        font-weight: 900;
        min-width: 20px;
        text-align: center;
        box-shadow: 0 3px 10px rgba(255, 107, 53, 0.5);
        border: 2px solid rgba(22, 33, 62, 1);
        animation: pulse 2s infinite;
    }
    
    .page {
        padding: 15px 3%;
        min-height: auto;
    }
    
    .hero-section {
        flex-direction: column-reverse;
        gap: 15px;
        padding: 15px;
    }
    
    .hero-content {
        flex: 1;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 22px;
        line-height: 1.3;
        margin-bottom: 12px;
    }
    
    .hero-content p {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .hero-graphic {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .hero-graphic img {
        max-width: 100%;
        height: 200px;
        object-fit: cover;
    }
    
    .main-btn {
        font-size: 14px;
        padding: 12px 16px !important;
    }
    
    .section-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .search-wrapper {
        max-width: 100%;
        margin: 0 auto 15px;
    }
    
    .search-wrapper input {
        padding: 12px 14px 12px 40px;
        font-size: 14px;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        margin: 20px auto;
        padding: 10px;
        gap: 15px;
    }
    
    .items-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .home-page .items-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .res-card {
        border-radius: 10px;
    }
    
    .res-card img {
        height: 140px;
    }
    
    .category-filter {
        gap: 10px;
        margin: 15px 0;
    }
    
    .category-filter button,
    .filter-tabs .tab-btn {
        padding: 10px 16px;
        font-size: 12px;
        border-radius: 20px;
    }
    
    .login-btn {
        padding: 14px 16px !important;
        font-size: 14px !important;
    }
    
    /* About page mobile */
    .about-hero {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .about-hero-text {
        text-align: center;
    }
    
    .about-metrics {
        flex-direction: column;
        gap: 12px;
    }
    
    .about-metrics .metric {
        min-width: 100%;
        padding: 12px 15px;
    }
    
    .team-grid {
        gap: 12px;
    }
    
    .team-card {
        width: 140px;
        padding: 10px;
    }
    
    .team-card img {
        height: 100px;
    }
    
    .team-card h4 {
        font-size: 14px;
    }
    
    .team-card small {
        font-size: 11px;
    }
    
    /* Contact page mobile */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .contact-info-card,
    .review-box-card {
        padding: 15px;
        border-radius: 12px;
    }
    
    .reviews-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .review-item {
        padding: 15px;
        border-radius: 10px;
    }
    
    /* Branches mobile */
    .branches-row .branch-card {
        flex: 0 0 90vw;
        width: 90vw;
        height: auto;
    }
    
    .branches-row .branch-img {
        height: 140px;
    }
    
    .branches-row .branch-img img {
        height: 140px;
    }
    
    /* Admin grid mobile */
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .add-item-form,
    .current-items-manage {
        padding: 15px;
    }
    
    /* Cart mobile */
    .cart-checkout {
        grid-template-columns: 1fr !important;
    }
    
    .billing-info {
        padding: 12px !important;
    }
    
    .billing-info input {
        padding: 10px !important;
        font-size: 14px !important;
    }
    
    .order-summary-box {
        padding: 12px !important;
    }
    
    .order-summary-box > div {
        padding: 12px !important;
    }
    
    /* Login page mobile */
    .login-container {
        padding: 15px;
    }
    
    .login-form-content {
        padding: 15px !important;
    }
    
    /* Modal dialogs mobile */
    .modal {
        width: 95vw !important;
        max-height: 90vh;
        padding: 15px !important;
    }
    
    .image-modal-content {
        max-width: 98%;
    }
    
    .image-modal-content img {
        max-height: 60vh;
    }
}

/* Tablet Screens (481px - 768px) */
@media (max-width: 768px) and (min-width: 481px) {
    :root {
        --header-height: 75px;
    }
    
    .navbar {
        padding: 12px 4%;
    }
    
    .logo {
        font-size: 22px;
    }
    
    .logo span {
        display: block;
    }
    
    .navbar {
        justify-content: space-between;
    }

    .navbar-brand {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .hamburger-menu {
        display: flex !important;
    }

    .nav-links {
        display: none;
        gap: 14px;
        overflow-x: auto;
        align-items: center;
        padding: 8px 0;
    }
    
    .nav-icons {
        display: flex !important;
    }
    
    .page {
        padding: 25px 4%;
    }
    
    .hero-section {
        flex-direction: column;
        gap: 20px;
        padding: 25px;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .hero-graphic {
        flex: 0 0 100%;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 18px;
    }
    
    .home-page .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .about-hero {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        gap: 15px;
    }
    
    .team-card {
        width: 160px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .reviews-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-checkout {
        grid-template-columns: 1fr !important;
    }
}

/* Medium Screens (769px - 900px) */
@media (max-width: 900px) and (min-width: 769px) {
    /* Hide hamburger menu on medium screens */
    .hamburger-menu {
        display: none !important;
    }
    
    /* Hide mobile navigation menu on medium screens */
    .mobile-nav-overlay {
        display: none !important;
    }
    
    .mobile-nav-menu {
        display: none !important;
    }
    
    /* Show desktop navigation elements */
    .nav-links {
        display: flex !important;
    }
    
    .nav-icons {
        display: flex !important;
    }
    
    .navbar {
        padding: 14px 4%;
    }
    
    .hero-section {
        flex-direction: column-reverse;
        gap: 20px;
        padding: 30px;
    }
    
    .hero-content h1 {
        font-size: 38px;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
        gap: 20px;
    }
    
    .home-page .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 18px;
    }
    
    .section-title {
        font-size: 30px;
    }
    
    .about-hero {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        gap: 16px;
    }
    
    .team-card {
        width: 180px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .reviews-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-checkout {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

/* Large Screens (900px+) */
@media (min-width: 901px) {
    /* Hide mobile hamburger menu on desktop */
    .hamburger-menu {
        display: none !important;
    }
    
    /* Show desktop navigation links */
    .nav-links {
        display: flex !important;
    }
    
    /* Show desktop navigation icons */
    .nav-icons {
        display: flex !important;
    }
    
    /* Hide mobile navigation menu on desktop */
    .mobile-nav-overlay {
        display: none !important;
    }
    
    .mobile-nav-menu {
        display: none !important;
    }
    
    /* Ensure navbar has proper spacing */
    .navbar {
        justify-content: space-between;
        align-items: center;
        padding: 16px 5%;
    }
    
    .logo span {
        display: block;
    }
    
    .hero-section {
        flex-direction: row;
        gap: 40px;
        padding: 40px 30px;
    }
    
    .hero-content {
        flex: 1 1 520px;
    }
    
    .hero-graphic {
        flex: 0 0 420px;
    }
}

.category-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.category-filter button, .filter-tabs .tab-btn {
    padding: 12px 28px;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.category-filter button::before, .filter-tabs .tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    z-index: -1;
    transition: left 0.4s ease;
}

.category-filter button:hover, 
.category-filter button.active,
.filter-tabs .tab-btn:hover,
.filter-tabs .tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.3);
    transform: translateY(-2px);
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 40px auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    box-sizing: border-box;
}

.items-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    width: 100%;
    margin: 0 auto;
}

.home-page .section-title { margin-top: 10px; }

.home-page .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
}

/* زر تسجيل الدخول في لوحة الإدارة - تكبير وتحسين الظهور */
.login-btn {
    width: 100%;
    padding: 18px 20px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    border: none !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
    color: white !important;
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.25) !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.login-btn:hover {
    transform: translateY(-3px) !important;
}

/* تأثيرات حركة الموس على الكروت والعناصر */
.res-card {
    position: relative;
    overflow: visible;
}

.res-card:hover {
    transform: translateY(-12px) scale(1.02);
}

.feature-box {
    position: relative;
    transition: var(--transition);
}

.feature-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(255, 107, 53, 0.2);
}

/* About page styles */
.about-hero {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 28px;
    align-items: center;
}
.about-hero-text h3 { margin-bottom:8px; color:var(--dark); }
.about-hero-text .lead { font-size:18px; color:#444; margin-bottom:12px; }
.about-hero-visual img { width:100%; height:auto; display:block; border-radius:12px; }

.about-metrics { display:flex; gap:22px; justify-content:center; align-items:center; }
.about-metrics .metric { text-align:center; background:white; padding:16px 20px; border-radius:12px; box-shadow:var(--shadow); border-right:4px solid var(--primary); min-width:140px; }
.about-metrics .metric strong { display:block; font-size:20px; color:var(--primary); margin-bottom:6px; }
.about-metrics .metric span { display:block; color:#666; font-size:13px; }

.team-grid { display:flex; gap:18px; justify-content:center; flex-wrap:wrap; }
.team-card { width:200px; background:white; border-radius:12px; padding:12px; text-align:center; box-shadow:var(--shadow); }
.team-card img { width:100%; height:140px; object-fit:cover; border-radius:8px; margin-bottom:10px; }
.team-card h4 { margin:0 0 6px 0; font-size:16px; }
.team-card small { color:#888; }

@media (max-width: 900px) {
    .about-hero { grid-template-columns: 1fr; }
    .about-hero-visual { order: -1; }
}
@keyframes fadeUp { 0% { opacity: 0; transform: translateY(14px);} 100% { opacity:1; transform: translateY(0);} }

/* Use 'will-animate' to mark elements that should animate when visible.
    IntersectionObserver will add 'animate' class to trigger the transition. */
.will-animate { opacity: 0; transform: translateY(14px); }
.will-animate.animate { opacity: 1; transform: none; transition: opacity 600ms ease, transform 600ms ease; }

.team-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 18px 48px rgba(0,0,0,0.12); }

.team-socials { display:flex; justify-content:center; gap:8px; margin-top:10px; }
.team-socials a { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:8px; color:var(--primary); background:rgba(255, 107, 53, 0.06); transition:background 0.2s, transform 0.15s; }
.team-socials a:hover { background:linear-gradient(135deg, var(--primary), var(--primary-light)); color:white; transform:translateY(-3px); }

/* Stagger team-card animation using nth-child for nicer entrance (initial delays via CSS fallback) */
.team-grid .team-card:nth-child(1) { transition-delay: 120ms; }
.team-grid .team-card:nth-child(2) { transition-delay: 220ms; }
.team-grid .team-card:nth-child(3) { transition-delay: 320ms; }

.branch-card {
    position: relative;
    transition: var(--transition);
}

.branch-card:hover {
    transform: translateY(-10px) translateX(-5px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.15);
}

/* تأثير التتبع: عناصر تتحرك مع الموس */
.add-item-form, .current-items-manage {
    position: relative;
}

.add-item-form:hover, .current-items-manage:hover {
    transform: translateY(-4px);
}

/* تأثيرات إضافية للأيقونات والأزرار */
.nav-icons i, .user-icon, .cart-icon, .admin-toggle {
    transition: var(--transition);
}

.nav-icons i:hover, .user-icon:hover, .cart-icon:hover, .admin-toggle:hover {
    transform: scale(1.15) rotate(5deg);
}

/* صور تتحرك عند hover */
.hero-graphic img {
    transition: var(--transition);
}

.hero-section:hover .hero-graphic img {
    transform: scale(1.05) translateY(-8px);
}

/* --- تحسينات صفحة التواصل --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.contact-info-card, .review-box-card {
    background: linear-gradient(135deg, white 0%, #F9FAFB 100%);
    padding: 36px;
    border-radius: 18px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(255, 107, 53, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.contact-info-card::before, .review-box-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.contact-info-card:hover::before, .review-box-card:hover::before {
    transform: scaleX(1);
}

.contact-info-card:hover, .review-box-card:hover {
    box-shadow: 0 15px 50px rgba(255, 107, 53, 0.15);
    transform: translateY(-8px);
    border-color: rgba(255, 107, 53, 0.25);
}

.social-link:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* responsive tweaks for contact page */
@media (max-width: 768px) {
    /* stack the two main columns */
    .contact-grid {
        display: flex !important;
        flex-direction: column;
        gap: 24px !important;
        padding: 0 16px;
    }

    /* shrink headings and labels */
    #contact-page .section-title {
        font-size: 28px !important;
    }
    #contact-page h3 {
        font-size: 20px !important;
    }
    #contact-page label span {
        font-size: 14px !important;
    }

    /* add padding inside cards or panels */
    #contact-page .contact-info-card,
    #contact-page .review-box-card,
    #contact-page .contact-grid > div {
        padding: 16px !important;
    }

    /* adjust form layout: stack the two-column row */
    #contact-page form > div:first-child {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* make buttons full width and stack them */
    #contact-page .main-btn {
        width: 100% !important;
        box-sizing: border-box;
    }
    #contact-page form > div:last-child {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
}


#reviewText {
    width: 100% !important;
    margin-bottom: 0 !important;
}

#reviewText:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1) !important;
}

.reviews-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.review-item {
    background: linear-gradient(135deg, white 0%, #F9FAFB 100%);
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-right: 5px solid var(--primary);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.review-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.review-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 45px rgba(255, 107, 53, 0.15);
}

.review-item:hover::before {
    opacity: 1;
}


@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .reviews-container {
        grid-template-columns: 1fr;
    }
    
    /* Cart responsive on tablets */
    .cart-checkout {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin-top: 20px !important;
    }
    
    .order-summary-box {
        position: static !important;
    }
}

/* --- Image modal styles (touch-friendly) --- */
.image-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}
.image-modal.open { display: flex; }
.image-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent;
    animation: fadeIn 0.3s ease;
}
.image-modal-content {
    position: relative;
    max-width: 92%;
    max-height: 88%;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: slideInCenter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.image-modal-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    object-fit: contain;
}
.image-modal-close {
    position: absolute;
    top: -10px;
    left: -10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 248, 252, 0.9) 100%);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.image-modal-close:hover {
    background: white;
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.image-modal-close:active { transform: scale(0.98); }
.image-modal-content p { color: white; text-align: center; margin: 0; font-weight: 700; text-shadow: 0 2px 6px rgba(0,0,0,0.6); }

/* Make interactive images touch-friendly */
.interactive-img { cursor: zoom-in; touch-action: manipulation; }

/* Cart page responsive layout */
.cart-checkout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

.order-summary-box {
    position: static;
}

/* --- Loading Overlay & Spinners --- */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 25px;
    animation: fadeIn 0.3s ease;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 107, 53, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    border-right-color: var(--primary-light);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

/* --- Accessibility Improvements --- */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible, 
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Reduce motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    :root {
        --shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.4);
    }
}

/* Dark mode support - Light Theme */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 50%, #fafafa 100%);
        color: #333333;
    }
    
    .page {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 250, 250, 0.95) 100%);
    }
    
    input, textarea, select {
        background-color: #ffffff !important;
        color: #333333 !important;
        border-color: #ddd !important;
    }
    
    .res-card, .billing-info, .feature-box {
        background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%) !important;
        border-color: #e0e0e0 !important;
    }
}

/* Print styles */
@media print {
    header, .nav-icons, .main-btn, [data-action] {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .page {
        min-height: auto;
        box-shadow: none;
        border: none;
    }
}