/* ---
  FICHIER: style.css
  SOCIÉTÉ: Scila (صلة)
  DESCRIPTION: Feuille de style principale (v4 - Thème Noir & Or, fix mobile)
--- */

/* --- 1. Variables Globales (Palette Noir/Or/Gris) --- */
:root {
    --color-background: #181818; /* Fond principal (Presque noir) */
    --color-text: #F0F0F0;       /* Texte (Blanc cassé) */
    --color-primary: #D1B074;   /* Or (Accents de luxe) */
    --color-card-bg: #222222;    /* Fond des cartes/menus (Gris foncé) */
    --color-border: #3A3A3A;     /* Bordures subtiles */
    --color-white: #FFFFFF;
    --color-whatsapp: #25D366;
    
    /* Polices */
    --font-headings: 'Georgia', 'Times New Roman', serif;
    --font-body: 'Arial', 'Helvetica', sans-serif;
    
    /* Police pour l'arabe */
    --font-arabic: 'Tajawal', sans-serif;
}

/* --- 2. Réinitialisation de Base et Styles du 'body' --- */

/* Import de la police arabe */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

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

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-background); /* Appliqué ici */
    color: var(--color-text); /* Texte global en blanc cassé */
    line-height: 1.6;
}

[lang="ar"] {
    font-family: var(--font-arabic);
    text-align: right; 
}

h1, h2, h3, h4 {
    font-family: var(--font-headings);
    color: var(--color-text);
    font-weight: 500;
    margin-bottom: 1rem;
}

a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-primary);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- 3. Page de Choix de Langue (Splash Screen) --- */
.splash-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    
    /* Fond photo Bakhoor */
    background-image: url('images/fond-scila.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* L'image de fond ne bouge pas au défilement */
    position: relative;
}
/* Ajout d'un voile sombre pour la lisibilité */
.splash-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); /* Voile sombre */
    z-index: 1;
}
/* S'assurer que le contenu est au-dessus du voile */
.splash-logo, .lang-selector {
    position: relative;
    z-index: 2;
}

.splash-logo {
    width: 180px; /* Taille par défaut pour les grands écrans */
    margin-bottom: 2.5rem;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.2));
}

.lang-selector {
    display: flex;
    gap: 1.5rem; /* Espace entre les boutons */
}

.lang-button {
    font-family: var(--font-headings);
    font-size: 1.2rem;
    padding: 12px 30px;
    border: 1px solid var(--color-primary);
    background: rgba(0, 0, 0, 0.3); /* Fond semi-transparent */
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px; /* Pour assurer une certaine largeur */
    text-align: center;
}
.lang-button:hover {
    background-color: var(--color-primary);
    color: #000; /* Texte noir sur fond or */
}

/* --- 4. Sélecteur de Langue Haut de Page (Luxe) --- */
.lang-switcher-top {
    text-align: right;
    padding: 10px 0;
    margin-bottom: 1rem;
    position: absolute;
    top: 15px;
    right: 2.5rem;
    z-index: 10;
}
.lang-switcher-top a {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: bold;
    padding: 5px 8px;
    border: 1px solid var(--color-primary);
    background: transparent; /* Fond transparent */
    color: var(--color-primary); /* Texte Or */
    margin-left: 5px;
}
.lang-switcher-top a:hover,
.lang-switcher-top a.active { /* 'active' pour la langue actuelle */
    background: var(--color-primary);
    color: var(--color-background); /* Texte noir sur fond Or */
    border-color: var(--color-primary);
}

/* --- 5. Structure Principale du Site (Sidebar + Contenu) --- */
.page-wrapper {
    display: flex;
    min-height: 100vh;
}
[dir="ltr"] .page-wrapper { flex-direction: row; }
[dir="rtl"] .page-wrapper { flex-direction: row-reverse; }

/* --- 6. Sidebar (Menu de Navigation) --- */
.sidebar {
    width: 260px;
    background-color: var(--color-card-bg); /* Fond gris foncé */
    border-right: 1px solid var(--color-border);
    padding: 2rem;
    position: fixed;
    height: 100%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
}
[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--color-border);
}

.sidebar-logo {
    width: 100px;
    margin-bottom: 2rem;
    align-self: center;
}
.sidebar-nav ul { list-style: none; }
.sidebar-nav li a {
    display: block;
    padding: 0.8rem 0;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--color-border);
}
.sidebar-nav li:last-child a { border-bottom: none; }

/* Sous-menu */
.sidebar-submenu {
    padding-top: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}
.sidebar-submenu a {
    display: block;
    padding: 0.6rem 0;
    font-size: 0.95rem;
    color: #AAA; /* Texte gris clair pour sous-menu */
}
[dir="ltr"] .sidebar-submenu a { padding-left: 1.5rem; }
[dir="rtl"] .sidebar-submenu a { padding-right: 1.5rem; }

/* Bouton mobile */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 15px;
    z-index: 101;
    background: var(--color-card-bg); /* Fond gris foncé */
    border: 1px solid var(--color-border);
    padding: 10px;
    cursor: pointer;
}
[dir="ltr"] .mobile-nav-toggle { left: 15px; }
[dir="rtl"] .mobile-nav-toggle { right: 15px; }
.mobile-nav-toggle svg { stroke: var(--color-text); } /* S'assurer que l'icône est visible */


