/* CSS Variables */
:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f9f9f9;
    /* Light gray for alternating sections */
    --color-royal-black: #050505;
    /* Secondary Color */

    --color-text-main: #111111;
    --color-text-light: #ffffff;
    --color-text-muted: #666666;

    --color-gold: #c5a059;

    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Playfair Display', serif;

    --transition-speed: 0.3s;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-ar);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 80px;
    transition: opacity 0.5s ease;
}

body.loading {
    opacity: 0;
}

body[lang="en"] {
    font-family: var(--font-en);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Typography */
h1,
h2,
h3 {
    margin-bottom: 20px;
    font-weight: 700;
}

h2.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    padding-bottom: 20px;
    color: var(--color-royal-black);
}

.bg-black-royal h2.section-title,
footer h2.section-title {
    color: var(--color-text-light);
}

h2.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--color-gold);
}

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

/* Buttons */
.btn-royal {
    display: inline-block;
    padding: 12px 30px;
    background-color: transparent;
    border: 2px solid var(--color-gold);
    color: var(--color-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    transition: all var(--transition-speed);
}

.btn-royal:hover {
    background-color: var(--color-gold);
    color: #fff;
}

.btn-glass {
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    border-radius: 20px;
    transition: all var(--transition-speed);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: #000000;
    color: #ffffff;
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    height: 80px;
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    position: relative;
}

.logo img {
    height: 50px;
    filter: brightness(0) invert(1);
}

.nav-links {
    display: flex;
    gap: 20px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    font-size: 1rem;
    position: relative;
    font-weight: 500;
    color: #ffffff;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    width: 0;
    height: 2px;
    background-color: var(--color-gold);
    transition: width var(--transition-speed);
}

html[dir="rtl"] .nav-links a::before {
    right: 0;
}

html[dir="ltr"] .nav-links a::before {
    left: 0;
}

.nav-links a:hover::before {
    width: 100%;
}

.lang-switch-item {
    z-index: 1002;
}

.lang-switch-item .btn-royal {
    color: #ffffff;
    border-color: #ffffff;
    padding: 5px 15px;
    font-size: 0.8rem;
}

.lang-switch-item .btn-royal:hover {
    background-color: var(--color-gold);
    border-color: var(--color-gold);
    color: #000;
}

/* Hero Section */
.hero {
    height: 80vh;
    /* Background image set via inline style from Customizer */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

/* Overlay darker to ensure white text pops */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.7));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 10px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #eee;
}

/* Sections */
.section-padding {
    padding: 80px 0;
}

.bg-dark {
    background-color: var(--color-bg-alt);
}

/* Becomes Light Gray */
.bg-black {
    background-color: var(--color-bg);
}

/* Becomes White */
.bg-black-royal {
    background-color: var(--color-royal-black);
    color: var(--color-text-light);
}

/* The "Black" sections */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform var(--transition-speed);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    /* Softer shadow for light theme */
    border: 1px solid #eee;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.news-img-wrapper {
    height: 200px;
    overflow: hidden;
}

.news-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.news-card:hover .news-img-wrapper img {
    transform: scale(1.1);
}

.news-content {
    padding: 20px;
}

.news-content h3 {
    color: var(--color-royal-black);
    margin-bottom: 10px;
}

.news-content p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 35px;
    max-width: 1400px;
    margin: 0 auto;
}

.product-card {
    background: #fff;
    text-align: center;
    border: none;
    padding: 30px 25px;
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-royal-black));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.product-img {
    height: 280px;
    margin-bottom: 25px;
    overflow: hidden;
    border-radius: 15px;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Removed grayscale to let the gold pop on white */
    transition: transform var(--transition-speed);
}

.product-card:hover .product-img img {
    transform: scale(1.05);
}

.product-info h3 {
    margin-bottom: 5px;
    font-size: 1.2rem;
    color: var(--color-royal-black);
}

.product-info p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.about-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.1));
}

.about-text {
    text-align: left;
}

