@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');

:root {
    /* Brand Colors - Al-Tilal */
    --brand-primary: #5c955c;
    --brand-primary-light: #7AB77A;
    --brand-primary-dark: #4A7A4A;
    --brand-accent: #F28C28;
    --brand-accent-light: #FFB347;

    /* Neutrals */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-700: #374151;
    --gray-900: #111827;
    --black: #000000;

    /* Typography */
    --font-arabic: 'Tajawal', sans-serif;
    --font-latin: 'Outfit', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* 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);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ===========================
   BASE STYLES
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-arabic);
    direction: rtl;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

.font-latin {
    font-family: var(--font-latin);
}

/* ===========================
   BOOTSTRAP CUSTOMIZATIONS
   =========================== */

/* Navbar Enhancements */
.navbar-brand {
    font-weight: 800;
    font-size: 1.25rem;
}

.nav-link {
    font-weight: 600;
    transition: var(--transition-base);
    position: relative;
}

.nav-link:hover {
    color: var(--brand-primary) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--brand-primary);
    transition: width var(--transition-base);
}

.nav-link:hover::after {
    width: 100%;
}

/* Button Enhancements */
.btn {
    border-radius: var(--radius-full);
    font-weight: 700;
    padding: 0.75rem 2rem;
    transition: all var(--transition-base);
}

.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-primary:hover {
    background-color: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-accent {
    background-color: var(--brand-accent);
    border-color: var(--brand-accent);
    color: var(--white);
}

.btn-accent:hover {
    background-color: #d97818;
    border-color: #d97818;
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn-outline-primary:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-light {
    background-color: transparent;
    border-color: var(--white);
    color: var(--white);
}

.btn-outline-light:hover {
    background-color: var(--white);
    border-color: var(--white);
    color: var(--brand-primary);
    transform: translateY(-2px);
}


/* Card Enhancements */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-slow);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* ===========================
   CUSTOM COMPONENTS
   =========================== */

/* Glassmorphism Navbar */
.navbar-glass {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md);
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-banner {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-banner-img {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-banner-img.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgb(0 0 0 / 85%) 0%, rgb(92 149 92 / 72%) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    color: var(--white);
    padding: var(--spacing-xl);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: var(--spacing-xl);
}


/* Product Cards */
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-slow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

.product-card-img-wrapper {
    background: var(--gray-100);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 280px;
    overflow: hidden;
    transition: all var(--transition-slow);
}

.product-card:hover .product-card-img-wrapper {
    background: var(--white);
}

.product-card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all var(--transition-slow);
}

.product-card:hover .product-card-img {
    transform: scale(1.15) rotate(-3deg);
}

.product-card-body {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-xs);
}

.product-card-category {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 600;
}

/* Badge Styles */
.badge-brand,
.badge-accent {
    color: var(--white);
    padding: 0.375rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge-brand {
    background-color: var(--brand-primary);
}

.badge-accent {
    background-color: var(--brand-accent);
}


/* Section Titles */
.section-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 900;
    color: var(--gray-900);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.section-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--gray-700);
    max-width: 700px;
    margin: 0 auto var(--spacing-xl);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-delay-1 {
    animation-delay: 0.2s;
}

.animate-delay-2 {
    animation-delay: 0.4s;
}

.animate-delay-3 {
    animation-delay: 0.6s;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--gray-300);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
}

.footer-title {
    color: var(--white);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
}

.footer-link {
    color: var(--gray-300);
    text-decoration: none;
    transition: var(--transition-base);
    display: inline-block;
}

.footer-link:hover {
    color: var(--brand-accent);
    transform: translateX(-5px);
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all var(--transition-base);
    text-decoration: none;
}

.social-icon:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--white);
    transform: translateY(-3px);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
}

.filter-tab {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    border: 2px solid var(--gray-200);
    background: var(--white);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--gray-700);
}

.filter-tab:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.filter-tab.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--white);
    box-shadow: 0 8px 16px rgba(211, 47, 47, 0.2);
}

