/*
Theme Name:         Kwanga Excellence
Theme URI:          https://kwanga-excellence.com
Author:             Développeur Kwanga
Author URI:
Description:        Thème sur-mesure premium pour Kwanga Excellence — Spécialiste du safou,
                    du manioc et des produits authentiques de la République du Congo.
                    Compatible WooCommerce (Mode Catalogue via YITH) et Polylang (FR / EN / PT).
                    Conçu pour un déploiement léger sur serveur Webuzo.
Version:            1.0.0
Requires at least:  6.3
Tested up to:       6.5
Requires PHP:       8.1
License:            Proprietary – Tous droits réservés
License URI:
Text Domain:        kwanga-excellence
Tags:               woocommerce, polylang, catalog-mode, custom-theme, premium, food
*/

/* ============================================================
   DESIGN TOKENS — PALETTE KWANGA EXCELLENCE
   Charte graphique : tons chauds, authentiques et prestigieux
   ============================================================ */

:root {

  /* --- Couleurs primaires --- */
  --kw-terracotta:        #A5583D;  /* Terracotta terre cuite – accent & CTA       */
  --kw-terracotta-light:  #C98466;  /* Terracotta clair – hover, états actifs      */
  --kw-terracotta-dark:   #87442D;  /* Terracotta foncé – focus, pressed           */
  --kw-terracotta-10:     rgba(165, 88, 61, 0.10);
  --kw-terracotta-20:     rgba(165, 88, 61, 0.20);

  --kw-ocre:              #D39E45;  /* Ocre / Or mat – accent secondaire, badges   */
  --kw-ocre-light:        #E8B96A;  /* Ocre clair – hover, nuances                 */
  --kw-ocre-dark:         #B07E2E;  /* Ocre foncé – contraste sur fond clair       */
  --kw-ocre-10:           rgba(211, 158, 69, 0.10);
  --kw-ocre-20:           rgba(211, 158, 69, 0.20);

  --kw-sable:             #F9F6F0;  /* Fond principal – fond de page, crème cassé  */
  --kw-sable-dark:        #EDE8DF;  /* Fond alternatif – sections alternées        */
  --kw-sable-darker:      #DDD6CA;  /* Bordures, séparateurs                       */

  --kw-anthracite:        #2C2523;  /* Texte principal – très foncé, chaud         */
  --kw-anthracite-light:  #4A3F3C;
  --kw-brun:              #4A2C14;  /* Brun du logo, un peu approfondi – titres  */  /* Texte secondaire – sous-titres, labels      */
  --kw-anthracite-60:     rgba(44, 37, 35, 0.60);
  --kw-anthracite-30:     rgba(44, 37, 35, 0.30);

  --kw-white:             #FFFFFF;

  /* --- Typographie --- */
  --kw-font-display:  'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
  --kw-font-body:     'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                       'Helvetica Neue', Arial, sans-serif;
  --kw-font-mono:     'Courier New', Courier, monospace; /* usage rare */

  /* Échelle typographique (modular scale ×1.25) */
  --kw-text-2xs:  0.625rem;  /*  10px — micro labels                */
  --kw-text-xs:   0.75rem;   /*  12px — légendes, meta              */
  --kw-text-sm:   0.875rem;  /*  14px — captions, breadcrumbs       */
  --kw-text-base: 1rem;      /*  16px — corps de texte              */
  --kw-text-lg:   1.125rem;  /*  18px — intro, lead                 */
  --kw-text-xl:   1.375rem;  /*  22px — H4, sous-titres de section  */
  --kw-text-2xl:  1.75rem;   /*  28px — H3, titres produits         */
  --kw-text-3xl:  2.25rem;   /*  36px — H2, titres de sections      */
  --kw-text-4xl:  3rem;      /*  48px — H1 pages intérieures        */
  --kw-text-5xl:  3.75rem;   /*  60px — H1 hero (desktop)           */
  --kw-text-6xl:  5rem;      /*  80px — Hero oversize (grand écran) */

  /* Poids typographiques */
  --kw-weight-light:    300;
  --kw-weight-regular:  400;
  --kw-weight-medium:   500;
  --kw-weight-semibold: 600;

  /* Interlignage */
  --kw-leading-tight:  1.15;
  --kw-leading-snug:   1.30;
  --kw-leading-base:   1.60;
  --kw-leading-relaxed: 1.75;

  /* --- Layout & Espacement --- */
  --kw-max-width:           1320px;
  --kw-max-width-narrow:    860px;
  --kw-max-width-wide:      1600px;
  --kw-container-padding:   clamp(1.25rem, 5vw, 3rem);

  --kw-space-1:   0.25rem;   /*  4px  */
  --kw-space-2:   0.5rem;    /*  8px  */
  --kw-space-3:   0.75rem;   /* 12px  */
  --kw-space-4:   1rem;      /* 16px  */
  --kw-space-5:   1.25rem;   /* 20px  */
  --kw-space-6:   1.5rem;    /* 24px  */
  --kw-space-8:   2rem;      /* 32px  */
  --kw-space-10:  2.5rem;    /* 40px  */
  --kw-space-12:  3rem;      /* 48px  */
  --kw-space-16:  4rem;      /* 64px  */
  --kw-space-20:  5rem;      /* 80px  */
  --kw-space-24:  6rem;      /* 96px  */
  --kw-space-32:  8rem;      /* 128px */

  /* Sections — valeurs fluides via clamp() */
  --kw-section-py: clamp(3.5rem, 8vw, 6rem);

  /* --- Formes & UI --- */
  --kw-radius-xs:   2px;
  --kw-radius-sm:   4px;
  --kw-radius-md:   8px;
  --kw-radius-lg:   16px;
  --kw-radius-xl:   24px;
  --kw-radius-pill: 999px;

  /* --- Ombres --- */
  --kw-shadow-xs:  0 1px 3px  rgba(44, 37, 35, 0.06);
  --kw-shadow-sm:  0 2px 8px  rgba(44, 37, 35, 0.08);
  --kw-shadow-md:  0 4px 20px rgba(44, 37, 35, 0.10);
  --kw-shadow-lg:  0 12px 40px rgba(44, 37, 35, 0.13);
  --kw-shadow-xl:  0 24px 64px rgba(44, 37, 35, 0.16);

  /* Ombre colorée terracotta (cartes au survol) */
  --kw-shadow-terra: 0 8px 32px rgba(165, 88, 61, 0.18);

  /* --- Transitions --- */
  --kw-ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --kw-ease-in:    cubic-bezier(0.64, 0, 0.78, 0);
  --kw-ease-inout: cubic-bezier(0.65, 0, 0.35, 1);

  --kw-duration-fast:   150ms;
  --kw-duration-base:   280ms;
  --kw-duration-slow:   500ms;

  --kw-transition-fast:   var(--kw-duration-fast) var(--kw-ease-out);
  --kw-transition-base:   var(--kw-duration-base) var(--kw-ease-out);
  --kw-transition-slow:   var(--kw-duration-slow) var(--kw-ease-out);

  /* --- Header --- */
  --kw-header-height:          80px;
  --kw-header-height-scrolled: 64px;

  /* --- z-index Scale --- */
  --kw-z-base:    1;
  --kw-z-above:   10;
  --kw-z-nav:     100;
  --kw-z-header:  200;
  --kw-z-overlay: 300;
  --kw-z-modal:   400;

  /* --- Grilles produits --- */
  --kw-grid-cols-catalog:   repeat(3, 1fr);  /* Desktop : 3 colonnes */
  --kw-grid-gap-catalog:    var(--kw-space-8);
}

