/* ==========================================================================
   BOUTIQUE TACTICAL GRID (Version 34.0 - Mobile 1 Col)
   ========================================================================== */

/* --- 1. SKELETON & ANTI-CLS --- */
.boutique-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(var(--syn-col, 4), 1fr);
    min-height: 400px;
    animation: synFadeIn 0.4s ease-out forwards;
    opacity: 0;
}

@keyframes synFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.boutique-grid.is-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Responsive Grille : 1 colonne forcée sous 768px */
@media (max-width: 1024px) { .boutique-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .boutique-grid { grid-template-columns: 1fr; } } /* 1 colonne ici */
@media (max-width: 480px) { .boutique-grid { grid-template-columns: 1fr; } }


/* --- 2. MENU NAVIGATION LATÉRAL (Logique +/-) --- */
.syn-cat-nav { margin-bottom: 25px; padding-bottom: 15px; /*border-bottom: 1px solid #eee; */}

/* Titre Parent Top */
.syn-cat-title { font-size: 14px !important; font-weight: 700 !important; text-transform: uppercase !important; margin: 0 0 10px 0 !important; }
.syn-cat-title a { color: #333; text-decoration: none !important; }

/* Listes */
.syn-cat-list, .syn-subcat-list { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.syn-cat-list li { margin-bottom: 6px !important; font-size: 14px; padding: 0 !important; position: relative; }

/* Liens : Reset complet */
.syn-cat-item-link {
    text-decoration: none !important;
    color: #333 !important;
    display: inline-block;
    font-weight: 400;
    font-size: 0.9em !important;
    transition: color 0.2s;
}

/* État Actif (Gras) */
li.current-cat > .syn-cat-item-link { font-weight: 700 !important; }

/* Gestion du +/- via Pseudo-éléments */
.syn-cat-list > li.syn-has-children:not(.current-cat) > .syn-cat-item-link::after {
    content: "+";
    display: inline-block; margin-left: 8px;
    font-weight: 400; font-size: 1em; color: #333;
}

.syn-cat-list > li.syn-has-children.current-cat > .syn-cat-item-link::after {
    content: "-";
    display: inline-block; margin-left: 8px;
    font-weight: 400; font-size: 1em; color: #333;
}

/* Sous-menu (Niveau 2 et 3) */
.syn-subcat-list {
    margin-top: 4px !important;
    margin-left: 12px !important;
    border-left: 1px solid #ddd;
    padding-left: 10px !important;
}
.syn-subcat-list li { margin-bottom: 4px !important; font-size: 13px; }

/* Récursivité Niveau 3 */
.syn-subcat-list .syn-subcat-list {
    margin-left: 8px !important;
    padding-left: 8px !important;
}


/* --- 3. TUILE PRODUIT --- */
.wooproduct {
    height: auto !important; position: relative !important;
    border: 1px solid #f0f0f0; background-color: #ffffff;
    overflow: hidden !important; padding: 5px;
    box-sizing: border-box !important; display: flex; flex-direction: column;
    transition: box-shadow 0.3s ease;
    text-align: left !important; text-decoration: none !important;
}
.wooproduct::before, .wooproduct::after { display: none !important; content: none !important; }
.wooproduct a { text-decoration: none !important; border: none !important; outline: none !important; box-shadow: none !important; }
.wooproduct:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.08) !important; z-index: 2; transform: none !important; }

/* Upper Deck */
.syn-upper-deck {
    position: relative; flex: 1 1 auto; width: 100%; min-height: 0;
    /* L'aspect-ratio forcé est supprimé pour le vrai mode Masonry */
}
.syn-main-link {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
    background: transparent;
}
.product-img {
    /* Repassé en flux normal (relative + height:auto) pour dicter la hauteur de la carte */
    position: relative; top: 0; left: 0; width: 100%; height: auto;
    object-fit: contain; object-position: center;
    padding: 5px; box-sizing: border-box; background: transparent !important;
    transition: transform 0.4s ease; margin: 0 !important; border: none !important;
    display: block;
}
.wooproduct:hover .product-img { transform: scale(1.05); }