/* --- 7. Contenu Principal --- */
.main-content {
    flex: 1;
    padding: 2.5rem;
    position: relative;
    padding-top: 60px; /* Espace pour les boutons de langue */
}
[dir="ltr"] .main-content { margin-left: 260px; }
[dir="rtl"] .main-content { margin-right: 260px; }
[dir="rtl"] .lang-switcher-top { right: auto; left: 2.5rem; }

/* Conteneur pour centrer (Accueil, Contact) */
.content-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--color-card-bg); /* Fond gris foncé */
    padding: 2rem;
    border: 1px solid var(--color-border);
}
.content-container h1 {
    font-size: 2rem;
    color: var(--color-primary); /* Titre en Or */
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.5rem;
    display: inline-block;
}
.content-container p {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* --- 8. Page "Tous les Produits" (Grille) --- */
.products-page-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}
.category-title {
    font-size: 2.2rem;
    color: var(--color-primary); /* Titres de catégorie en Or */
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 10px;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background-color: var(--color-card-bg); /* Fond gris foncé */
    border: 1px solid var(--color-border);
    text-align: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.product-card:hover {
    box-shadow: 0 4px 15px rgba(209, 176, 116, 0.1); /* Lueur Or */
    transform: translateY(-5px);
}

.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-bottom: 1px solid var(--color-border);
}

.product-info { padding: 1.2rem; }
.product-info h3 {
    font-size: 1.1rem;
    font-family: var(--font-body);
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text); /* Texte blanc cassé */
}
.product-info .price {
    font-size: 1rem;
    color: var(--color-primary); /* Prix en Or */
    font-weight: bold;
}

/* --- 9. Page "Contact" --- */
.contact-info {
    list-style: none;
    margin-top: 2rem;
}
.contact-info li {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
}
.contact-info svg {
    width: 24px;
    height: 24px;
    fill: var(--color-primary); /* Icônes en Or */
}
[dir="ltr"] .contact-info svg { margin-right: 1rem; }
[dir="rtl"] .contact-info svg { margin-left: 1rem; }

.contact-socials {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
}
.contact-socials a { margin: 0 1rem; }
.contact-socials svg {
    width: 30px;
    height: 30px;
    fill: var(--color-text); /* Icônes sociales en blanc cassé */
    transition: fill 0.3s ease;
}
.contact-socials svg:hover {
    fill: var(--color-primary); /* Survol en Or */
}


/* --- 10. Bouton "Commander" (WhatsApp) --- */
.whatsapp-cta {
    display: block;
    background-color: var(--color-whatsapp);
    color: var(--color-white);
    padding: 0.8rem 1.2rem;
    margin-top: 1rem;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: opacity 0.3s ease;
}
.whatsapp-cta:hover {
    color: var(--color-white);
    opacity: 0.9;
}
.whatsapp-cta::before {
    content: '✓ ';
    font-weight: bold;
}

/* --- 11. Pied de Page (Footer) --- */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #888;
    border-top: 1px solid var(--color-border);
    background: var(--color-card-bg); /* Fond gris foncé */
}

/* --- 12. Responsive (Mobile) --- */
@media (max-width: 768px) {
    /* Menu et Contenu */
    [dir="ltr"] .main-content { margin-left: 0; }
    [dir="rtl"] .main-content { margin-right: 0; }

    .main-content {
        padding: 1.5rem;
        padding-top: 70px; 
    }

    .lang-switcher-top {
        top: 15px;
        right: 15px;
        z-index: 101;
    }
    [dir="rtl"] .lang-switcher-top {
        right: auto;
        left: 15px;
    }

    [dir="ltr"] .mobile-nav-toggle { left: 15px; top: 60px; }
    [dir="rtl"] .mobile-nav-toggle { right: 15px; top: 60px; }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
        transform: translateX(-100%);
    }
    .sidebar.active { transform: translateX(0); }

    [dir="rtl"] .sidebar {
        left: auto;
        right: 0;
        transform: translateX(100%);
    }
    [dir="rtl"] .sidebar.active { transform: translateX(0); }
    
    .mobile-nav-toggle { display: block; }
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 999;
        display: none;
    }
    .overlay.active { display: block; }

    .product-grid { grid-template-columns: 1fr; }

    /* Ajustements Spécifiques pour la page de choix de langue (index.html) sur mobile */
    .splash-logo {
        width: 120px; /* Réduire la taille du logo sur mobile */
        margin-bottom: 1.5rem; /* Réduire l'espace sous le logo */
    }

    .lang-selector {
        flex-direction: column; /* Empiler les boutons verticalement */
        gap: 0.8rem; /* Réduire l'espace entre les boutons */
        margin-top: 1rem; /* Ajouter un peu d'espace au-dessus des boutons */
    }

    .lang-button {
        font-size: 1rem; /* Réduire la taille de la police des boutons */
        padding: 10px 20px; /* Réduire le padding des boutons */
        min-width: 120px; /* Assurer une largeur minimale */
    }
}
