/*
Plugin Name: Agence Woo Grid Master CSS V7.2
Description: Filtre Slider Centré Mobile + Grille
*/

/* --- 0. STYLE DU SLIDER (GLISSIÈRE) --- */
.awg-filter-container {
    background: #fff;
    padding: 20px 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.awg-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.awg-filter-title {
    font-weight: 800;
    color: #003a5d; /* Bleu Marque */
    text-transform: uppercase;
    font-size: 14px;
}

.awg-price-display {
    font-size: 16px;
    font-weight: 700;
    color: #F4A024; /* Orange Marque */
}

.awg-reset-link {
    font-size: 12px;
    color: #999;
    text-decoration: underline;
    cursor: pointer;
}
.awg-reset-link:hover { color: #e53935; }

/* PERSONNALISATION DU SLIDER JQUERY UI */
#awg-price-slider {
    height: 8px;
    background: #e9e9e9;
    border: none;
    border-radius: 4px;
    margin: 0 5px; /* Marge latérale de base */
    position: relative;
}

#awg-price-slider .ui-slider-range {
    background: #F4A024; /* ORANGE */
    border-radius: 4px;
}

#awg-price-slider .ui-slider-handle {
    background: #003a5d; /* BLEU */
    border: 3px solid #fff; /* Bordure blanche plus épaisse pour visibilité */
    width: 22px;
    height: 22px;
    border-radius: 50%;
    top: -7px;
    cursor: grab;
    outline: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    touch-action: none; 
}
#awg-price-slider .ui-slider-handle:hover { transform: scale(1.1); }
#awg-price-slider .ui-slider-handle:active { cursor: grabbing; }


/* --- 1. GRILLE RESPONSIVE --- */
.awg-unique-grid-wrapper {
    display: grid;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 981px) {
    .awg-unique-grid-wrapper { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) and (min-width: 480px) {
    .awg-unique-grid-wrapper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 479px) {
    .awg-unique-grid-wrapper { 
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important; 
        gap: 15px 8px !important; 
    }
}

/* 2. CARTE PRODUIT */
.awg-unique-card {
    background: #fff;
    border: 2px solid #F4A024;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    box-sizing: border-box;
    text-align: center;
    width: 100%;
    overflow: hidden;
}
.awg-unique-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* 3. ELEMENTS VISUELS */
.awg-unique-link {
    text-decoration: none !important;
    color: inherit !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    width: 100%;
}

.awg-unique-badge {
    position: absolute;
    top: 5px; left: 5px;
    background: #e53935;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 5;
    text-transform: uppercase;
}

.awg-unique-img-wrap {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    width: 100%;
}
.awg-unique-img-wrap img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
    margin: 0 auto !important;
}

.awg-unique-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s;
}
.awg-unique-overlay span { color: #fff; font-size: 30px; }
.awg-unique-card:hover .awg-unique-overlay { opacity: 1; }

.awg-unique-cat {
    color: #003a5d;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.awg-unique-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #222;
    margin: 0 0 5px 0 !important;
    text-align: center;
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;        
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;      
    line-height: 1.3em !important;
    height: 2.6em;                
    font-size: 16px; 
}
.awg-unique-card:hover .awg-unique-title { color: #F4A024; }

.awg-unique-price {
    font-size: 16px;
    font-weight: 800;
    color: #003a5d; 
    margin-bottom: 8px;
    display: flex; align-items: center; justify-content: center;
    gap: 6px; flex-wrap: wrap;
}
.awg-unique-price del { 
    color: #e53935 !important; 
    font-size: 12px !important; 
    font-weight: normal; 
    text-decoration: line-through;
    opacity: 0.9;
}
.awg-unique-price ins { 
    color: #003a5d !important; 
    text-decoration: none; font-weight: 900;
}

/* 4. ACTIONS */
.awg-unique-actions {
    margin-top: auto;
    display: flex; align-items: flex-start;
    gap: 5px; padding-top: 5px;
    width: 100%; box-sizing: border-box;
}

.awg-unique-qty { flex: 0 0 35px; min-width: 35px; }
.awg-unique-input {
    width: 100% !important; height: 35px !important;
    background: #003a5d !important; color: #fff !important;
    border: none !important; border-radius: 4px !important;
    text-align: center; font-weight: bold; font-size: 12px;
    padding: 0 !important; margin: 0 !important;
    -moz-appearance: textfield;
}
.awg-unique-input::-webkit-outer-spin-button, 
.awg-unique-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.awg-unique-btn-wrap { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }

a.awg-unique-btn.button {
    display: flex !important; justify-content: center; align-items: center;
    width: 100% !important; height: 35px !important;
    background-color: #003a5d !important; color: #fff !important;
    border-radius: 4px !important; border: none !important;
    font-size: 9px !important; font-weight: 800 !important;
    text-transform: uppercase !important; padding: 0 2px !important;
    margin: 0 !important; box-shadow: none !important;
    white-space: normal !important; line-height: 1 !important;
}
a.awg-unique-btn.button:hover { background-color: #F4A024 !important; }

.awg-unique-btn-wrap a.added_to_cart {
    display: block !important; text-align: center;
    font-size: 9px !important; color: #003a5d !important;
    text-decoration: underline !important; margin-top: 3px !important;
    font-weight: 600;
}

a.awg-unique-btn.loading { color: transparent !important; }
a.awg-unique-btn.loading::after {
    font-family: "WooCommerce"; content: "\e01c";
    position: absolute !important; top: 50%; left: 50%;
    transform: translate(-50%, -50%); width: 12px; height: 12px;
    animation: spin 1s linear infinite; color: #fff !important;
}

/* PAGINATION */
.awg-unique-pagination {
    margin-top: 30px; padding-top: 10px; padding-bottom: 20px;
    text-align: center; width: 100%; grid-column: 1 / -1; display: block; 
}
.awg-unique-pagination .page-numbers {
    display: inline-block; padding: 10px 15px;
    background: #fff; color: #003a5d;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 4px; font-size: 16px;
    text-decoration: none; font-weight: 600;
}
.awg-unique-pagination .current {
    background: #F4A024; color: #fff; border-color: #F4A024;
}

/* --- OPTIMISATION SPECIALE MOBILE (ECRANS < 479px) --- */
@media (max-width: 479px) {
    /* 1. CORRECTION DU FILTRE MOBILE */
    .awg-filter-container {
        padding: 15px; /* Plus d'espace interne */
        margin-left: 5px; /* Décoller des bords de l'écran */
        margin-right: 5px;
    }
    
    /* On empile le texte et on le centre */
    .awg-filter-header {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        text-align: center;
        margin-bottom: 25px; /* Plus d'espace avant la barre */
    }
    
    /* La barre du slider : On lui donne des marges pour ne pas toucher les bords */
    #awg-price-slider {
        margin-left: 15px; 
        margin-right: 15px;
    }

    /* 2. RESTE DU CONTENU */
    .awg-unique-title { 
        font-size: 14px !important; height: 2.6em !important;   
        -webkit-line-clamp: 2 !important; margin-bottom: 6px !important;
    }
    .awg-unique-price { font-size: 13px !important; margin-bottom: 6px; }
    .awg-unique-price del { display: inline-block !important; font-size: 10px !important; } 
    .awg-unique-img-wrap img { height: 110px; }
}