/* ═══════════════════════════════════════════════════════════
   SHOP.CSS — Pages catégories / boutique — LeMarchand.CI
   Ce fichier stylise les cartes produit générées par
   woocommerce/loop/content-product.php (classes .lm-product-card__*).
   Ces classes n'étaient stylées par AUCUN fichier CSS chargé sur le
   site — d'où l'apparence "cassée" des pages catégories. Corrigé ici.
═══════════════════════════════════════════════════════════ */

:root{
    --shop-blue:#1858D8;
    --shop-blue-dark:#123F9E;
    --shop-dark:#0f172a;
    --shop-gray:#64748b;
    --shop-border:#E5E7EB;
    --shop-bg:#F7F8FA;
    --shop-radius:14px;
}

/* ── Conteneur / grille ── */
.woocommerce.columns-4{ max-width:1280px; margin:0 auto; padding:0 24px; }

/* ── FIX : produits poussés à droite ──
   Storefront (thème parent) réserve une colonne sidebar (.widget-area,
   ~34% de large) à côté du contenu (#primary.content-area, ~66%),
   même quand la sidebar est vide. Le filtre 'storefront_layout' dans
   functions.php ne suffit pas toujours à la neutraliser selon la
   version du thème. On force donc ici, en ciblant directement les
   classes réelles de Storefront, le plein-largeur sur les pages
   boutique/catégorie et on masque toute sidebar résiduelle. */
body.woocommerce-page #primary,
body.woocommerce-page .content-area,
body.archive.woocommerce #primary,
body.tax-product_cat #primary {
    width:100% !important;
    float:none !important;
    margin-left:0 !important;
    margin-right:0 !important;
    max-width:100% !important;
}
body.woocommerce-page #secondary,
body.woocommerce-page .widget-area,
body.tax-product_cat .widget-area {
    display:none !important;
}

/* Centrage explicite de la grille elle-même (ceinture + bretelles,
   au cas où le conteneur parent aurait encore une largeur inégale) */
.woocommerce ul.products,
.woocommerce-page ul.products{
    max-width:1280px !important;
    margin-left:auto !important;
    margin-right:auto !important;
}

/* ── Carte produit ── */
.lm-product-card{
    background:#fff; display:flex !important; flex-direction:column !important;
    height:100%;
}

.lm-product-card__image-wrapper{ position:relative; background:var(--shop-bg); }
.lm-product-card__image-link{ display:block; }
.lm-product-card__image{
    width:100%; height:190px; object-fit:contain; padding:14px;
    background:#fff; display:block; transition:transform .3s ease;
}
.lm-product-card:hover .lm-product-card__image{ transform:scale(1.03); }