/* Variantes dark/mode alternatif (si besoin futur) */
@media (prefers-color-scheme: dark) {
  /* Réservé — le thème restera intentionnellement clair */
}

/* ============================================================
   UTILITAIRES DE BASE (chargés ici pour disponibilité globale)
   ============================================================ */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--kw-sable);
  clip: auto !important;
  clip-path: none;
  color: var(--kw-anthracite);
  display: block;
  font-size: var(--kw-text-sm);
  font-weight: var(--kw-weight-medium);
  height: auto;
  left: var(--kw-space-4);
  padding: var(--kw-space-3) var(--kw-space-6);
  text-decoration: none;
  top: var(--kw-space-4);
  width: auto;
  z-index: var(--kw-z-modal);
  border-radius: var(--kw-radius-sm);
  box-shadow: var(--kw-shadow-md);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   KWANGA HERO SECTION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.kw-hero {
    padding: var(--kw-space-16, 64px) 0;
    background-color: var(--kw-sable-light, #F9F6F0);
    overflow: hidden;
}

.kw-hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--kw-space-12, 48px);
    align-items: center;
}

/* Contenu textuel */
.kw-hero__subtitle {
    display: block;
    font-family: var(--kw-font-sans, sans-serif);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--kw-terracotta, #c85a32);
    margin-bottom: var(--kw-space-3, 12px);
}

.kw-hero__title {
    font-family: var(--kw-font-display, serif);
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.15;
    color: var(--kw-anthracite, #222222);
    margin-bottom: var(--kw-space-6, 24px);
}

.kw-hero__text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--kw-anthracite-light, #555555);
    margin-bottom: var(--kw-space-8, 32px);
}

.kw-hero__actions {
    display: flex;
    gap: var(--kw-space-4, 16px);
}

/* Boutons de navigation */
.kw-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.85rem 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: var(--kw-radius-md, 4px);
    transition: all 0.25s ease;
}

