/* CSS Design System for Qameh Al-Barakeh - Mobile First */
:root {
    /* Artisanal "Life of the Land" Palette */
    --primary: #D2B48C;
    /* Kraft Paper Tan */
    --primary-dark: #8B4513;
    /* Saddle Brown */
    --primary-light: #E6D4BA;
    /* Light Parchment */
    --primary-brown: #5D4037;
    /* Rich Cocoa Brown */
    --accent-red: #A52A2A;
    /* Heritage Logo Red */
    --accent-green: #4A6741;
    /* Olive Green */
    --bg-white: #FFFFFF;
    --bg-soft: #FDFBF7;
    /* Soft Cream Parchment */
    --bg-light: #F4EBE1;
    /* Sandy Light Beige */
    --text-main: #2D2926;
    /* Dark Onyx charcoal */
    --text-muted: #5B524B;
    /* Warm Earthy Grey */
    --font-en: 'Outfit', sans-serif;
    --font-ar: 'Cairo', sans-serif;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: var(--font-en);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

[dir="rtl"] body {
    font-family: var(--font-ar);
}

[dir="rtl"] {
    font-family: var(--font-ar);
}

/* Texture Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("https://www.transparenttextures.com/patterns/parchment.png");
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 900;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 {
    letter-spacing: 0;
    line-height: 1.4;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    /* Mobile Size */
    margin-bottom: 2.5rem;
    position: relative;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.5rem;
        margin-bottom: 3.5rem;
    }
}

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

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    /* Mobile Padding */
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

/* Glassmorphism Header */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    /* Mobile Height */
    transition: var(--transition);
}

@media (min-width: 768px) {
    nav {
        height: 85px;
    }

    header.scrolled nav {
        height: 65px;
    }
}

.logo {
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--primary-dark);
    text-decoration: none;
    letter-spacing: -0.03em;
}

@media (min-width: 768px) {
    .logo {
        font-size: 1.7rem;
    }
}

/* Strict Bilingual Logo Logic */
.logo-en,
.logo-ar {
    display: none;
}

:root[lang="en"] .logo-en {
    display: block;
}

:root[lang="ar"] .logo-ar {
    display: block;
}

/* Nav Links - Mobile Hidden by Default */
.nav-links {
    display: none;
    list-style: none;
    gap: 2rem;
}

@media (max-width: 767px) {
    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        padding: 2rem;
        border-bottom: 2px solid var(--primary-light);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        text-align: center;
        z-index: 999;
    }
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    padding: 5px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-dark);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

[dir="rtl"] .nav-links a::after {
    left: auto;
    right: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.lang-switch {
    background: transparent;
    color: var(--primary-dark);
    border: 2px solid var(--primary-dark);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .lang-switch {
        padding: 0.4rem 1.2rem;
        font-size: 0.9rem;
    }
}

.lang-switch:hover {
    background: var(--primary-dark);
    color: white;
}

.mobile-menu-toggle {
    display: block;
    /* Visible on mobile */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.mobile-menu-toggle:active {
    transform: scale(0.9);
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* Hero Section */
.hero {
    min-height: 80vh;
    /* Better for mobile overflow */
    height: 100svh;
    background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.25)), url('assets/hero.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    /* Fixed is buggy on many mobile browsers */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding-top: 70px;
}

@media (min-width: 768px) {
    .hero {
        background-attachment: fixed;
        padding-top: 85px;
    }
}

.hero-content {
    max-width: 90%;
    padding: 1rem;
}

@media (min-width: 768px) {
    .hero-content {
        max-width: 800px;
    }
}

.hero h1 {
    font-size: 2.25rem;
    /* Mobile */
    color: white;
    margin-bottom: 1.2rem;
    text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.6);
}

@media (min-width: 768px) {
    .hero h1 {
        font-size: 4rem;
        margin-bottom: 1.5rem;
    }
}

.hero p {
    font-size: 1.1rem;
    /* Mobile */
    margin-bottom: 2rem;
    text-shadow: 1px 1px 10px rgba(0, 0, 0, 0.6);
    line-height: 1.5;
}

@media (min-width: 768px) {
    .hero p {
        font-size: 1.3rem;
        margin-bottom: 2.5rem;
    }
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .btn {
        padding: 1rem 2.5rem;
        font-size: 1rem;
    }
}

.btn-primary {
    background: var(--primary-brown);
    color: white;
    box-shadow: 0 4px 15px rgba(93, 64, 55, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(93, 64, 55, 0.4);
}

/* Detailed About Section */
.about-detailed {
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .about-detailed {
        padding: 7rem 0;
    }
}

.about-wrapper {
    display: flex;
    flex-direction: column;
    /* Mobile first */
    gap: 3rem;
    align-items: center;
}

@media (min-width: 768px) {
    .about-wrapper {
        flex-direction: row;
        gap: 5rem;
    }
}

.about-text {
    flex: 1;
    width: 100%;
}

.section-title-left {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
    text-align: center;
}

@media (min-width: 768px) {
    .section-title-left {
        font-size: 2.75rem;
        text-align: left;
        margin-bottom: 2rem;
    }

    [dir="rtl"] .section-title-left {
        text-align: right;
    }
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .about-text p {
        font-size: 1.15rem;
    }
}

.about-image {
    flex: 1;
    width: 100%;
}

.about-image img {
    width: 100%;
    border-radius: 20px 0 20px 0;
    box-shadow: 15px 15px 0 var(--primary-light);
    transform: none;
    /* Mobile flat */
    transition: transform 0.5s ease;
}

@media (min-width: 768px) {
    .about-image img {
        transform: perspective(1000px) rotateY(-5deg);
        box-shadow: 20px 20px 0 var(--primary-light);
    }

    .about-image img:hover {
        transform: perspective(1000px) rotateY(0);
    }
}

.btn-outline {
    display: inline-block;
    padding: 0.8rem 2rem;
    border: 2px solid var(--primary-brown);
    color: var(--primary-brown);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    /* Full width on mobile */
}

@media (min-width: 768px) {
    .btn-outline {
        width: auto;
    }
}

.btn-outline:hover {
    background: var(--primary-brown);
    color: white;
}

/* Founders Section styling */
.founders-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--primary-light);
}

