/*
 * Habillage de la boutique.
 *
 * Reference assumee : dbrand. Fond sombre, un seul accent jaune, beaucoup de
 * vide, une typographie qui porte. On ne redessine pas le theme : on retire le
 * bruit et on renforce ce qui compte — le produit et le bouton d'achat.
 *
 * Les variables permettent de changer l'accent en une ligne le jour ou la
 * marque sera arretee.
 */

:root {
    --bp-accent:        #ffd400;   /* jaune, uniquement sur les actions */
    --bp-accent-fonce:  #e5bf00;
    --bp-encre:         #111214;   /* fond sombre */
    --bp-encre-douce:   #1a1c1f;   /* cartes sur fond sombre */
    --bp-ligne:         rgba(255, 255, 255, .08);
    --bp-texte-attenue: rgba(255, 255, 255, .62);
    --bp-rayon:         10px;
}

/* ---------- typographie ---------- */

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4,
.section-title,
.products-carousel .section-title {
    letter-spacing: -.015em;
    font-weight: 700;
}

/* Les titres de section d'Electro sont petits et noyes. On les pose. */
.section-title {
    font-size: 1.35rem;
    line-height: 1.25;
}

/* ---------- l'accent, utilise avec parcimonie ---------- */

.btn-primary,
.single_add_to_cart_button,
.wc-proceed-to-checkout .checkout-button,
.button.alt {
    background: var(--bp-accent);
    border-color: var(--bp-accent);
    color: #111 !important;
    font-weight: 700;
    letter-spacing: .01em;
    border-radius: 6px;
    transition: transform .12s ease, background .12s ease;
}

.btn-primary:hover,
.single_add_to_cart_button:hover,
.wc-proceed-to-checkout .checkout-button:hover,
.button.alt:hover {
    background: var(--bp-accent-fonce);
    border-color: var(--bp-accent-fonce);
    color: #111 !important;
    transform: translateY(-1px);
}

/* ---------- fiches produit de la grille ---------- */

.products .product,
.product-outer .product-inner {
    border-radius: var(--bp-rayon);
    transition: transform .16s ease, box-shadow .16s ease;
}

.product-outer .product-inner:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}

/* Le prix est l'information decisive : il doit se voir avant le reste. */
.price,
.woocommerce-Price-amount {
    font-weight: 700;
    font-size: 1.05em;
}

/* La categorie au-dessus du titre doit rester discrete. */
.product-loop-header .category,
.posted_in {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--bp-texte-attenue);
}

/* ---------- en-tete ---------- */

/* La barre fine du haut : plus discrete, elle ne doit pas concurrencer le logo. */
.top-bar {
    font-size: .8125rem;
}

.top-bar a:hover {
    color: var(--bp-accent);
}

/* Champ de recherche : c'est l'outil n°1 sur un catalogue a centaines de
   references. On lui donne de la place et un contour net. */
.navbar-search .form-control,
.navbar-search .custom-select {
    border-radius: 6px 0 0 6px;
}

.navbar-search .btn {
    border-radius: 0 6px 6px 0;
}

/* ---------- megamenu des rayons ---------- */

/* 95 entrees sur 3 niveaux : sans gouttiere c'est illisible. */
.departments-menu-v2 .dropdown-menu,
.departments-menu .dropdown-menu {
    border: 1px solid var(--bp-ligne);
    border-radius: var(--bp-rayon);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
    padding: .35rem 0;
}

.departments-menu-v2 .dropdown-menu > li > a,
.departments-menu .dropdown-menu > li > a {
    padding-top: .5rem;
    padding-bottom: .5rem;
}

.departments-menu-v2 .dropdown-menu > li > a:hover,
.departments-menu .dropdown-menu > li > a:hover {
    color: var(--bp-accent);
}

/* ---------- le selecteur clair / sombre ---------- */

/* Il flotte au milieu du bord gauche et coupe la lecture. On le descend et on
   l'attenue : il reste accessible sans s'imposer. */
.electro-mode-switcher,
.mode-switcher,
#mode-switcher {
    opacity: .35;
    transform: scale(.85);
    transition: opacity .2s ease;
}

.electro-mode-switcher:hover,
.mode-switcher:hover,
#mode-switcher:hover {
    opacity: 1;
}

/* ---------- respiration ---------- */

.home .section-products-carousel,
.home .section-product-cards-carousel,
.home .section-onsale-product {
    margin-bottom: 2.25rem;
}

/* ---------- mobile ---------- */

@media (max-width: 767px) {
    .section-title { font-size: 1.15rem; }
    .product-outer .product-inner:hover { transform: none; box-shadow: none; }
}

/* ---------- grille des rayons ---------- */

/* Les libellés sous les vignettes sortaient en gris sombre sur fond noir :
   illisibles. Le nom du rayon est l'information, il doit porter. */
.product-category .woocommerce-loop-category__title,
.product-category h2,
.products .product-category a {
    color: rgba(255, 255, 255, .92);
    font-weight: 600;
    letter-spacing: -.01em;
}

.products .product-category a:hover .woocommerce-loop-category__title,
.products .product-category a:hover h2 {
    color: var(--bp-accent);
}