.kw-btn--primary {
    background-color: var(--kw-terracotta, #c85a32);
    color: #ffffff;
}

.kw-btn--primary:hover {
    background-color: var(--kw-anthracite, #222222);
}

.kw-btn--secondary {
    border: 1px solid var(--kw-anthracite, #222222);
    color: var(--kw-anthracite, #222222);
}

.kw-btn--secondary:hover {
    background-color: var(--kw-anthracite, #222222);
    color: #ffffff;
}

/* Bloc Visuel (Côté droit) */
.kw-hero__visual {
    position: relative;
    width: 100%;
}

.kw-hero__image-wrapper {
    position: relative;
    padding-bottom: 125%; /* Ratio vertical premium élégant */
    overflow: hidden;
    border-radius: var(--kw-radius-lg, 12px);
    box-shadow: var(--kw-shadow-lg);
}

.kw-hero__img,
.kw-hero__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Version Mobile */
@media (max-width: 768px) {
    .kw-hero__inner {
        grid-template-columns: 1fr;
        gap: var(--kw-space-8, 32px);
        text-align: center;
    }

    .kw-hero__actions {
        justify-content: center;
        flex-direction: column;
    }
    
    .kw-hero__image-wrapper {
        padding-bottom: 100%; /* Carré sur mobile */
    }
}

/* Header & Logo - Fix espace et hauteur */
.kw-header {
    overflow: visible !important;
    padding: 10px 0 !important; /* Souffle en haut et en bas (réduit : le logo est plus grand) */
}

.kw-header__logo, 
.custom-logo-link {
    display: flex !important;
    align-items: center !important;
    overflow: visible !important;
}

.kw-header__logo img,
.custom-logo {
    height: auto !important;
    max-height: 88px !important; /* Logo HD 704×387 — net jusqu’à 2x */
    width: auto !important;
    object-fit: contain !important;
    padding: 4px 0 !important; /* Évite que les bords frôlent le conteneur */
}

/* Fix ultime logo rogné */
.kw-header__logo a,
.custom-logo-link {
    display: inline-block !important;
    padding-top: 8px !important; /* Laisse de l'espace au-dessus du texte du logo */
    overflow: visible !important;
}

.custom-logo,
.kw-header__logo img {
    overflow: visible !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   KWANGA BOUTIQUE / WOOCOMMERCE GRID
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.kw-shop-page .products,
ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: var(--kw-space-8, 32px) !important;
    padding: 0 !important;
    margin: var(--kw-space-8) 0 !important;
    list-style: none !important;
}

.kw-shop-page .product,
ul.products li.product {
    background: #ffffff;
    border-radius: var(--kw-radius-lg, 12px);
    padding: var(--kw-space-4, 16px);
    box-shadow: var(--kw-shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kw-shop-page .product:hover {
    transform: translateY(-4px);
    box-shadow: var(--kw-shadow-md);
}

.kw-shop-page .product img {
    border-radius: var(--kw-radius-md, 8px);
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    margin-bottom: var(--kw-space-3);
}

.kw-shop-page .woocommerce-loop-product__title {
    font-family: var(--kw-font-display, serif);
    font-size: 1.1rem;
    color: var(--kw-anthracite, #222222);
    margin-bottom: var(--kw-space-2);
}

.kw-shop-page .price {
    color: var(--kw-terracotta, #c85a32);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: var(--kw-space-4);
}

.kw-shop-page .add_to_cart_button {
    background-color: var(--kw-terracotta, #c85a32) !important;
    color: #ffffff !important;
    border-radius: var(--kw-radius-md, 6px) !important;
    padding: 10px 16px !important;
    text-align: center;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: block !important;
    transition: background 0.2s !important;
}

.kw-shop-page .add_to_cart_button:hover {
    background-color: var(--kw-anthracite, #222222) !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   KWANGA SINGLE PRODUCT PAGE PREMIUM
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.kw-single-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--kw-space-12, 48px);
    background: #ffffff;
    padding: var(--kw-space-10, 40px);
    border-radius: var(--kw-radius-lg, 16px);
    box-shadow: var(--kw-shadow-sm);
    align-items: start;
}

.kw-single-media-wrapper {
    width: 100%;
}

.kw-single-media {
    width: 100%;
    overflow: hidden;
    border-radius: var(--kw-radius-md, 8px);
    background-color: var(--kw-sable-dark, #EDE8DF);
}

.kw-single-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.kw-single-cat {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--kw-terracotta, #c85a32);
    margin-bottom: 8px;
}

.kw-single-cat a {
    color: inherit;
    text-decoration: none;
}

.kw-single-title {
    font-family: var(--kw-font-display, serif);
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    color: var(--kw-anthracite, #222222);
    margin-bottom: 12px;
    line-height: 1.2;
}

.kw-single-price, 
.kw-single-price .amount {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: var(--kw-terracotta, #c85a32) !important;
}

.kw-single-desc {
    color: var(--kw-anthracite-light, #555555);
    line-height: 1.7;
    font-size: 0.95rem;
}

.kw-single-actions .cart {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.kw-single-actions .qty {
    width: 70px;
    padding: 10px;
    border: 1px solid var(--kw-sable-darker, #DDD6CA);
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
}

.kw-single-actions .single_add_to_cart_button {
    background-color: var(--kw-terracotta, #c85a32) !important;
    color: #ffffff !important;
    padding: 12px 32px !important;
    border-radius: var(--kw-radius-md, 6px) !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer;
    transition: background 0.2s !important;
}

.kw-single-actions .single_add_to_cart_button:hover {
    background-color: var(--kw-anthracite, #222222) !important;
}

@media (max-width: 768px) {
    .kw-single-card {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 24px;
    }
}