/**
 * ============================================
 * STYLES BOUTIQUE CUSTOM
 * ============================================
 * 
 * Gère l'affichage de la page boutique custom
 * avec système d'ajout panier AJAX
 * 
 * @version 1.0.0
 * @requires WooCommerce
 * 
 * TABLE DES MATIÈRES
 * ==================
 * 1. MENU SEMAINE .............. Sections par jour de livraison
 * 2. GRID PRODUITS ............. Disposition cartes produits
 * 3. CARTES PRODUITS ........... Styles individuels produits
 * 4. BOUTONS AJAX .............. Boutons ajout panier
 * 5. FEEDBACK UTILISATEUR ...... Loaders & messages
 * 6. MODAL VARIATIONS .......... Popup sélection variations
 * 7. RESPONSIVE ................ Adaptations mobile/tablet
 */


/* ==========================================
   1. MENU SEMAINE
   ========================================== 
   Affichage produits groupés par jour
   de livraison (ex: Lundi, Mardi...)
   ========================================== */

.menu-semaine {
    margin-top: 30px;
}

/* Section d'un jour */
.im-jour-section {
    margin-bottom: 50px;
}

/* Titre jour avec emoji */
.jour-titre {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1.5rem;
    color: #333;
}

.jour-titre .emoji {
    width: 1.2em;
    height: 1.2em;
    margin-right: 0.3em;
    vertical-align: -0.2em;
}


/* ==========================================
   2. GRID PRODUITS
   ========================================== 
   Layout moderne type grille responsive
   ========================================== */

.im-shop-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 0; /* Reset */
}


/* ==========================================
   3. CARTES PRODUITS
   ========================================== */

.im-product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.im-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* --- Image produit (style ancien) --- */
.im-product-image {
    line-height: 0; /* Supprime espace sous image */
}

.im-product-image img {
    width: 100%;
    height: 180px; /* Plus petit qu'avant (200px) */
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

/* --- Bloc informations --- */
.im-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

/* Titre compact */
.im-product-info h3,
.im-product-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    line-height: 1.3;
}

.im-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.im-product-title a:hover {
    color: #0073aa;
}

/* Prix (style WooCommerce) */
.im-product-price {
    margin: 0.5rem 0 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Zone actions (poussée en bas) */
.im-product-actions {
    margin-top: auto;
}


/* ==========================================
   4. BOUTONS AJAX
   ========================================== 
   Boutons d'ajout au panier avec AJAX
   ========================================== */

/* Bouton principal */
.im-add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: #a8385d; /* Bordeaux uni */
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(168, 56, 93, 0.2);
}


/* Hover */
.im-add-to-cart:hover {
    background: #8a2d4d; /* 20% plus foncé */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 56, 93, 0.4);
}

/* Active (clic) */
.im-add-to-cart:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

/* État désactivé */
.im-add-to-cart:disabled {
    background: #d3d3d3;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.im-add-to-cart:disabled:hover {
    transform: none;
}

/* Bouton produit variable (indication visuelle) */
.im-add-to-cart.variable::after {
    content: "▼";
    margin-left: 0.25rem;
    font-size: 0.8em;
    opacity: 0.7;
}


/* ==========================================
   5. FEEDBACK UTILISATEUR
   ========================================== 
   Loaders, messages d'erreur/succès
   ========================================== */

/* Message "Commandes closes" (grisé élégant) */
.im-deadline-closed {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b4c57; /* Bordeaux désaturé foncé */
    background: linear-gradient(135deg, #f0e5ea 0%, #e8dce2 100%); /* Rose très pâle */
    border: 2px solid #d4c0c9; /* Bordeaux pastel */
    border-radius: 6px;
    text-align: center;
    opacity: 0.85;
}

.im-deadline-closed .emoji {
    font-size: 1.2em;
}

/* Loader AJAX (animation) */
.im-ajax-loader {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 1.2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


/* ==========================================
   6. MODAL VARIATIONS
   ========================================== 
   Popup pour sélection variations produits
   ========================================== */

/* Container modal plein écran */
.im-modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;
}

/* Overlay fond sombre */
.im-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

/* Contenu modal centré */
.im-modal-content {
    position: relative;
    max-width: 500px;
    max-height: 90vh;
    margin: 50px auto;
    padding: 30px;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Bouton fermeture (X) */
.im-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.im-modal-close:hover {
    color: #000;
}


/* ==========================================
   7. RESPONSIVE
   ========================================== 
   Adaptations mobile/tablette
   ========================================== */

@media (max-width: 768px) {
    /* 2 colonnes sur tablette */
    .im-shop-products {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    /* Titre plus compact */
    .jour-titre {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    /* Images plus petites */
    .im-product-image img {
        height: 150px;
    }
    
    /* Modal pleine largeur */
    .im-modal-content {
        max-width: calc(100% - 40px);
        margin: 20px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    /* 1 seule colonne sur mobile */
    .im-shop-products {
        grid-template-columns: 1fr;
    }
}