/* Brand Showcase */
.brand-hero {
    position: relative;
    min-height: 400px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

.brand-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

/* Contact Form */
.contact-form {
    background: var(--white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-200);
    padding: 0.75rem 1rem;
    transition: all var(--transition-base);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem rgba(211, 47, 47, 0.15);
}

/* Utility Classes */
.text-brand {
    color: var(--brand-primary) !important;
}

.text-accent {
    color: var(--brand-accent) !important;
}

.bg-brand {
    background-color: var(--brand-primary) !important;
}

.bg-accent {
    background-color: var(--brand-accent) !important;
}

.bg-light-gray {
    background-color: var(--gray-50);
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .hero-section {
        min-height: 70vh;
    }

    .section-title {
        font-size: 2rem;
    }

    .filter-tabs {
        display: flex;
        background: transparent;
        padding: 5px 20px 20px 20px;
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        gap: 12px;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 25px;
        border: none;
        min-height: 70px;
    }

    .filter-tabs::-webkit-scrollbar {
        display: none;
    }

    .filter-tab {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        white-space: nowrap;
        flex: 0 0 auto;
        text-align: center;
        border: 1px solid #e0e6e0 !important;
        background: #ffffff !important;
        border-radius: 50px;
        font-weight: 700;
        color: #555;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .filter-tab.active {
        background: var(--brand-primary) !important;
        border-color: var(--brand-primary) !important;
        color: white !important;
        box-shadow: 0 4px 10px rgba(92, 149, 92, 0.2) !important;
    }

    .product-card-img-wrapper {
        height: 220px;
    }
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal Close Button Fix for RTL */
.modal-header .btn-close {
    margin-right: auto;
    margin-left: 0;
}

/* Decorative Search Section */
.search-section {
    position: relative;
    background-color: var(--gray-100);
    overflow: hidden;
    padding: 60px 0;
}

.search-pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%235c955c' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2v-4h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2v-4h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.search-container {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.search-input-group {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
}

.search-input-group:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 10px 30px rgba(92, 149, 92, 0.1);
}

.search-input-group i {
    padding: 0 20px;
    color: var(--brand-primary);
    font-size: 1.2rem;
}

.search-input-group input {
    border: none;
    padding: 12px 0;
    width: 100%;
    font-size: 1.1rem;
    outline: none;
    background: transparent;
}

/* Section Patterns */
.section-pattern-container {
    position: relative;
    overflow: hidden;
}

.section-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    pointer-events: none;
    z-index: 1;
}

.pattern-dots {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%235c955c' fill-opacity='1' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

.pattern-grid {
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40' stroke='%235c955c' stroke-width='1' opacity='0.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.pattern-circles {
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='40' stroke='%23ffffff' stroke-width='1' fill='none' opacity='0.2'/%3E%3C/svg%3E");
}

.section-pattern-container>.container {
    position: relative;
    z-index: 2;
}

/* Premium Mobile Menu */
.navbar-toggler {
    border: none !important;
    padding: 0;
    width: 30px;
    height: 30px;
    position: relative;
    z-index: 1001;
    display: none;
    flex-direction: column;
    justify-content: space-around;
    background: transparent;
}

@media (max-width: 991px) {
    .navbar-toggler {
        display: flex;
        z-index: 10001;
        position: relative;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
}

.toggler-icon {
    width: 25px;
    height: 2px;
    background-color: var(--brand-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
    margin: 2px 0;
}

.navbar-toggler.active .toggler-icon:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.navbar-toggler.active .toggler-icon:nth-child(2) {
    opacity: 0;
}

.navbar-toggler.active .toggler-icon:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mobile-menu-overlay.active {
    transform: translateX(0);
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    text-align: center;
}

.mobile-nav-item {
    margin-bottom: 25px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.mobile-menu-overlay.active .mobile-nav-item {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav-item:nth-child(1) {
    transition-delay: 0.1s;
}

.mobile-nav-item:nth-child(2) {
    transition-delay: 0.2s;
}

.mobile-nav-item:nth-child(3) {
    transition-delay: 0.3s;
}

.mobile-nav-item:nth-child(4) {
    transition-delay: 0.4s;
}

.mobile-nav-link {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gray-900);
    text-decoration: none;
    transition: color 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--brand-primary);
}

.mobile-menu-footer {
    position: absolute;
    bottom: 40px;
    text-align: center;
    opacity: 0;
    transition: all 0.6s ease;
    transition-delay: 0.5s;
}

.mobile-menu-overlay.active .mobile-menu-footer {
    opacity: 1;
}


.navbar-toggler:focus,
.navbar-toggler:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}