html[dir="rtl"] .about-text {
    text-align: right;
}

.about-subtitle {
    font-size: 1.8rem;
    color: var(--color-royal-black);
    margin-bottom: 25px;
    font-weight: 700;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-main);
    margin-bottom: 20px;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid rgba(197, 160, 89, 0.3);
}

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

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Branches Section */
/* Let's make Branches part of the "Royal Black" secondary theme */
/* We need to update HTML class for this section to use bg-black-royal if desired, 
   or keep it simple. Let's make it simple for now, maybe dark accents. */

.branch-card {
    background: #fff;
    padding: 30px;
    text-align: center;
    border: 1px solid #eee;
}

/* Footer & Contact - Make these Royal Black for contrast at the bottom */
footer {
    background-color: var(--color-royal-black);
    padding: 40px 0;
    text-align: center;
    color: #888;
    border-top: 5px solid var(--color-gold);
    /* Gold border top */
}

footer span[data-i18n="company_name"] {
    color: #fff;
}

/* ==================== RESPONSIVE STYLES ==================== */

/* Hamburger Menu Styles (Hidden on Desktop) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

html[dir="rtl"] .mobile-menu-toggle {
    left: auto;
    right: 20px;
}

/* Mobile Navigation Overlay */
.nav-links.mobile-active {
    display: flex !important;
}

/* Tablet & Below (768px) */
@media (max-width: 768px) {

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: block;
    }

    /* Hide desktop navigation, show mobile overlay */
    .nav-links {
        display: none;
        position: fixed;
        top: 80px;
        left: 0 !important;
        right: 0;
        background: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        z-index: 999;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        transform: none !important;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 15px 20px;
        font-size: 1.1rem;
    }

    .nav-links a::before {
        display: none;
    }

    /* Logo positioning */
    .logo {
        margin: 0 auto;
    }

    .logo img {
        height: 50px;
    }

    /* Language switcher */
    .lang-switch-item {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    html[dir="rtl"] .lang-switch-item {
        right: auto;
        left: 20px;
    }

    /* Hero Section */
    .hero {
        height: 60vh;
        padding: 20px;
    }

    .hero h1 {
        font-size: 2rem !important;
    }

    .hero p {
        font-size: 1rem !important;
        margin: 15px 0;
    }

    /* Section Padding */
    .section-padding {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    /* News Grid - 1 column */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* Products Grid - 2 columns */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .product-card {
        padding: 20px 15px;
    }

    .product-img {
        height: 200px;
        margin-bottom: 15px;
    }

    /* About Section - Stack vertically */
    .about-content {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        text-align: center;
    }

    html[dir="rtl"] .about-text,
    .about-text {
        text-align: center;
    }

    .about-subtitle {
        font-size: 1.4rem;
    }

    .about-stats {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .stat-number {
        font-size: 2rem;
    }
}

/* Mobile Phones (576px and below) */
@media (max-width: 576px) {

    /* Container */
    .container {
        padding: 0 15px;
    }

    /* Navbar */
    .navbar {
        height: 70px;
    }

    .logo img {
        height: 40px;
    }

    .mobile-menu-toggle {
        font-size: 1.3rem;
    }

    .btn-royal {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* Hero */
    .hero {
        height: 50vh;
    }

    .hero-content h1 {
        font-size: 1.6rem !important;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    /* Section Titles */
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }

    /* News Cards */
    .news-card {
        padding: 15px;
    }

    .news-card h3 {
        font-size: 1.1rem;
    }

    .news-card p {
        font-size: 0.9rem;
    }

    /* Products Grid - 1 column on very small screens */
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        max-width: 350px;
        margin: 0 auto;
    }

    .product-img {
        height: 250px;
    }

    /* About Section */
    .about-subtitle {
        font-size: 1.2rem;
    }

    .about-text p {
        font-size: 0.95rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    /* Footer */
    footer {
        padding: 20px 0;
        font-size: 0.85rem;
    }
}

/* Landscape Phones */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        height: 80vh;
    }
}
