/* =========================================================
   ANDALOCI — Tapis & Artisanat Marocain
   Design system inspired by zelij (mosaïque marocaine) :
   bleu Majorelle, terre cuite, émeraude et or sur fond crème.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
    /* Palette zelij */
    --blue-deep:      #0F3D68;
    --blue:           #1B5C99;
    --blue-soft:      #3E7CB8;
    --terracotta:     #BF5B2B;
    --terracotta-dark:#9C441C;
    --gold:           #D6A542;
    --gold-soft:      #EAC978;
    --emerald:        #1E6E56;
    --cream:          #FAF4E8;
    --cream-deep:     #F0E6D2;
    --ink:            #2B2117;
    --card-background:#FFFFFF;

    --font-heading: 'Amiri', serif;
    --font-body: 'Cairo', sans-serif;

    --shadow-sm: 0 2px 8px rgba(15, 61, 104, 0.08);
    --shadow: 0 10px 30px rgba(43, 33, 23, 0.12);
    --shadow-lift: 0 18px 34px rgba(15, 61, 104, 0.22);
    --radius: 16px;
    --radius-sm: 10px;
}

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

html {
    overflow-x: hidden;
}

body {
    background-color: var(--cream);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

a { color: inherit; }

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

/* =========================================================
   HEADER — bandeau bleu profond avec motif zelij en filigrane
   ========================================================= */

.main-header {
    position: relative;
    background:
        radial-gradient(circle at 12px 12px, rgba(214,165,66,0.35) 0 3px, transparent 4px),
        radial-gradient(circle at 36px 36px, rgba(214,165,66,0.35) 0 3px, transparent 4px),
        conic-gradient(from 45deg at 24px 24px,
            rgba(255,255,255,0.06) 0deg 90deg, transparent 90deg 180deg,
            rgba(255,255,255,0.06) 180deg 270deg, transparent 270deg 360deg),
        linear-gradient(135deg, var(--blue-deep), var(--blue) 65%, var(--blue-soft));
    background-size: 48px 48px, 48px 48px, 48px 48px, cover;
    padding: 28px clamp(16px, 4vw, 48px) 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

/* bordure festonnée façon arc marocain, en bas du bandeau */
.main-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 22px;
    background-image: radial-gradient(circle at 50% 0, transparent 12px, var(--cream) 13px);
    background-size: 34px 22px;
    background-repeat: repeat-x;
}

.header-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1200px;
}

.logo-container {
    flex: 0 0 auto;
    background-color: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    width: 220px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    padding: 10px 16px;
    border: 3px solid var(--gold-soft);
}

.logo-container a {
    display: block;
    height: 100%;
    width: 100%;
}

.logo-img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.site-title-container {
    flex: 1 1 320px;
    text-align: center;
    padding: 8px 12px;
}

.site-title-container .eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--gold-soft);
    margin-bottom: 6px;
}

.site-title-container h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    color: #FFFFFF;
    line-height: 1.2;
}

.site-title-container p {
    margin-top: 8px;
    color: var(--cream-deep);
    font-size: 0.95rem;
    max-width: 46ch;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================
   LAYOUT
   ========================================================= */

.container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 34px clamp(16px, 4vw, 48px) 60px;
}

/* =========================================================
   SIDEBAR / FILTRES — desktop = colonne, mobile = puces
   ========================================================= */

.sidebar {
    background-color: var(--card-background);
    padding: 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 20px;
    border-top: 4px solid var(--gold);
}

.sidebar h3 {
    font-family: var(--font-heading);
    margin-bottom: 18px;
    color: var(--terracotta-dark);
    font-size: 1.3rem;
    font-weight: 700;
}

.sidebar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar ul li {
    flex: 0 0 auto;
}

.sidebar ul li a {
    text-decoration: none;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 999px;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.sidebar ul li a i {
    width: 20px;
    text-align: center;
    color: var(--blue);
    transition: color 0.25s ease;
}

.sidebar ul li a:hover {
    background-color: var(--cream-deep);
    transform: translateX(2px);
}

.sidebar ul li a.active {
    background: linear-gradient(135deg, var(--terracotta), var(--terracotta-dark));
    color: #fff;
    box-shadow: 0 6px 14px rgba(191, 91, 43, 0.35);
}

.sidebar ul li a.active i {
    color: var(--gold-soft);
}

/* =========================================================
   PRODUITS
   ========================================================= */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 26px;
    align-content: start;
}

.product-card {
    background-color: var(--card-background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(15, 61, 104, 0.06);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
}

.product-media {
    position: relative;
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.category-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(15, 61, 104, 0.88);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 6px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    backdrop-filter: blur(2px);
}

.category-badge.gamme1 { background: rgba(156, 68, 28, 0.9); }
.category-badge.gamme2 { background: rgba(214, 165, 66, 0.92); color: var(--ink); }
.category-badge.gamme3 { background: rgba(30, 110, 86, 0.92); }

.product-info {
    padding: 20px;
    text-align: center;
}

.product-info h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.08rem;
    margin-bottom: 8px;
    color: var(--blue-deep);
}

.price {
    font-weight: 800;
    color: var(--terracotta-dark);
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.price::after {
    content: "";
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(18, 140, 126, 0.3);
}

.whatsapp-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 14px rgba(18, 140, 126, 0.4);
}

.whatsapp-btn i {
    font-size: 1.25rem;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: var(--blue-deep);
    font-weight: 600;
    background: var(--card-background);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    background: var(--blue-deep);
    color: var(--cream-deep);
    text-align: center;
    padding: 26px 16px;
    font-size: 0.85rem;
}

.site-footer strong {
    color: #fff;
}

/* =========================================================
   RESPONSIVE — Tablette
   ========================================================= */

@media (max-width: 992px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        padding: 18px;
    }

    .sidebar h3 {
        margin-bottom: 12px;
        font-size: 1.15rem;
    }

    .sidebar ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .sidebar ul li a {
        padding: 9px 14px;
        font-size: 0.88rem;
    }
}

/* =========================================================
   RESPONSIVE — Mobile
   ========================================================= */

@media (max-width: 600px) {
    .main-header {
        padding: 22px 16px 40px;
        gap: 18px;
    }

    .header-inner {
        flex-direction: column;
    }

    .logo-container {
        height: 80px;
        width: 170px;
    }

    .site-title-container {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    .site-title-container h1 {
        font-size: 1.5rem;
    }

    .site-title-container p {
        font-size: 0.85rem;
        max-width: 32ch;
    }

    .container {
        padding: 24px 14px 40px;
        gap: 20px;
        width: 100%;
    }

    .sidebar {
        border-radius: var(--radius-sm);
    }

    .sidebar ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .sidebar ul li a {
        white-space: nowrap;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

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