/* 
   Benna Bladi - Premium Main Styles 
   Theme: Lux Moroccan Artisanal
*/

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Montserrat:wght@300;400;600;700&display=swap');

:root {
    /* Palette */
    --color-primary: #1A5F50;
    /* Deep Emerald */
    --color-primary-light: #2f8c79;
    --color-primary-dark: #0e3d32;

    --color-gold: #D4AF37;
    /* Metallic Gold */
    --color-gold-light: #F4D06F;
    --color-gold-dark: #B59021;

    --color-bg: #FCF9F5;
    /* Warm Alabaster */
    --color-card-bg: #FFFFFF;

    --color-text: #2C3E50;
    /* Deep Slate */
    --color-text-light: #7F8C8D;

    /* Gradients */
    --grad-primary: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    --grad-gold: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    --grad-card: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.95));

    /* Decors */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 32px;

    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px rgba(26, 95, 80, 0.15);

    /* Fonts */
    --font-ar: 'Amiri', serif;
    --font-fr: 'Montserrat', sans-serif;
}

/* Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-fr);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Zellige Pattern Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Complex decorative pattern simulation */
    background-image:
        radial-gradient(circle at 100% 50%, transparent 20%, rgba(212, 175, 55, 0.03) 21%, rgba(212, 175, 55, 0.03) 34%, transparent 35%, transparent),
        radial-gradient(circle at 0% 50%, transparent 20%, rgba(212, 175, 55, 0.03) 21%, rgba(212, 175, 55, 0.03) 34%, transparent 35%, transparent);
    background-size: 100px 100px;
    z-index: -1;
    pointer-events: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.flex {
    display: flex;
}

.ar {
    font-family: var(--font-ar);
}

.fr {
    font-family: var(--font-fr);
}

/* Language Visibility */
body.lang-fr .ar {
    display: none !important;
}

body.lang-ar .fr {
    display: none !important;
}

body.lang-ar {
    direction: rtl;
}

body.lang-fr {
    direction: ltr;
}

/* Header & Nav */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--color-gold);
    box-shadow: var(--shadow-soft);
    padding: 15px 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
}

.logo i {
    font-size: 1.8rem;
    color: var(--color-gold);
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-item {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    position: relative;
    padding-bottom: 5px;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-gold);
    transition: width 0.3s;
}

.nav-item:hover {
    color: var(--color-primary);
}

.nav-item:hover::after {
    width: 100%;
}

/* Language Flags - Premium Style */
.lang-switch {
    display: flex;
    gap: 12px;
    margin: 0 20px;
    background: transparent;
    padding: 0;
}

.lang-btn {
    border: 2px solid transparent;
    background: none;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.7;
    transform: scale(0.9);
}

.lang-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lang-btn.active {
    border-color: var(--color-gold);
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.lang-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grad-primary);
    border-radius: 0 0 60px 60px;
    overflow: hidden;
    margin-bottom: 60px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 40px rgba(26, 95, 80, 0.4);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://www.transparenttextures.com/patterns/arabesque.png');
    /* Subtle pattern */
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    padding: 60px 40px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 25px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.hero p {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 40px;
    font-weight: 300;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-accent {
    background: var(--grad-gold);
    color: white;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.btn-accent:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.5);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(26, 95, 80, 0.2);
    font-size: 0.9rem;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: white;
}

/* Products Grid */
.products-section .section-title h2 {
    font-size: 2.8rem;
    color: var(--color-primary-dark);
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '♦';
    /* Moroccan decorative symbol */
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-gold);
    font-size: 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
}

/* Card Design */
.card {
    background: var(--color-card-bg);
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: var(--shadow-soft);
    transition: all 0.4s ease;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-gold-light);
}

.card-image {
    position: relative;
    height: 300px;
    /* Taller images */
    overflow: hidden;
    background: #f0f0f0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.card:hover .card-image img {
    transform: scale(1.08);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    background: white;
    color: var(--color-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
}

.card-image:hover .slider-btn {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.prev-btn {
    left: 15px;
}

.next-btn {
    right: 15px;
}

.card-body {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.4rem;
    color: var(--color-primary-dark);
    margin-bottom: 8px;
    font-weight: 700;
}

.product-desc {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-gold-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.card-actions {
    display: block;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 20px;
}

/* Detail Page */
.detail-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    margin-top: 40px;
}

.detail-gallery {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    height: fit-content;
    /* ensure buttons are relative to this */
}

.detail-gallery .slider-btn {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    background: rgba(255, 255, 255, 0.9);
    width: 44px;
    height: 44px;
}

.detail-gallery .prev-btn {
    left: 20px;
}

.detail-gallery .next-btn {
    right: 20px;
}

.main-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    /* Fix potential inline-block gap */
}

.detail-info {
    padding: 20px 0;
}

.detail-title {
    font-size: 3rem;
    color: var(--color-primary-dark);
    margin-bottom: 10px;
    line-height: 1.2;
}

.detail-price {
    font-size: 2rem;
    color: var(--color-gold);
    font-weight: 700;
    margin-bottom: 30px;
}

.detail-meta {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    border-left: 5px solid var(--color-primary);
    margin-bottom: 30px;
}

body.lang-ar .detail-meta {
    border-left: none;
    border-right: 5px solid var(--color-primary);
}

.detail-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    margin-bottom: 8px;
}

.quantity-selector {
    background: #fff;
    border: 1px solid #eee;
    display: inline-flex;
    align-items: center;
    gap: 20px;
    padding: 10px 20px;
    border-radius: 50px;
    margin-bottom: 30px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.qty-btn:hover {
    background: var(--color-gold);
    color: white;
}

.whatsapp-btn-large {
    width: 100%;
    border-radius: 16px;
    background: #25D366;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 20px;
    border: none;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.whatsapp-btn-large:hover {
    background: #1ebc57;
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(37, 211, 102, 0.4);
}

/* Footer */
footer {
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 60px 0;
    margin-top: 100px;
    border-top: 5px solid var(--color-gold);
}

/* Mobile Nav Styles */
.menu-toggle {
    display: none;
    /* Hidden on desktop */
    font-size: 1.5rem;
    color: var(--color-primary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        /* Visible on mobile */
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        text-align: center;
        z-index: 1000;
    }

    .nav-links.active {
        display: flex;
    }

    .hero {
        min-height: 60vh;
        border-radius: 0 0 40px 40px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .card-actions {
        grid-template-columns: 1fr;
    }

    /* Force slider buttons visible on mobile */
    .slider-btn {
        opacity: 1 !important;
        transform: translateY(-50%) scale(1) !important;
    }
}