/* ========== VARIABLES ========== */
:root {
    --red: #e63946;
    --red-dark: #c1121f;
    --red-light: #f4a261;
    --bg-light: #fff9f0;
    --card-bg: rgba(255, 248, 240, 0.9);
    --text-dark: #2d2a24;
    --gray: #6c757d;
    --shadow: 0 10px 25px rgba(0,0,0,0.08);
    --shadow-hover: 0 20px 35px rgba(230,57,70,0.15);
    --shadow-neon: 0 0 25px rgba(230,57,70,0.5);
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, #fff9f0 0%, #ffe8d6 100%);
    color: var(--text-dark);
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* ========== NAVBAR ========== */
.navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.8rem 1rem;
    border-bottom: 2px solid var(--red);
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.logo-icon i {
    font-size: 1.5rem;
    color: white;
}

.logo-icon:hover {
    transform: scale(1.05);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-main {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-sub {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--red-dark);
    letter-spacing: 1px;
}

/* Barre de recherche */
.search-wrapper {
    flex: 1;
    max-width: 500px;
}
.btn-retour {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-bottom: 1rem;
}
.btn-retour:hover {
    background: #5a6268;
    transform: translateX(-3px);
}
.search-wrapper form {
    display: flex;
    background: white;
    border-radius: 50px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border: 1px solid #ffe0cc;
    transition: var(--transition);
}

.search-wrapper form:focus-within {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(230,57,70,0.2);
    transform: scale(1.02);
}

.search-wrapper input {
    background: transparent;
    border: none;
    padding: 0.8rem 1.2rem;
    color: var(--text-dark);
    outline: none;
    flex: 1;
    min-width: 0;
}

.voice-lang {
    background: var(--red);
    border: none;
    padding: 0 1rem;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.voice-lang:hover {
    background: var(--red-dark);
}

.voice-btn {
    background: var(--red);
    border: none;
    padding: 0 1rem;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.voice-btn:hover {
    background: var(--red-dark);
}

.voice-btn.listening {
    background: #ff9800;
    animation: pulseMic 1s infinite;
}

@keyframes pulseMic {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.search-wrapper button[type="submit"] {
    background: var(--red);
    border: none;
    padding: 0 1.5rem;
    border-radius: 0 50px 50px 0;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.search-wrapper button[type="submit"]:hover {
    background: var(--red-dark);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-actions a, .user-actions span {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.user-actions a:hover {
    color: var(--red);
}

.cart-link {
    position: relative;
    font-size: 1.4rem;
    transition: var(--transition);
}

.cart-link:hover {
    transform: scale(1.1);
    color: var(--red);
}

.cart-badge {
    position: absolute;
    top: -10px;
    right: -14px;
    background: white;
    color: var(--red);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    box-shadow: 0 0 0 1px var(--red);
}

.admin-link {
    background: var(--red-light);
    padding: 4px 10px;
    border-radius: 30px;
    color: var(--text-dark) !important;
}

.menu-icon {
    display: none;
    font-size: 1.6rem;
    cursor: pointer;
}

/* ========== SLIDER ========== */
.hero-slider {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.slider-container {
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.slider-track {
    display: flex;
    transition: transform 0.8s ease;
}

.slide {
    min-width: 100%;
    position: relative;
    height: 500px;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.85);
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.4), transparent);
}

.slide-caption {
    position: absolute;
    bottom: 20%;
    left: 5%;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    z-index: 2;
}

.slide-caption h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    background: linear-gradient(135deg, var(--red), var(--red-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    color: var(--red-dark);
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 3;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.slider-arrow:hover {
    background: var(--red);
    color: white;
}

.prev { left: 20px; }
.next { right: 20px; }

.slider-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.2);
    z-index: 3;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--red);
    transition: width 0.1s linear;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 3;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: var(--red);
    width: 28px;
    border-radius: 10px;
}

/* ========== CATÉGORIES ========== */
.categories {
    padding: 4rem 0;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    justify-content: center;
}

/* Cartes toujours visibles, effet lumineux au survol */
.category-card {
    background: var(--card-bg);
    backdrop-filter: blur(4px);
    border-radius: 28px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    border: 1px solid rgba(230,57,70,0.2);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    box-shadow: var(--shadow);
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 0 25px rgba(230,57,70,0.6), 0 15px 35px rgba(0,0,0,0.2);
    border-color: var(--red);
}

.card-img {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--red);
    transition: all 0.3s ease;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card:hover .card-img {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(230,57,70,0.2);
}

.category-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.category-card p {
    font-size: 0.75rem;
    color: var(--gray);
    margin-bottom: 0.8rem;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(230,57,70,0.1);
    padding: 0.4rem 1rem;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--red-dark);
    transition: all 0.3s ease;
}

.btn-link:hover {
    background: var(--red);
    color: white;
    gap: 0.6rem;
}

/* ========== PRODUITS TRÈS TRÈS COMPACTS ========== */
.produits-page { 
    padding: 2rem 1rem; 
    background: linear-gradient(145deg, #fff9f0 0%, #ffe8d6 100%); 
    min-height: 60vh; 
}

.produits-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 
    gap: 0.6rem; 
    margin-top: 2rem; 
}

.produit-card { 
    background: var(--card-bg);
    backdrop-filter: blur(4px);
    border-radius: 10px; 
    padding: 0.4rem; 
    text-align: center;
    border: 1px solid rgba(230,57,70,0.2);
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.produit-card::before { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: -100%; 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(90deg, transparent, rgba(230,57,70,0.1), transparent); 
    transition: left 0.5s; 
}

.produit-card:hover::before { 
    left: 100%; 
}

.produit-card:hover { 
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--red);
}

.produit-card img { 
    width: 100%; 
    height: 85px; 
    object-fit: cover; 
    border-radius: 8px; 
    transition: transform 0.3s ease; 
}

.produit-card:hover img { 
    transform: scale(1.02); 
}

.produit-card h3 { 
    margin: 0.25rem 0 0.05rem; 
    font-size: 0.65rem; 
    font-weight: 700; 
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.produit-card p { 
    font-size: 0.5rem; 
    color: var(--gray); 
    margin-bottom: 0.15rem; 
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prix { 
    font-size: 0.7rem; 
    font-weight: 800; 
    color: var(--red); 
    margin: 0.1rem 0; 
}

/* Styles pour les variantes */
.variantes-select {
    width: 100%;
    padding: 0.2rem;
    margin: 0.2rem 0;
    border: 1px solid var(--red);
    border-radius: 5px;
    font-size: 0.5rem;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.variantes-select:focus {
    outline: none;
    border-color: var(--red-dark);
    box-shadow: 0 0 0 2px rgba(230,57,70,0.2);
}

.badge-variante {
    display: inline-block;
    background: #ff9800;
    color: white;
    font-size: 0.45rem;
    padding: 1px 3px;
    border-radius: 12px;
    margin-top: 2px;
}

.detail-prix {
    font-size: 0.45rem;
    color: #28a745;
    margin-top: 1px;
}

.btn-add {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: white;
    border: none;
    padding: 0.25rem 0.3rem;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.5rem;
    width: 100%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.btn-add i { 
    font-size: 0.55rem;
    transition: transform 0.2s ease; 
}

.btn-add:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 20px rgba(230,57,70,0.4); 
}

.btn-add:hover i { 
    transform: translateX(3px); 
}

.btn-add:active { 
    transform: translateY(1px); 
}

/* Toast notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #e63946, #c1121f);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.toast-notification.show { 
    opacity: 1; 
    transform: translateX(0); 
}

.toast-notification i { 
    font-size: 1.1rem; 
    animation: bounce 0.5s ease; 
}

@keyframes bounce { 
    0%,100%{ transform: scale(1); } 
    50%{ transform: scale(1.2); } 
}

/* Animation badge panier */
.cart-badge-animate { 
    animation: badgePop 0.3s ease !important; 
}

@keyframes badgePop { 
    0% { transform: scale(1); } 
    50% { transform: scale(1.3); background: #e63946; color: white; } 
    100% { transform: scale(1); } 
}

.cart-link.has-items { 
    animation: cartBlinkPermanent 0.8s infinite !important; 
}

@keyframes cartBlinkPermanent { 
    0% { color: #2d2a24; text-shadow: 0 0 0 #e63946; } 
    50% { color: #e63946; text-shadow: 0 0 5px #e63946; } 
    100% { color: #2d2a24; text-shadow: 0 0 0 #e63946; } 
}

/* Filtre info */
.filter-info { 
    text-align: center; 
    margin-bottom: 1rem; 
}

.filter-badge { 
    display: inline-block; 
    background: #e63946; 
    color: white; 
    padding: 0.3rem 0.8rem; 
    border-radius: 30px; 
    font-size: 0.8rem; 
    margin-right: 0.5rem; 
}

.reset-filter { 
    background: #6c757d; 
    color: white; 
    border: none; 
    padding: 0.3rem 0.8rem; 
    border-radius: 30px; 
    cursor: pointer; 
    font-size: 0.8rem; 
    text-decoration: none; 
    display: inline-block; 
}

.empty-message { 
    text-align: center; 
    padding: 3rem; 
    background: white; 
    border-radius: 24px; 
    font-size: 1.1rem; 
    color: #6c757d; 
}

/* ========== PROMO ========== */
.promo-banner {
    background: linear-gradient(135deg, var(--red), var(--red-light));
    margin: 3rem auto;
    border-radius: 50px;
    padding: 2rem;
    text-align: center;
    max-width: 1300px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.promo-banner:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 30px rgba(230,57,70,0.3);
}

.btn-promo {
    background: white;
    color: var(--red-dark);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    margin-top: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-promo:hover {
    background: var(--red-dark);
    color: white;
    transform: scale(1.05);
}

/* ========== FOOTER ========== */
footer {
    background: linear-gradient(135deg, #1a2a1a, #0f1a0f);
    color: #e0d6cc;
    padding: 3rem 1rem 1rem;
    margin-top: 4rem;
    border-top: 3px solid var(--red);
}

.footer-grid {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-col h4 {
    color: var(--red-light);
    margin-bottom: 1rem;
}

.footer-col a {
    color: #e0d6cc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--red-light);
    padding-left: 5px;
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .search-wrapper {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 0.8rem;
    }
    .search-wrapper form {
        width: 100%;
        display: flex;
    }
    .search-wrapper input {
        flex: 1;
        min-width: 0;
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
    .voice-lang {
        padding: 0 0.8rem;
        font-size: 0.75rem;
    }
    .voice-btn {
        padding: 0 0.8rem;
    }
    .search-wrapper button[type="submit"] {
        padding: 0 1rem;
    }
    .menu-icon {
        display: block;
    }
    .user-actions {
        order: 2;
    }
    .slide {
        height: 300px;
    }
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .card-img {
        width: 70px;
        height: 70px;
    }
    .produits-grid { 
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); 
        gap: 0.5rem; 
    }
    .produit-card img { 
        height: 75px; 
    }
    .produit-card h3 { 
        font-size: 0.6rem; 
        white-space: normal;
    }
    .prix { 
        font-size: 0.65rem; 
    }
    .btn-add { 
        padding: 0.2rem 0.25rem;
        font-size: 0.45rem;
    }
}

@media (max-width: 480px) {
    .search-wrapper input {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
    }
    .voice-lang {
        padding: 0 0.5rem;
        font-size: 0.65rem;
    }
    .voice-btn {
        padding: 0 0.6rem;
    }
    .search-wrapper button[type="submit"] {
        padding: 0 0.8rem;
    }
    .categories-grid {
        gap: 0.8rem;
    }
    .card-img {
        width: 55px;
        height: 55px;
    }
    .produits-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 0.4rem; 
    }
    .produit-card { 
        padding: 0.3rem; 
    }
    .produit-card img { 
        height: 65px; 
    }
    .produit-card h3 { 
        font-size: 0.55rem; 
    }
    .prix { 
        font-size: 0.6rem; 
    }
    .btn-add { 
        padding: 0.2rem 0.25rem;
        font-size: 0.45rem;
    }
    .variantes-select {
        padding: 0.15rem;
        font-size: 0.45rem;
    }
    .badge-variante {
        font-size: 0.4rem;
    }
    .detail-prix {
        font-size: 0.4rem;
    }
}

/* ========== STYLES POUR IMPRESSION (facture uniquement) ========== */
@media print {
    .navbar, .hero-slider, .categories, .promo-banner, footer, .user-actions,
    .menu-icon, .search-wrapper, .section-title, .commande-card .commande-header,
    .commande-details, .btn-detail, .btn-facture, .detail-produits {
        display: none !important;
    }
    .facture-container.visible {
        display: block !important;
        position: relative;
        margin: 0;
        padding: 10px;
        width: 100%;
    }
    .facture-content {
        font-size: 12pt;
    }
    .btn-print {
        display: none !important;
    }
}