.lm-product-card__badges{
    position:absolute; top:10px; left:10px; z-index:5;
    display:flex; flex-direction:column; gap:6px;
}
.lm-badge{
    font-size:11px; font-weight:800; padding:4px 9px; border-radius:5px;
    color:#fff; letter-spacing:.2px; box-shadow:0 2px 6px rgba(0,0,0,.12);
}
.lm-badge--sale{ background:#ef4444; }
.lm-badge--new{ background:var(--shop-blue); }
.lm-badge--out{ background:#64748b; }

.lm-product-card__wishlist{
    position:absolute; top:10px; right:10px; z-index:5;
    width:34px; height:34px; border-radius:50%; border:none;
    background:#fff; color:var(--shop-gray); display:flex; align-items:center; justify-content:center;
    box-shadow:0 2px 8px rgba(0,0,0,.12); cursor:pointer; transition:all .18s;
}
.lm-product-card__wishlist:hover{ color:#ef4444; }
.lm-product-card__wishlist.active{ color:#ef4444; background:#fef2f2; }

/* ── Contenu ── */
.lm-product-card__content{
    padding:14px 14px 16px; display:flex; flex-direction:column; flex:1; gap:5px;
}

.lm-product-card__brand{
    font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.5px;
    color:var(--shop-blue);
}

.lm-product-card__title{
    font-size:14px; font-weight:700; color:var(--shop-dark); line-height:1.35;
    text-decoration:none; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
    overflow:hidden; min-height:2.7em;
}
.lm-product-card__title:hover{ color:var(--shop-blue); }

.lm-product-card__ratings{ display:flex; align-items:center; gap:5px; min-height:16px; }
.lm-stars{ display:flex; gap:1px; }
.lm-star{ font-size:12px; line-height:1; }
.lm-star--filled{ color:#f59e0b; }
.lm-star--empty{ color:#e2e8f0; }
.lm-product-card__reviews-count{ font-size:11px; color:var(--shop-gray); }

.lm-product-card__pricing{ display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.lm-price--old{ font-size:12.5px; color:#94a3b8; text-decoration:line-through; }
.lm-price--current{ font-size:17px; font-weight:800; color:var(--shop-dark); }

.lm-product-card__metrics{ display:flex; flex-wrap:wrap; gap:6px; }
.lm-metric{
    display:inline-flex; align-items:center; gap:3px; font-size:10.5px; font-weight:600;
    color:var(--shop-gray); background:var(--shop-bg); padding:3px 7px; border-radius:5px;
}
.lm-metric__icon{ font-size:10px; }

.lm-product-card__description{
    font-size:12px; color:var(--shop-gray); line-height:1.5; margin:0;
    display:none; /* visible seulement à partir de la tablette, cf. media query */
}

.lm-product-card__tags{ display:none; gap:5px; flex-wrap:wrap; }
.lm-tag{
    font-size:10px; font-weight:700; padding:3px 8px; border-radius:20px;
    background:var(--shop-bg); color:var(--shop-gray);
}
.lm-tag--promo{ background:#fff7ed; color:#c2410c; }

.lm-product-card__actions{ margin-top:auto; padding-top:6px; }
.lm-button{
    display:flex; align-items:center; justify-content:center; gap:6px;
    width:100%; padding:10px 12px; border-radius:9px; font-size:13px; font-weight:700;
    text-decoration:none; transition:all .18s; cursor:pointer;
}
.lm-button--primary{ background:var(--shop-dark); color:#fff; }
.lm-button--primary:hover{ background:var(--shop-blue); color:#fff; }
.lm-button--primary.added{ background:#16a34a; }
.lm-button--secondary{ background:var(--shop-bg); color:var(--shop-dark); border:1.5px solid var(--shop-border); }
.lm-button--secondary:hover{ border-color:var(--shop-blue); color:var(--shop-blue); }
.lm-button__icon{ font-size:14px; line-height:1; }

/* ── Responsive ── */
@media(max-width:1024px){
    .lm-product-card__image{ height:170px; }
}

@media(max-width:768px){
    .woocommerce.columns-4{ padding:0 14px; }
    .lm-product-card__image{ height:140px; padding:10px; }
    .lm-product-card__content{ padding:10px 10px 12px; gap:4px; }
    .lm-product-card__title{ font-size:12.5px; min-height:2.5em; }
    .lm-price--current{ font-size:14.5px; }
    .lm-price--old{ font-size:11px; }
    .lm-product-card__metrics{ display:none; } /* trop serré sur mobile, cf. tags dans lm-pc-hover déjà géré ailleurs */
    .lm-button{ padding:9px 8px; font-size:12px; }
    .lm-product-card__wishlist{ width:28px; height:28px; }
}

@media(max-width:480px){
    .lm-product-card__image{ height:115px; }
    .lm-product-card__content{ padding:8px 8px 10px; }
    .lm-product-card__title{ font-size:11.5px; min-height:2.3em; }
    .lm-product-card__brand{ font-size:9.5px; }
    .lm-price--current{ font-size:13px; }
    .lm-button__text{ font-size:11px; }
}

/* Description + tags visibles seulement à partir du desktop large,
   pour ne pas surcharger les cartes en dessous */
@media(min-width:1025px){
    .lm-product-card__description{ display:block; }
    .lm-product-card__tags{ display:flex; }
}
