/* ========================================
   VARIABLES DE THÈME (personnalisables par client)
   ======================================== */
:root {
    --brand-primary: #C8963E;
    --brand-secondary: #4A2E1B;
    --brand-on-secondary: #ffffff;
    --brand-on-primary: #ffffff;
}

/* ========================================
   RÉINITIALISATION
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fbf9f6;
    min-height: 100vh;
}

/* ========================================
   NAVBAR HAUTE - WARMM CAFÉ THEME
   ======================================== */
.navbar {
    background: linear-gradient(135deg, #4A2E1B 0%, #3D2314 50%, #26140A 100%); /* repli */
    background: linear-gradient(135deg, var(--brand-secondary) 0%, color-mix(in srgb, var(--brand-secondary), #000 35%) 100%);
    padding: 15px 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-logo {
    color: var(--brand-primary);
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-logo-img {
    height: 46px;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.4));
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--brand-on-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    opacity: 0.92;
}

.nav-links a:hover {
    background: color-mix(in srgb, var(--brand-primary) 25%, transparent);
    color: var(--brand-primary);
    transform: translateY(-2px);
    opacity: 1;
}

.nav-links a.active {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 1;
}

.lang-switch { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; }
.lang-switch a { padding: 2px 7px; font-size: 12px; opacity: 1; border: 1px solid currentColor; border-radius: 4px; }
.lang-switch a:hover { background: color-mix(in srgb, var(--brand-primary) 30%, transparent); color: var(--brand-on-secondary); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-user .user-role {
    background: rgba(200, 150, 62, 0.4);
    color: #F3E5AB;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ========================================
   POP-UP MODALE
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal {
    background: white;
    border-radius: 16px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    background: linear-gradient(135deg, #4A2E1B 0%, #3D2314 100%);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #F3E5AB;
    font-size: 22px;
    margin: 0;
}

.modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #3D2314;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2d9d0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #C8963E;
    box-shadow: 0 0 0 4px rgba(200, 150, 62, 0.15);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #C8963E 0%, #A67528 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(200, 150, 62, 0.4);
}

.register-link {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #636e72;
}

.register-link a {
    color: #C8963E;
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    text-decoration: underline;
}

.role-note {
    background: #fff8e6;
    border: 1px solid #f0d59a;
    color: #b7791f;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    padding: 9px 12px;
    margin-bottom: 14px;
}

/* ========================================
   CONTENU PRINCIPAL
   ======================================== */
.main-content {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 30px;
}

.main-content h1 {
    color: #3D2314;
    font-size: 32px;
    margin-bottom: 10px;
}

.main-content p {
    color: #636e72;
    font-size: 18px;
    margin-bottom: 10px;
}

/* ========================================
   MÉGA MENU DÉROULANT
   ======================================== */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown .nav-link {
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 280px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 10px 0;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.dropdown-content.show {
    display: block;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mega-item {
    position: relative;
}

.mega-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #2d3436;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.mega-link:hover {
    background: #fdf8f0;
    color: #C8963E;
}

.mega-link .cat-icon {
    font-size: 18px;
}

.mega-divider {
    height: 1px;
    background: #e9ecef;
    margin: 6px 15px;
}

/* ========================================
   SECTION PRODUITS
   ======================================== */
#productsSection {
    padding: 20px 0;
    margin-top: 20px;
    display: none;
}

.products-header {
    margin-bottom: 25px;
}

.products-header h2 {
    color: #3D2314;
    font-size: 28px;
    font-weight: 700;
}

.products-header p {
    color: #636e72;
    font-size: 16px;
}

.category-section {
    margin-bottom: 30px;
}

.category-title {
    font-size: 20px;
    font-weight: 700;
    color: #3D2314;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #C8963E;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* ========================================
   PRODUIT SÉLECTIONNÉ
   ======================================== */
.selected-product-card {
    display: flex;
    gap: 30px;
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    align-items: center;
}

.selected-product-image {
    font-size: 90px;
    min-width: 150px;
    text-align: center;
    background: #fbf5ed;
    border-radius: 12px;
    padding: 20px;
}

.selected-product-image img {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
}

.selected-product-info {
    flex: 1;
}

.selected-product-info h3 {
    font-size: 24px;
    color: #3D2314;
    margin-bottom: 8px;
}

.selected-product-info p {
    font-size: 16px;
    color: #636e72;
    margin-bottom: 15px;
}

.selected-product-bottom {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.selected-product-price {
    font-size: 28px;
    font-weight: 700;
    color: #C8963E;
}

/* ========================================
   GRILLE DES PRODUITS
   ======================================== */
.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
    cursor: pointer;
}

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

.product-card .product-image {
    width: 100%;
    height: 150px;
    background: #fbf5ed;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
}

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

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

.product-card .product-info h3 {
    font-size: 16px;
    color: #3D2314;
    margin-bottom: 4px;
}

.product-card .product-info .product-description {
    font-size: 13px;
    color: #636e72;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-card .product-info .product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card .product-info .product-price {
    font-size: 18px;
    font-weight: 700;
    color: #C8963E;
}

.product-card .product-info .product-status {
    font-size: 10px;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.product-card .product-info .product-status.available {
    background: #e6f9ed;
    color: #00b894;
}

.product-card .product-info .product-status.unavailable {
    background: #fde8e8;
    color: #ff6b6b;
}

.btn-add-cart {
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    background: #3D2314;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-add-cart:hover {
    background: #C8963E;
}

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #868e96;
    font-size: 16px;
}

/* ========================================
   PANIER
   ======================================== */
.cart-modal {
    width: 460px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f5;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-weight: 600;
    color: #2d3436;
}

.cart-item-price {
    font-size: 13px;
    color: #C8963E;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #dfe6e9;
    background: white;
    color: #3D2314;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.qty-btn:hover {
    background: #f0f4f8;
}

.qty-val {
    min-width: 20px;
    text-align: center;
    font-weight: 600;
}

.cart-remove {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 16px;
    cursor: pointer;
}

.cart-empty {
    text-align: center;
    color: #868e96;
    padding: 20px 0;
}

.cart-summary {
    margin: 15px 0;
    border-top: 2px solid #eef2f5;
    padding-top: 12px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    color: #636e72;
    font-size: 14px;
}

.cart-total-row.cart-grand {
    font-size: 18px;
    font-weight: 700;
    color: #3D2314;
    border-top: 1px solid #eef2f5;
    margin-top: 8px;
    padding-top: 10px;
}

/* ========================================
   TOAST PANIER
   ======================================== */
.cart-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #3D2314;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 3000;
}

.cart-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   PAGE D'ACCUEIL - HERO / À PROPOS / APP
   ======================================== */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    background: linear-gradient(135deg, #4A2E1B 0%, #3D2314 55%, #26140A 100%); /* repli */
    background: linear-gradient(135deg, var(--brand-secondary) 0%, color-mix(in srgb, var(--brand-secondary), #000 45%) 100%);
    color: var(--brand-on-secondary);
    padding: 60px 40px;
    border-radius: 0 0 24px 24px;
    overflow: hidden;
    flex-wrap: wrap;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--brand-primary) 25%, transparent), transparent 55%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 560px;
    flex: 1 1 380px;
}

.hero-badge {
    display: inline-block;
    background: color-mix(in srgb, var(--brand-on-secondary) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-on-secondary) 30%, transparent);
    color: var(--brand-on-secondary);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
}

.hero-content h1 {
    font-size: 42px;
    line-height: 1.15;
    margin-bottom: 16px;
    color: var(--brand-on-secondary);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.hero-sub {
    font-size: 17px;
    line-height: 1.6;
    color: var(--brand-on-secondary);
    opacity: 0.9;
    margin-bottom: 26px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-hero {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    border: none;
    padding: 14px 30px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.btn-hero:hover {
    background: color-mix(in srgb, var(--brand-primary), #000 14%);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.hero-status {
    margin-top: 22px;
    font-size: 14px;
    color: var(--brand-on-secondary);
    opacity: 0.85;
}

.hero-image {
    position: relative;
    z-index: 1;
    flex: 1 1 320px;
    max-width: 460px;
}

.hero-image img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
    border: 4px solid rgba(255, 255, 255, 0.2);
    background: #3D2314;
}

/* À PROPOS */
.about {
    display: flex;
    align-items: center;
    gap: 40px;
    max-width: 1100px;
    margin: 56px auto;
    padding: 0 24px;
    flex-wrap: wrap;
}
.about.rev { flex-direction: row-reverse; }
.about.rev .about-text { text-align: left; }

.about-image {
    flex: 1 1 380px;
}

.about-image img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(61, 35, 20, 0.15);
    background: #dfe6e9;
}

.about-text {
    flex: 1 1 420px;
}

.section-tag {
    display: inline-block;
    color: var(--brand-primary);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

/* GALERIE DE PHOTOS */
.gallery {
    max-width: 1100px;
    margin: 56px auto;
    padding: 0 24px;
    text-align: center;
}
.gallery .app-head { margin-bottom: 28px; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    transition: transform 0.3s ease;
}
.gallery-item img:hover { transform: scale(1.03); }

/* COORDONNÉES */
.contact-info {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 24px;
}
.contact-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 24px 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #444;
}
.contact-icon { font-size: 20px; }


.about-text h2 {
    font-size: 30px;
    color: #3D2314;
    margin-bottom: 16px;
}

.about-text p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 14px;
}

.about-features {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.about-features li {
    background: #fff;
    border: 1px solid #e9ecef;
    border-left: 4px solid #C8963E;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    color: #3D2314;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* PRÉSENTATION DE L'APPLICATION */
.app-presentation {
    background: linear-gradient(180deg, #ffffff 0%, #fbf9f6 100%);
    padding: 56px 24px;
}

.app-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 40px;
}

.app-head h2 {
    font-size: 30px;
    color: #3D2314;
    margin-bottom: 10px;
}

.app-head p {
    color: #636e72;
    font-size: 16px;
}

.app-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    background: #fff;
    border-radius: 16px;
    padding: 26px 22px;
    text-align: center;
    box-shadow: 0 10px 26px rgba(61, 35, 20, 0.06);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(200, 150, 62, 0.25);
    border-color: #C8963E;
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.feature-card h3 {
    color: #3D2314;
    font-size: 17px;
    margin-bottom: 8px;
}

.feature-card p {
    color: #636e72;
    font-size: 14px;
    line-height: 1.5;
}

/* BANNIÈRE DE PROMOTIONS / ANNONCE */
.promo-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--brand-secondary, #3D2314), color-mix(in srgb, var(--brand-secondary, #3D2314), #000 30%));
    color: var(--brand-on-secondary, #fff);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.promo-icon { font-size: 18px; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

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

    .nav-links {
        justify-content: center;
        gap: 10px;
    }

    .nav-links a {
        font-size: 13px;
        padding: 6px 12px;
    }

    .nav-user {
        justify-content: center;
        padding: 6px 12px;
        font-size: 13px;
    }

    .main-content {
        padding: 0 15px;
    }

    .hero {
        padding: 40px 22px;
        flex-direction: column;
        text-align: center;
    }
    .hero-content h1 { font-size: 30px; }
    .hero-actions { justify-content: center; }
    .hero-image { max-width: 100%; }
    .hero-image img { height: 240px; }
    .about { flex-direction: column; text-align: center; }
    .about.rev { flex-direction: column; }
    .about.rev .about-text { text-align: center; }
    .about-features { justify-content: center; }

    .category-products {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .category-products {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .product-card .product-image {
        height: 100px;
        font-size: 35px;
    }
}