:root {
    /* Color Palette - Light Mode */
    --primary-color: #BB9A58;
    --primary-hover: #a3854d;
    --secondary-color: #0f172a;
    --text-dark: #333333;
    --text-light: #64748b;
    --bg-light: #ffffff;
    --bg-secondary: #f8fafc;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-light);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    left: 0;
    right: auto;
    margin-top: 0.5rem;
}

/* RTL Adjustment for Dropdown */
html[dir="rtl"] .dropdown-content {
    left: auto;
    right: 0;
    /* Align to the right edge of the parent */
}

.dropdown-content a {
    color: var(--text-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.dropdown:hover .dropdown-content,
.dropdown.show .dropdown-content {
    display: block;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    direction: rtl;
    text-align: right;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.section-padding {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.25rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.text-center {
    text-align: center;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

/* Responsive Grid System */
.grid {
    display: grid;
    gap: 1.5rem;
    /* Consistent gap */
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}


.card {
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
}

.card-body {
    padding: 1.5rem;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,.12);
}

/* Image Wrapper */
.card-image {
    height: 220px;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    transition: transform .4s ease;
}

/* Zoom effect on hover */
.card:hover .card-image {
    transform: scale(1.08);
}

.badge-featured {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--secondary-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    box-shadow: 0 6px 15px rgba(0,0,0,.25);
    z-index: 2;
    letter-spacing: .5px;
}

/* Animation subtle */
.card:hover .badge-featured {
    transform: scale(1.05);
    transition: transform .3s ease;
}

/* Offer badge */
.badge-offer {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, #1d000a, #700101);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 6px 15px rgba(0,0,0,.25);
    z-index: 2;
}

/* Featured badge (reuse) */
.badge-featured {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.7rem;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Prices */
.price-box {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85rem;
}

.new-price {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
}

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* Mobile Optimization (max-width: 768px) */
@media (max-width: 768px) {
    /* 1. الجريد يقلب عمود واحد لكل الشاشات الصغيرة */
    .grid-cols-2, 
    .grid-cols-3, 
    .grid-cols-4 {
        grid-template-columns: repeat(1, 1fr) !important;
        gap: 1rem;
    }

    /* 2. تصغير الهيدر والبادينج عشان الموبايل */
    .section-padding {
        padding: 3rem 0;
    }

    .section-title h2 {
        font-size: 1.75rem;
    }

    .container {
        padding: 0 1rem;
    }

    /* 3. تعديل الفوتر للموبايل */
    footer .grid {
        text-align: center !important; /* توسيط النصوص في الموبايل */
        gap: 2.5rem;
    }

    footer div[style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    footer p {
        margin: 0 auto;
    }

    /* 4. تعديل الكروت في الموبايل */
    .card-image {
        height: 200px; /* تقليل ارتفاع الصورة شوية */
    }

    .card-body {
        padding: 1rem;
    }

    /* 5. الدروب داون في الموبايل (عشان ميتحدفش بره الشاشة) */
    .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background-color: var(--bg-secondary);
    }
}

/* Extra Small Devices (max-width: 480px) */
@media (max-width: 480px) {
    .btn {
        width: 100%; /* الأزرار تاخد العرض كله لسهولة الضغط */
        text-align: center;
    }
}