.founders-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--primary-dark);
}

.founders-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 600px) {
    .founders-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.founder-card {
    text-align: center;
    transition: var(--transition);
}

.founder-card:hover {
    transform: translateY(-5px);
}

.founder-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.2rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-light);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.founder-card:hover .founder-image {
    border-color: var(--primary);
    transform: scale(1.05);
}

.founder-card:hover .founder-image {
    border-color: var(--primary);
    transform: scale(1.05);
}

.founder-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.founder-info h4 {
    font-family: var(--font-en);
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    font-weight: 700;
}

[dir="rtl"] .founder-info h4 {
    font-family: var(--font-ar);
}

.founder-info p {
    font-size: 0.85rem !important;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* Values / Mission Section */
.mission {
    padding: 4rem 0;
    background: var(--bg-white);
}

@media (min-width: 768px) {
    .mission {
        padding: 6rem 0;
    }
}

.mission-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile */
    gap: 2rem;
}

@media (min-width: 600px) {
    .mission-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .mission-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

.mission-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: 20px;
    background: var(--bg-soft);
    border: 1px solid rgba(139, 69, 19, 0.05);
    transition: var(--transition);
}

.mission-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.mission-item i {
    font-size: 2.8rem;
    color: var(--accent-green);
    margin-bottom: 1.2rem;
    transition: var(--transition);
}

@media (min-width: 768px) {
    .mission-item i {
        font-size: 3.5rem;
    }
}

/* Products Section */
.products {
    padding: 4rem 0;
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile */
    gap: 2rem;
}

@media (min-width: 650px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}

.product-card {
    background: var(--bg-white);
    border: 1px solid var(--primary-light);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(93, 64, 55, 0.12);
    border-color: var(--primary);
}

.product-image {
    height: 280px;
    /* Mobile */
    background-size: cover;
    background-position: center;
    background-color: #f9f9f9;
    transition: var(--transition);
}

@media (min-width: 768px) {
    .product-image {
        height: 350px;
    }
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-info .tag {
    color: var(--accent-red);
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.6rem;
    display: block;
}

.product-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

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

.badge-container {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

.badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    border: 1px solid var(--primary-dark);
    border-radius: 50%;
    font-size: 0.6rem;
    text-align: center;
    padding: 5px;
    text-transform: uppercase;
    font-weight: 800;
    line-height: 1.1;
    color: var(--primary-dark);
    transition: var(--transition);
}

.badge:hover {
    background: var(--primary-dark);
    color: white;
}

/* Contact Section */
.contact {
    padding: 4rem 0;
    background: var(--primary-dark);
    color: white;
}

.contact h2 {
    color: white;
}

.contact-info {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile */
    gap: 2rem;
    text-align: center;
}

@media (min-width: 768px) {
    .contact-info {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

.contact-item {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    display: block;
}

.contact-item:hover {
    transform: translateY(-5px);
}

.contact-item:hover i {
    color: var(--primary);
}

.contact-item i {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--primary-light);
}

.contact-item p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Footer Section */
footer {
    background: #151413;
    color: #b0a9a4;
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile */
    gap: 2.5rem;
    border-top: 1px solid #2d2926;
    padding-top: 2.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr;
        text-align: left;
    }

    [dir="rtl"] .footer-grid {
        text-align: right;
    }
}

.footer-col h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #908882;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary-light);
}

/* Animations - Simplified for performance */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Legal Pages Overrides */
.legal-page-container {
    padding-top: 100px;
    /* Smaller mobile header */
    padding-bottom: 4rem;
    max-width: 800px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .legal-page-container {
        padding-top: 140px;
    }
}

.legal-content h3 {
    margin-top: 2.5rem;
    font-size: 1.4rem;
}

.legal-content p {
    margin-bottom: 1.2rem;
    color: var(--text-muted);
}

.legal-header-nav {
    background: rgba(255, 255, 255, 0.98);
}