/* Les vignettes de rayon sont carrées : on les cadre proprement et on les
   fait réagir au survol comme les fiches produit. */
.product-category img {
    border-radius: var(--bp-rayon);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform .18s ease;
}

.product-category a:hover img {
    transform: scale(1.02);
}

/* =========================================================================
   Page d'accueil
   Bannière, tuiles de rayon, engagements. Tout est indépendant du catalogue :
   aucune section ne se vide quand il n'y a pas de produits.
   ========================================================================= */

.bp-accueil {
    --bp-gouttiere: clamp(1rem, 4vw, 3rem);
}

/* ---------- bannière ---------- */

.bp-hero {
    position: relative;
    min-height: min(68vh, 560px);
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center right;
    border-radius: var(--bp-rayon);
    overflow: hidden;
    margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.bp-hero-texte {
    padding: clamp(2rem, 5vw, 4rem);
    max-width: 38rem;
}

.bp-sur-titre {
    margin: 0 0 .75rem;
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--bp-accent);
    font-weight: 700;
}

.bp-hero h1 {
    margin: 0 0 1rem;
    font-size: clamp(1.9rem, 4.6vw, 3.2rem);
    line-height: 1.08;
    letter-spacing: -.02em;
    color: #fff;
}

.bp-accroche {
    margin: 0 0 1.75rem;
    font-size: clamp(1rem, 1.6vw, 1.12rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, .78);
    max-width: 30rem;
}

.bp-bouton {
    display: inline-block;
    padding: .85rem 1.6rem;
    background: var(--bp-accent);
    color: #111 !important;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none;
    transition: transform .12s ease, background .12s ease;
}

.bp-bouton:hover {
    background: var(--bp-accent-fonce);
    transform: translateY(-1px);
}

/* ---------- sections ---------- */

.bp-section {
    margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.bp-section > h2 {
    margin: 0 0 .5rem;
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    letter-spacing: -.015em;
}

.bp-section-chapo {
    margin: 0 0 1.75rem;
    max-width: 44rem;
    color: var(--bp-texte-attenue);
    line-height: 1.55;
}

/* ---------- tuiles de rayon ---------- */

.bp-tuiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
}

.bp-tuile {
    display: block;
    border: 1px solid var(--bp-ligne);
    border-radius: var(--bp-rayon);
    overflow: hidden;
    text-decoration: none !important;
    background: var(--bp-encre-douce);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.bp-tuile:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 212, 0, .45);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
}

.bp-tuile-image {
    display: block;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
}

.bp-tuile-texte {
    display: block;
    padding: 1rem 1.1rem 1.2rem;
}

.bp-tuile-texte strong {
    display: block;
    font-size: 1.02rem;
    color: #fff;
    margin-bottom: .2rem;
}

.bp-tuile-texte em {
    display: block;
    font-style: normal;
    font-size: .85rem;
    line-height: 1.4;
    color: var(--bp-texte-attenue);
}

.bp-tuile:hover .bp-tuile-texte strong {
    color: var(--bp-accent);
}

/* ---------- engagements ---------- */

.bp-engagements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid var(--bp-ligne);
    border-radius: var(--bp-rayon);
    background: var(--bp-encre-douce);
}

.bp-engagements strong {
    display: block;
    margin-bottom: .35rem;
    color: #fff;
}

.bp-engagements span {
    display: block;
    font-size: .88rem;
    line-height: 1.5;
    color: var(--bp-texte-attenue);
}

/* ---------- thème clair ---------- */

body:not(.electro-dark) .bp-tuile-texte strong,
body:not(.electro-dark) .bp-engagements strong {
    color: #15171a;
}

body:not(.electro-dark) .bp-tuile,
body:not(.electro-dark) .bp-engagements {
    background: #fafafa;
    border-color: rgba(0, 0, 0, .09);
}

body:not(.electro-dark) .bp-tuile-texte em,
body:not(.electro-dark) .bp-engagements span,
body:not(.electro-dark) .bp-section-chapo {
    color: rgba(0, 0, 0, .6);
}

@media (max-width: 600px) {
    .bp-hero { min-height: 420px; background-position: center; }
    .bp-tuile:hover { transform: none; box-shadow: none; }
}

/* ---------- corrections de gabarit sur l'accueil ---------- */

/* Le gabarit « pleine largeur » d'Electro laisse malgré tout la zone de
   contenu dans une colonne : 870 px sur 1440. On la libère, sinon la
   bannière s'arrête au deux tiers de l'écran. */
.home .content-area,
.home .site-content-inner > .content-area {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
}

/* Le thème imprime le titre de la page. Sur l'accueil, « Accueil » écrit en
   gros au-dessus de la bannière n'apporte rien. */
.home .page-header,
.home .entry-header,
.home .page-title,
.home .entry-title {
    display: none;
}

/* La bannière gagne à toucher les bords sur grand écran. */
@media (min-width: 992px) {
    .home .bp-hero { margin-left: calc(var(--bp-gouttiere) * -0.5);
                     margin-right: calc(var(--bp-gouttiere) * -0.5); }
}