/* Overlays */
.syn-overlay-badges { position: absolute; top: 0; left: 0; z-index: 6; display: flex; flex-direction: column; pointer-events: none; }
.syn-right-overlays {
    position: absolute; top: 0; right: 0; width: 100%; height: auto; z-index: 5;
    pointer-events: none; display: flex; flex-direction: column; align-items: flex-end;
}
.syn-tag {
    background: #e02b20 !important; color: #fff !important; font-size: 10px; padding: 4px 8px;
    font-weight: 700; text-transform: uppercase; border-radius: 0 0 4px 0;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1); margin-bottom: 2px;
}
.syn-overlay-price {
    background: #ffffff; color: #222;
    font-weight: 700; font-size: 13px; padding: 4px 10px;
    border-radius: 4px 0 0 4px; box-shadow: -2px 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #f9f9f9; white-space: nowrap !important; pointer-events: auto;
}
.syn-overlay-price * { color: #222; }
.syn-overlay-tags { 
    display: flex; flex-direction: column; gap: 4px; align-items: flex-end; 
    pointer-events: auto; margin-top: 5px; margin-right: 5px;
}
.syn-mini-tag {
    background: rgba(255,255,255,0.9) !important; color: #666 !important; border: 1px solid #eee;
    font-size: 9px; padding: 2px 5px; text-decoration: none !important; border-radius: 2px;
    display: block; font-weight: 600; text-transform: uppercase; white-space: nowrap !important;
    transition: all 0.2s; line-height: 1 !important;
}
.syn-mini-tag:hover { background: #000 !important; color: #fff !important; border-color: #000; }

/* Panier */
.syn-overlay-cart { position: absolute; bottom: 0; right: 0; z-index: 10; margin: 0 8px 8px 0; }
.syn-btn-add-cart {
    width: 30px; height: 30px; background: transparent !important; border: none !important;
    color: #000 !important; display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0 !important; border-radius: 0 !important; box-shadow: none !important;
}
.syn-btn-add-cart::before, .syn-btn-add-cart::after { display: none !important; }
.syn-btn-add-cart:hover { color: var(--wp--style--color--link, #0073aa) !important; background: white !important; }
.syn-btn-add-cart svg { stroke: currentColor; transition: stroke 0.2s; }

/* Titre H3 */
.syn-card-footer {
    flex: 0 0 auto; padding: 5px 10px;
    border-top: 1px solid #f5f5f5; text-align: left; min-height: 50px;
    display: flex; flex-direction: column; justify-content: center; position: relative;
}
h3.syn-product-title {
    margin: 0 !important; padding: 0 !important;
    font-size: 1em !important; font-weight: 400 !important;
    line-height: 1.3 !important; color: #333; 
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    text-decoration: none !important; border: none !important; background: none !important;
    text-transform: none !important; letter-spacing: 0 !important; font-family: inherit !important;
}
h3.syn-product-title::before, h3.syn-product-title::after { display: none !important; content: none !important; }
.wooproduct:hover h3.syn-product-title { color: #000; }

/* Message Inline Panier */
.syn-msg-inline { font-size: 11px; color: #2e7d32; font-weight: 600; margin-top: 4px; display: none; }

/* --- 4. FILTRES --- */
.syn-filter-main-title { font-size: 14px !important; font-weight: 700 !important; text-transform: uppercase !important; margin: 0 0 15px 0 !important; }
.syn-filter-item { margin-bottom: 15px; padding-bottom: 15px; }
.syn-filter-static-title {
    font-size: 13px !important; font-weight: 600 !important; text-transform: uppercase !important;
    color: #333 !important; margin: 0 0 10px 0 !important; padding: 0 !important;
}
.syn-filter-content-static { display: block; }

/* Checkboxes */
.syn-checkbox-label {
    display: flex !important; align-items: center !important; flex-wrap: nowrap !important;
    margin-bottom: 6px !important; cursor: pointer;
    font-size: 13px !important; color: #555 !important; font-weight: 400 !important;
    line-height: 1.4 !important;
}
.filtre-checkbox {
    appearance: none !important; -webkit-appearance: none !important;
    width: 0 !important; height: 0 !important; opacity: 0 !important; position: absolute;
}
.syn-check-mark {
    width: 14px; height: 14px; min-width: 14px;
    border: 1px solid #ccc !important; background: #fff !important;
    margin-right: 10px !important; position: relative;
    border-radius: 0 !important; display: inline-block;
}
.filtre-checkbox:checked + .syn-check-mark { background: #000 !important; border-color: #000 !important; }
.filtre-checkbox:checked + .syn-check-mark::after {
    content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
    border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.syn-filter-accordion-toggle {
    font-size: 11px; color: #888; text-transform: uppercase; cursor: pointer; margin-top: 8px; font-weight: 600;
}
.syn-filter-accordion-toggle:hover { color: #000; text-decoration: underline; }

.syn-price-range { display: flex; gap: 10px; align-items: center; }
.syn-price-range input { width: 100% !important; padding: 8px !important; border: 1px solid #ddd !important; text-align: center !important; font-size: 12px !important; background: #fff !important; color: #000 !important; border-radius: 0 !important; height: auto !important; }


/* --- 5. PAGINATION --- */
.synexta-pagination-wrapper { margin-top: 40px; display: block; text-align: center; }
.syn-pagination {
    display: inline-flex !important; flex-wrap: wrap; justify-content: center; gap: 5px;
    list-style: none !important; padding: 0 !important; margin: 0 !important; background: none !important;
}
.syn-page-item { margin: 0 !important; padding: 0 !important; background: none !important; border: none !important; }
.syn-page-item .page-numbers {
    display: flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 5px;
    background: #fff; border: 1px solid #eee; color: #333; text-decoration: none !important;
    font-weight: 600; border-radius: 4px; font-size: 14px; line-height: 1;
}
.syn-page-item .page-numbers.current,
.syn-page-item .page-numbers:hover {
    background: #000; color: #fff; border-color: #000;
}


/* --- 6. SQUELETTE (Animations) --- */
.syn-skeleton-nav, .syn-skeleton-title, .syn-skeleton-item {
    animation: synSkeletonPulse 1.5s infinite ease-in-out;
    border-radius: 4px;
}
@keyframes synSkeletonPulse {
    0% { background-color: #f9f9f9; }
    50% { background-color: #f0f0f0; }
    100% { background-color: #f9f9f9; }
}


/* --- 7. MOBILE FILTER BTN --- */
.syn-mobile-filter-btn {
    display: none;
    width: 100%; padding: 12px; margin-bottom: 20px;
    background: #fff; border: 1px solid #333; color: #333;
    text-align: center; font-weight: 700; text-transform: uppercase; cursor: pointer;
    font-size: 13px; letter-spacing: 1px;
}
.syn-mobile-filter-btn:hover { background: #333; color: #fff; }

@media (max-width: 768px) {
    .syn-mobile-filter-btn { display: block; }
    .syn-filter-wrapper {
        display: none; /* Masqué par défaut */
        width: 100%; margin-bottom: 30px; padding: 15px; border: 1px solid #eee; background: #fafafa;
    }
    .syn-filter-wrapper.open { display: block; }
}

/* --- NOUVEAUX STYLES POUR LA DESCRIPTION COURTE --- */
.syn-product-desc {
    font-size: 13px !important;
    color: #666;
    margin-top: 8px !important;
    line-height: 1.4 !important;
}
.syn-product-desc p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
}

/* ==========================================================================
   NOUVEAU : VUE MASONRY & CARTES SANS IMAGE
   ========================================================================== */

/* 1. Conversion de la grille en colonnes natives CSS */
.boutique-grid.syn-masonry-grid {
    display: block; /* On écrase le display: grid */
    column-count: var(--syn-col, 4);
    column-gap: 20px;
}

.boutique-grid.syn-masonry-grid .wooproduct {
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    display: flex;
    width: 100%;
    margin-bottom: 20px;
    /* On conserve var(--syn-ratio) ici pour les cartes AVEC image ! */
}

/* Responsivité Masonry (Synchronisée avec tes règles existantes) */
@media (max-width: 1024px) { .boutique-grid.syn-masonry-grid { column-count: 3; } }
@media (max-width: 768px) { .boutique-grid.syn-masonry-grid { column-count: 1; } }

/* 2. Ajustement spécifique de la carte quand il n'y a PAS d'image */
.wooproduct.syn-no-image-card {
    aspect-ratio: auto !important; /* Libère la hauteur pour s'adapter au contenu texte */
    padding-top: 45px !important; /* Espace vital en haut réservé pour prix et badges */
    justify-content: flex-start;
}

/* On sort le conteneur du haut du flux pour que le texte remonte */
.wooproduct.syn-no-image-card .syn-upper-deck {
    position: absolute !important;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: auto !important;
    flex: none; 
}

/* On réajuste les marges du contenu texte car le bloc image a disparu */
.wooproduct.syn-no-image-card .syn-card-footer {
    border-top: none !important; 
    padding: 0 10px !important; 
    margin-top: 5px;
}

/* ==========================================================================
   DÉSACTIVATION DES EFFETS HOVER (Mode Catalogue / Inactif)
   ========================================================================== */
.wooproduct.syn-no-click:hover {
    box-shadow: none !important;
    transform: none !important;
}
.wooproduct.syn-no-click:hover .product-img {
    transform: none !important; /* Empêche le zoom de l'image */
}
.wooproduct.syn-no-click .syn-main-link {
    cursor: default !important; /* Curseur neutre au lieu de la petite main */
}