/*
PAGE DE RECHERCHE
*/

/*
Barre de Recherche
*/
.search-bar-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
    width: 100%;
}

#search-input {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem 1.5rem;
    font-size: 1.3rem;
    border-radius: 30px;
    border: 2px solid #e2e8f0;
    background: #ffffff !important;
    color: #1a1a1a !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    outline: none;
    transition: all 0.25s ease;
}

#search-input:focus {
    border-color: #d4a359;
    box-shadow: 0 0 12px rgba(212, 163, 89, 0.35);
}

#search-input::placeholder {
    color: #94a3b8;
}

/*
Grille & Cartes Produits
*/
.products-container {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 2rem !important;
    max-width: 1100px;
    margin: 0 auto 3rem auto;
    width: 100%;
}

.product-card {
    width: 260px !important;
    background: #ffffff !important;
    color: #1a1a1a !important;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    border: 1px solid #f1f5f9;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15) !important;
}

.product-card img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    margin-bottom: 0.8rem;
}

.product-card h3 {
    font-size: 1.5rem;
    color: #1a1a1a !important;
    margin: 0.4rem 0;
    line-height: 1.1;
}

.product-card .price {
    font-size: 1.6rem;
    color: #0284c7 !important;
    margin: 0.25rem 0 1rem 0;
}

/* Gestions du stock & badges */
.product-card.rupture-stock {
    background: #f8fafc !important;
    opacity: 0.75;
}

.unavailable-badge {
    display: inline-block;
    padding: 0.5rem 0.8rem;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 8px;
    font-size: 1.1rem;
    margin-top: auto;
}

/* Boutons d'ajout au panier */
.btn-add-cart, 
.btn-popup-add {
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 10px;
    background: #0284c7 !important; /* Bleu d'action */
    color: #ffffff !important;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-top: auto;
}

.btn-add-cart:hover, 
.btn-popup-add:hover {
    background: #0369a1 !important;
}

/*
Fenêtre Modale Produit
*/
#product-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 1rem;
}

#product-popup.hidden {
    display: none !important;
}

.popup-body {
    background: #ffffff !important;
    color: #1a1a1a !important;
    border-radius: 20px;
    max-width: 580px;
    width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    align-items: center;
}

.close-popup {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 2.2rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-popup:hover {
    color: #1a1a1a;
}

#popup-product-img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    flex-shrink: 0;
}

.popup-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

#popup-product-name {
    font-size: 1.8rem !important;
    color: #1a1a1a !important;
    margin: 0 0 0.5rem 0 !important;
    text-align: left !important;
}

#popup-product-description {
    font-size: 1.1rem;
    color: #475569 !important;
    margin-bottom: 1rem;
    line-height: 1.3;
}

#popup-product-price {
    font-size: 1.8rem;
    color: #0284c7 !important;
    margin-bottom: 1rem;
    font-weight: bold;
}

/* Compteur de quantité */
.quantite-container {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-qty {
    width: 34px;
    height: 34px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

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

.qty-display {
    font-size: 1.2rem;
    padding: 0 0.5rem;
    font-weight: bold;
}

/*
Responsive Design
*/

/* TABLETTES / IPAD (768px à 1024px) */
@media (max-width: 1024px) {
    .products-container {
        gap: 1.5rem !important;
    }

    .product-card {
        width: 220px !important;
    }
}

/* TÉLÉPHONES MOBILES (< 768px) */
@media (max-width: 768px) {
    #search-input {
        font-size: 1.1rem;
        padding: 0.6rem 1.2rem;
    }

    .products-container {
        gap: 1.2rem !important;
    }

    .product-card {
        width: 100% !important;
        max-width: 320px;
    }

    .popup-body {
        flex-direction: column;
        padding: 1.5rem;
        text-align: center;
    }

    .popup-product-info {
        text-align: center;
    }

    #popup-product-name {
        text-align: center !important;
    }

    #popup-product-img {
        width: 140px;
        height: 140px;
    }

    .quantite-container {
        justify-content: center;
    }
}