/*
Theme Name:   Eyewearista Child
Theme URI:    https://eyewearista.com
Description:  Child theme Astra pour Eyewearista — SEO custom, GA4, brands, performance, commentaires désactivés. Léger et maintenu par NAOF EYEWEAR.
Author:       NAOF EYEWEAR SASU
Author URI:   https://eyewearista.com
Template:     astra
Version:      1.5.7
Text Domain:  eyewearista-child
*/

/* Custom CSS minimal. La majorité du style reste celui du thème parent Astra. */

/* Masquer la metabox commentaires inutile côté admin product */
body.post-type-product #commentsdiv,
body.post-type-product #postcustom { display: none !important; }

/* Brand grid — shortcode [eyewearista_brands] */
.eyewearista-brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}
.eyewearista-brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 6px;
    transition: transform .2s, box-shadow .2s;
    text-decoration: none;
    color: inherit;
}
.eyewearista-brand-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.eyewearista-brand-item img {
    max-width: 140px;
    max-height: 80px;
    object-fit: contain;
    margin-bottom: .5rem;
}
.eyewearista-brand-item .brand-name {
    font-size: .9rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.eyewearista-brand-item .brand-count {
    font-size: .75rem;
    color: #888;
    margin-top: .15rem;
}

/* Store locator box — for boutique page */
.eyewearista-store-box {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
    background: #fafafa;
}
.eyewearista-store-box h3 { margin-top: 0; }

/* Optionnel : masquer commentaires front */
.comments-area, #comments { display: none !important; }

/* =====================================================================
   Images produits : ratio 1:1 avec object-fit contain + fond blanc
   — évite les crops disgracieux sur des photos en ratio paysage (2:1)
   ===================================================================== */

/* Cartes produits sur shop / catégorie / widget */
.woocommerce ul.products li.product .wp-post-image,
.woocommerce ul.products li.product a img,
.woocommerce-loop-product__link img,
li.product .woocommerce-LoopProduct-link img {
    aspect-ratio: 1 / 1;
    object-fit: contain !important;
    background: #ffffff;
    width: 100% !important;
    height: auto !important;
}

/* Image principale fiche produit */
.woocommerce div.product div.images .woocommerce-product-gallery__image img,
.woocommerce div.product div.images img.wp-post-image {
    aspect-ratio: 1 / 1;
    object-fit: contain !important;
    background: #ffffff;
    width: 100% !important;
    height: auto !important;
}

/* Galerie miniatures (sous l'image principale) */
.woocommerce div.product div.images .flex-control-thumbs li img {
    aspect-ratio: 1 / 1;
    object-fit: contain !important;
    background: #ffffff;
}

/* Cards Related products / cross-sell / up-sell */
.related.products img,
.upsells.products img,
.cross-sells img {
    aspect-ratio: 1 / 1;
    object-fit: contain !important;
    background: #ffffff;
}

/* Pre-header supprimé le 18/04/2026 */

/* =====================================================================
   Ajustements responsive généraux
   ===================================================================== */

/* Titres trop énormes sur mobile */
@media (max-width: 768px) {
    h1, .entry-content :where(h1) {
        font-size: clamp(2rem, 7vw, 3.5rem) !important;
        line-height: 1.1 !important;
    }
    h2, .entry-content :where(h2) {
        font-size: clamp(1.75rem, 6vw, 2.75rem) !important;
        line-height: 1.15 !important;
    }
}

/* Fiche produit : image plus grande desktop */
@media (min-width: 992px) {
    .woocommerce div.product div.images {
        width: 52%;
    }
    .woocommerce div.product div.summary {
        width: 44%;
    }
}

/* Sticky add-to-cart mobile sur fiche produit */
@media (max-width: 768px) {
    .single-product .single_add_to_cart_button {
        position: sticky;
        bottom: 0;
        z-index: 50;
        width: 100%;
        padding: 1rem !important;
        border-radius: 0 !important;
        box-shadow: 0 -4px 14px rgba(0,0,0,0.08);
    }
}

/* Carte produit luxe — plus de respiration */
.woocommerce ul.products li.product {
    padding: 0.6rem;
}
.woocommerce ul.products li.product .price {
    margin-top: 0.3rem;
    font-weight: 500;
}

/* Related products — titre plus discret */
.related.products > h2,
.upsells > h2 {
    font-size: 1.25rem !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 3rem !important;
    margin-bottom: 1.5rem;
}

/* Masquer la banner Astra redondante sur les fiches produit (double H1) */
body.single-product .ast-single-entry-banner {
    display: none !important;
}

/* Breadcrumb subtil au-dessus de la fiche produit */
.eyewearista-breadcrumb {
    padding: 1rem 0 0.5rem;
    font-size: 0.85rem;
    color: #6c6864;
    letter-spacing: 0.02em;
}
.eyewearista-breadcrumb a {
    color: #6c6864;
    text-decoration: none;
    transition: color 0.2s;
}
.eyewearista-breadcrumb a:hover {
    color: #111;
    text-decoration: underline;
}
