/* =============================================================
   boutique.css — Wifi Zone Boutique
   Rewrite complet : cards propres, filtres sticky, images, overlays
   ============================================================= */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --blue:        #2563eb;
    --blue-dark:   #1d4ed8;
    --blue-light:  #eff6ff;
    --gold:        #f59e0b;
    --dark:        #0f172a;
    --gray-800:    #1e293b;
    --gray-600:    #475569;
    --gray-200:    #e2e8f0;
    --gray-100:    #f1f5f9;
    --white:       #ffffff;
    --radius:      14px;
    --shadow-sm:   0 2px 8px rgba(0,0,0,.08);
    --shadow-md:   0 8px 24px rgba(0,0,0,.12);
    --shadow-lg:   0 20px 40px rgba(0,0,0,.16);
    --transition:  all .3s cubic-bezier(.4,0,.2,1);
    --navbar-h:    80px;   /* hauteur réelle de ta navbar style.css */
    --filter-h:    60px;   /* hauteur de la barre de filtres */
}

/* ── Reset ciblé ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Body boutique ──────────────────────────────────────────── */
body {
    background: var(--gray-100);
    font-family: 'Poppins', sans-serif;
    color: var(--dark);
    /* On laisse style.css gérer le padding-top via body:not(.home-page) */
}

/* ── Page header (section bleue titre) ─────────────────────── */
.page-header {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    padding: 60px 0 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-header h1 {
    font-size: clamp(28px, 5vw, 48px);
    color: var(--white);
    font-weight: 700;
    margin: 0 0 10px;
    position: relative;
}

.page-header p {
    color: rgba(255,255,255,.85);
    font-size: 16px;
    margin: 0;
    position: relative;
}

/* ── BARRE DE FILTRES STICKY ────────────────────────────────── */
.boutique-filters {
    position: sticky;
    top: var(--navbar-h);          /* colle juste sous la navbar fixe */
    z-index: 900;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 4px 16px rgba(0,0,0,.07);
    transition: var(--transition);
}

.boutique-filters .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    overflow-x: auto;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 2px solid var(--gray-200);
    border-radius: 50px;
    background: var(--white);
    color: var(--gray-600);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.filter-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-light);
}

.filter-btn.active {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.filter-btn i {
    font-size: 13px;
}

/* ── MAIN CONTENU ───────────────────────────────────────────── */
.boutique-main {
    padding: 40px 0 80px;
}

.boutique-main .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── GRILLE PRODUITS ────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin: 0;
}

/* ── ÉTATS SPÉCIAUX DE LA GRILLE ────────────────────────────── */
.loader-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 20px;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-text {
    color: var(--gray-600);
    font-size: 15px;
}

.no-products, .error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: var(--white);
    border-radius: var(--radius);
    border: 2px dashed var(--gray-200);
}

.no-products i, .error-message i {
    font-size: 3.5rem;
    color: var(--gray-200);
    margin-bottom: 16px;
    display: block;
}

.no-products p, .error-message p {
    color: var(--gray-600);
    font-size: 16px;
    margin-bottom: 20px;
}

.error-message button {
    padding: 10px 28px;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.error-message button:hover {
    background: var(--blue-dark);
    transform: translateY(-2px);
}

/* ── CARTE PRODUIT ──────────────────────────────────────────── */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

/* ── IMAGE WRAPPER ──────────────────────────────────────────── */
.img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--gray-100);
    overflow: hidden;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
    display: block;
}

.product-card:hover .img-wrapper img {
    transform: scale(1.05);
}

/* Placeholder quand pas d'image */
.img-wrapper img[src=""],
.img-wrapper img:not([src]) {
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
}

/* ── OVERLAY ACTIONS (like + partage) ──────────────────────── */
.action-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--transition);
    z-index: 10;
}

.product-card:hover .action-overlay,
.product-card.touch .action-overlay {
    opacity: 1;
    transform: translateX(0);
}

/* Bouton like */
.like-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.like-btn .fa-solid { display: none; }
.like-btn .fa-regular { display: block; color: var(--gray-600); font-size: 15px; }

.like-btn.liked .fa-solid   { display: block; color: #ef4444; font-size: 15px; }
.like-btn.liked .fa-regular { display: none; }

.like-btn:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-lg);
}

/* Dropdown partage */
.dropdown-share {
    position: relative;
}

.share-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: 15px;
    transition: var(--transition);
    /* Masque le texte "Partager", garde juste l'icône */
    font-size: 0;           /* masque le texte */
    gap: 0;
}

.share-btn i {
    font-size: 15px;        /* remet la taille de l'icône */
    color: var(--gray-600);
}

.share-btn:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-lg);
    background: var(--blue);
}
.share-btn:hover i { color: var(--white); }

.share-menu {
    position: absolute;
    top: 0;
    right: 46px;            /* s'ouvre à gauche du bouton */
    background: var(--white);
    border-radius: 50px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: var(--transition);
    white-space: nowrap;
}

.share-menu.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.share-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: var(--transition);
}
.share-option:hover { transform: scale(1.2); }

/* ── INFOS PRODUIT ──────────────────────────────────────────── */
.product-info {
    padding: 18px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.product-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--blue);
    background: var(--blue-light);
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    width: fit-content;
}

.product-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.4;
    /* 2 lignes max */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--blue);
    margin: 4px 0 8px;
}

/* Bouton commander */
.order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, #25d366, #1da851);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: auto;
    letter-spacing: .3px;
}

.order-btn i {
    font-size: 16px;
}

.order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,211,102,.4);
    background: linear-gradient(135deg, #1da851, #16a34a);
}

.order-btn:active {
    transform: translateY(0);
}

/* ── CONFETTI CŒUR ──────────────────────────────────────────── */
.confetti-heart {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    animation: heartFly var(--dur, .9s) ease-out forwards;
    transform-origin: center;
}

@keyframes heartFly {
    0%   { transform: translate(0,0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0); opacity: 0; }
}

/* ── TOAST COMMANDE ─────────────────────────────────────────── */
.order-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #25d366;
    color: var(--white);
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    transition: transform .4s cubic-bezier(.34,1.56,.64,1), opacity .4s;
    opacity: 0;
    white-space: nowrap;
}

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

.order-toast i { font-size: 20px; }

/* ── ANIMATIONS GRILLE ──────────────────────────────────────── */
.product-grid.fade-out { opacity: 0; transition: opacity .2s; }
.product-grid.fade-in  { opacity: 1; transition: opacity .3s; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 768px) {
    :root { --navbar-h: 70px; }

    .page-header { padding: 40px 0 35px; }

    .filter-btn {
        padding: 7px 14px;
        font-size: 12px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .product-title  { font-size: 13px; }
    .product-price  { font-size: 17px; }
    .order-btn      { font-size: 12px; padding: 10px 12px; }

    /* Sur mobile, overlay toujours visible */
    .action-overlay {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 420px) {
    .boutique-main .container { padding: 0 12px; }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-info { padding: 12px 10px 10px; gap: 4px; }

    .product-category { font-size: 10px; }
    .product-title    { font-size: 12px; }
    .product-price    { font-size: 15px; }

    .order-btn {
        padding: 9px 10px;
        font-size: 11px;
        gap: 5px;
    }
    .order-btn i { font-size: 14px; }

    .like-btn, .share-btn { width: 32px; height: 32px; }
}