/*
Theme Name: NosVers
Theme URI: https://nosvers.com
Author: Angel & Africa
Author URI: https://nosvers.com
Description: Thème FSE propriétaire pour NosVers — La ferme lombricole de la Dordogne. Design organique brut, identité de catégories colorée, 100% éditable depuis l'éditeur WordPress.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.7
Requires PHP: 8.0
License: Propriétaire — NosVers
Tags: full-site-editing, woocommerce, agriculture, organic, dark

*/

/* =========================================================
   NOSVERS FSE THEME — Global Stylesheet
   Variables, resets, et styles globaux non couverts par theme.json
   ========================================================= */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Lora:ital,wght@0,400;0,600;1,400&family=Work+Sans:wght@300;400;500;600&display=swap');

/* ========== CSS CUSTOM PROPERTIES (miroirs de theme.json) ========== */
:root {
  /* Couleurs marque */
  --nv-noir:        #1a1510;
  --nv-brun:        #2d2318;
  --nv-brun-moyen:  #4a3728;
  --nv-ocre:        #b8864e;
  --nv-creme:       #f5ede0;
  --nv-creme-bg:    #faf5ed;
  --nv-olive:       #4a5c2a;
  --nv-olive-mid:   #5a6e35;
  --nv-vert:        #a8b870;
  --nv-brique:      #8b3a2a;

  /* Couleurs par catégorie */
  --cat-lombrithe:  #6b3d2e;
  --cat-lombrithe-light: #f0e8e3;
  --cat-vers:       #3d2b1f;
  --cat-vers-light: #e8e0d8;
  --cat-engrais:    #4a5c2a;
  --cat-engrais-light: #eaf0df;
  --cat-guides:     #b8864e;
  --cat-guides-light: #fdf4e8;

  /* Typographies */
  --font-titre:     'Oswald', sans-serif;
  --font-corps:     'Work Sans', sans-serif;
  --font-serif:     'Lora', serif;

  /* Rayons de bordure */
  --radius-pill:    40px;
  --radius-card:    8px;
  --radius-sm:      4px;

  /* Transitions */
  --trans-fast:     0.15s ease;
  --trans-med:      0.25s ease;
  --trans-slow:     0.4s ease;

  /* Ombres */
  --shadow-card:    0 4px 20px rgba(26,21,16,0.12);
  --shadow-hover:   0 8px 40px rgba(26,21,16,0.2);
}

/* ========== RESET ========== */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ========== BODY ========== */
body {
  background-color: var(--nv-creme-bg);
  color: var(--nv-brun);
  overflow-x: hidden;
}

/* ========== LIENS ========== */
a {
  color: var(--nv-olive);
  transition: color var(--trans-fast);
}
a:hover {
  color: var(--nv-vert);
}

/* ========== IMAGES ========== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== HEADER GLOBAL ========== */
.wp-block-template-part[data-slug="header"] {
  position: sticky;
  top: 0;
  z-index: 200;
}

.site-header {
  background: var(--nv-noir);
  border-bottom: 2px solid var(--nv-ocre);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  justify-content: space-between;
}

/* ========== NAVIGATION ========== */
.wp-block-navigation {
  --nav-color: var(--nv-creme);
  --nav-hover: var(--nv-vert);
}

.wp-block-navigation a {
  font-family: var(--font-titre) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase !important;
  color: var(--nv-creme) !important;
  text-decoration: none !important;
  transition: color var(--trans-fast) !important;
}

.wp-block-navigation a:hover {
  color: var(--nv-vert) !important;
}

/* ========== MEGA MENU CATÉGORIES avec PUNTITOS ========== */
.wp-block-navigation__submenu-container {
  background: var(--nv-brun) !important;
  border: 1px solid rgba(168,184,112,0.2) !important;
  border-top: 3px solid var(--nv-ocre) !important;
  border-radius: 0 0 8px 8px !important;
  box-shadow: 0 8px 32px rgba(26,21,16,0.3) !important;
  padding: 8px 0 !important;
  min-width: 240px !important;
}

.wp-block-navigation__submenu-container a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 20px !important;
  font-size: 12px !important;
  letter-spacing: 1.5px !important;
  color: rgba(245,237,224,0.8) !important;
  transition: all var(--trans-fast) !important;
}

.wp-block-navigation__submenu-container a:hover {
  background: rgba(168,184,112,0.08) !important;
  color: var(--nv-creme) !important;
}

/* Puntitos couleurs catégories dans le menu */
.menu-cat-lombrithe > a::before,
.menu-item-cat-lombrithe > a::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat-lombrithe);
  flex-shrink: 0;
}

.menu-cat-vers > a::before,
.menu-item-cat-vers > a::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8b6347;
  flex-shrink: 0;
}

.menu-cat-engrais > a::before,
.menu-item-cat-engrais > a::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat-engrais);
  flex-shrink: 0;
}

.menu-cat-guides > a::before,
.menu-item-cat-guides > a::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat-guides);
  flex-shrink: 0;
}

/* Auto-puntitos via data-cat attribute si utilisé */
[data-cat="lombrithe"] .category-dot { background: var(--cat-lombrithe); }
[data-cat="vers"]      .category-dot { background: #8b6347; }
[data-cat="engrais"]   .category-dot { background: var(--cat-engrais); }
[data-cat="guides"]    .category-dot { background: var(--cat-guides); }

.category-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ========== BOUTONS GLOBAUX ========== */
.wp-block-button__link,
.wp-element-button,
.button,
.btn {
  border-radius: var(--radius-pill) !important;
  font-family: var(--font-titre) !important;
  font-weight: 600 !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
  transition: all var(--trans-med) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Bouton primaire (olive) */
.wp-block-button:not([class*="cat-"]) .wp-block-button__link {
  background: var(--nv-olive) !important;
  color: var(--nv-creme) !important;
  border: none !important;
}
.wp-block-button:not([class*="cat-"]) .wp-block-button__link:hover {
  background: var(--nv-olive-mid) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(74,92,42,0.3) !important;
}

/* ========== BOUTONS CATÉGORIES ========== */
/* LombriThé */
.btn-cat-lombrithe,
.wp-block-button.cat-lombrithe .wp-block-button__link {
  background: var(--cat-lombrithe) !important;
  color: var(--nv-creme) !important;
  border: none !important;
}
.btn-cat-lombrithe:hover,
.wp-block-button.cat-lombrithe .wp-block-button__link:hover {
  background: #7d4838 !important;
  box-shadow: 0 4px 16px rgba(107,61,46,0.35) !important;
}

/* Vers de Compost */
.btn-cat-vers,
.wp-block-button.cat-vers .wp-block-button__link {
  background: var(--cat-vers) !important;
  color: var(--nv-creme) !important;
  border: 1px solid rgba(168,184,112,0.3) !important;
}
.btn-cat-vers:hover,
.wp-block-button.cat-vers .wp-block-button__link:hover {
  background: #4a3728 !important;
  box-shadow: 0 4px 16px rgba(61,43,31,0.35) !important;
}

/* Engrais Vert */
.btn-cat-engrais,
.wp-block-button.cat-engrais .wp-block-button__link {
  background: var(--cat-engrais) !important;
  color: var(--nv-creme) !important;
  border: none !important;
}
.btn-cat-engrais:hover,
.wp-block-button.cat-engrais .wp-block-button__link:hover {
  background: var(--nv-olive-mid) !important;
  box-shadow: 0 4px 16px rgba(74,92,42,0.35) !important;
}

/* Guides */
.btn-cat-guides,
.wp-block-button.cat-guides .wp-block-button__link {
  background: var(--cat-guides) !important;
  color: var(--nv-creme) !important;
  border: none !important;
}
.btn-cat-guides:hover,
.wp-block-button.cat-guides .wp-block-button__link:hover {
  background: #c99660 !important;
  box-shadow: 0 4px 16px rgba(184,134,78,0.35) !important;
}

/* ========== CARDS CATÉGORIES ========== */
/* Chaque catégorie a sa propre identité visuelle sur les cards */

.card-cat-lombrithe {
  --card-accent: var(--cat-lombrithe);
  --card-accent-light: var(--cat-lombrithe-light);
  --card-tag-bg: var(--cat-lombrithe);
  --card-tag-color: var(--nv-creme);
}

.card-cat-vers {
  --card-accent: #3d2b1f;
  --card-accent-light: var(--cat-vers-light);
  --card-tag-bg: #3d2b1f;
  --card-tag-color: var(--nv-creme);
}

.card-cat-engrais {
  --card-accent: var(--cat-engrais);
  --card-accent-light: var(--cat-engrais-light);
  --card-tag-bg: var(--cat-engrais);
  --card-tag-color: var(--nv-creme);
}

.card-cat-guides {
  --card-accent: var(--cat-guides);
  --card-accent-light: var(--cat-guides-light);
  --card-tag-bg: var(--cat-guides);
  --card-tag-color: var(--nv-creme);
}

/* ========== TAGS / BADGES PRODUITS ========== */
.nv-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-titre);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  line-height: 1;
}

.nv-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.nv-tag.tag-lombrithe { background: var(--cat-lombrithe); color: var(--nv-creme); }
.nv-tag.tag-vers      { background: #3d2b1f; color: var(--nv-creme); }
.nv-tag.tag-engrais   { background: var(--cat-engrais); color: var(--nv-creme); }
.nv-tag.tag-guides    { background: var(--cat-guides-light); color: var(--cat-guides); border: 1px solid rgba(184,134,78,0.3); }

/* ========== HERO SECTION ========== */
.nv-hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.nv-hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nv-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(26,21,16,0.75) 0%,
    rgba(26,21,16,0.4) 60%,
    rgba(26,21,16,0.1) 100%
  );
}

.nv-hero-content {
  position: relative;
  z-index: 10;
  padding: 0 60px;
  max-width: 680px;
}

/* ========== GRILLE PRODUITS 4 CATÉGORIES ========== */
.nv-categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.nv-cat-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
  cursor: pointer;
}

.nv-cat-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--trans-slow);
}

.nv-cat-card:hover .nv-cat-card-bg {
  transform: scale(1.04);
}

.nv-cat-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,21,16,0.85) 0%, rgba(26,21,16,0.2) 60%, transparent 100%);
  transition: background var(--trans-med);
}

.nv-cat-card:hover .nv-cat-card-overlay {
  background: linear-gradient(to top, rgba(26,21,16,0.9) 0%, rgba(26,21,16,0.35) 70%, transparent 100%);
}

.nv-cat-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nv-cat-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-titre);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(245,237,224,0.7);
}

.nv-cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nv-cat-card-title {
  font-family: var(--font-titre);
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--nv-creme);
  line-height: 1.0;
  letter-spacing: 1px;
  margin: 0;
}

.nv-cat-card-desc {
  font-family: var(--font-corps);
  font-size: 13px;
  color: rgba(245,237,224,0.7);
  line-height: 1.5;
  margin: 0;
  max-width: 200px;
}

/* ========== WOOCOMMERCE GLOBAL ========== */
.woocommerce,
.woocommerce-page {
  font-family: var(--font-corps);
}

/* Prix */
.woocommerce .price,
.woocommerce .woocommerce-Price-amount {
  font-family: var(--font-titre) !important;
  color: var(--nv-ocre) !important;
}

/* Bouton Ajouter au panier */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce .cart .button,
.woocommerce .cart input.button {
  border-radius: var(--radius-pill) !important;
  font-family: var(--font-titre) !important;
  font-weight: 600 !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
  background: var(--nv-olive) !important;
  color: var(--nv-creme) !important;
  transition: all var(--trans-med) !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce .cart .button:hover {
  background: var(--nv-olive-mid) !important;
  color: var(--nv-creme) !important;
  box-shadow: 0 4px 16px rgba(74,92,42,0.3) !important;
}

/* Panier — bouton alt (checkout) */
.woocommerce a.button.alt,
.woocommerce button.button.alt {
  background: var(--nv-ocre) !important;
  color: var(--nv-creme) !important;
}

.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
  background: #c99660 !important;
}

/* Product cards WooCommerce */
.woocommerce ul.products li.product a.woocommerce-loop-product__link img {
  border-radius: var(--radius-card) !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--font-titre) !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* Variations / pills format */
.woocommerce .variations select,
.woocommerce .variations td {
  font-family: var(--font-corps) !important;
}

/* Étoiles avis */
.woocommerce .star-rating span::before,
.woocommerce .star-rating::before {
  color: var(--nv-ocre) !important;
}

/* ========== CARTES PRODUIT (format NosVers) ========== */
.nv-product-card {
  background: white;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--trans-med), transform var(--trans-med);
  display: flex;
  flex-direction: column;
}

.nv-product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.nv-product-card-img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.nv-product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--trans-slow);
}

.nv-product-card:hover .nv-product-card-img img {
  transform: scale(1.03);
}

.nv-product-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.nv-product-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nv-product-card-count {
  font-family: var(--font-titre);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(74,55,40,0.6);
}

.nv-product-card-title {
  font-family: var(--font-titre);
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--nv-brun);
  line-height: 1.1;
  margin: 0;
}

.nv-product-card-desc {
  font-family: var(--font-corps);
  font-size: 13px;
  color: rgba(45,35,24,0.65);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.nv-product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid rgba(45,35,24,0.08);
}

/* ========== VARIANT PILLS ========== */
.nv-variant-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nv-pill {
  font-family: var(--font-corps);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(74,55,40,0.25);
  background: transparent;
  color: var(--nv-brun-moyen);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.nv-pill:hover,
.nv-pill.active {
  background: var(--nv-olive);
  color: var(--nv-creme);
  border-color: var(--nv-olive);
}

/* ========== SECTION HEADERS ========== */
.nv-section-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-titre);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--nv-vert);
  margin-bottom: 16px;
}

.nv-section-eyebrow::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nv-vert);
}

/* ========== CITATIONS / BLOCKQUOTE ========== */
blockquote,
.wp-block-quote {
  border-left: 3px solid var(--nv-olive) !important;
  padding-left: 20px !important;
  font-family: var(--font-serif) !important;
  font-style: italic !important;
  color: rgba(45,35,24,0.75) !important;
  margin: 0 !important;
}

/* ========== SECTIONS ALTERNÉES ========== */
.nv-section-dark {
  background: var(--nv-noir);
  color: var(--nv-creme);
}

.nv-section-terre {
  background: var(--nv-brun);
  color: var(--nv-creme);
}

.nv-section-olive {
  background: var(--nv-olive);
  color: var(--nv-creme);
}

.nv-section-creme {
  background: var(--nv-creme-bg);
  color: var(--nv-brun);
}

/* ========== FOOTER ========== */
.nv-footer {
  background: var(--nv-noir);
  border-top: 2px solid var(--nv-olive);
  color: var(--nv-creme);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .nv-categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .site-header { padding: 0 20px; }
  .nv-hero-content { padding: 0 24px; }
  .nv-categories-grid { grid-template-columns: 1fr 1fr; }
  .nv-cat-card { aspect-ratio: 1; }
  .nv-cat-card-title { font-size: 20px; }
}

@media (max-width: 480px) {
  .nv-categories-grid { grid-template-columns: 1fr; }
  .nv-cat-card { aspect-ratio: 3/2; }
}

/* ========== BLOCK EDITOR (admin styles) ========== */
.editor-styles-wrapper {
  font-family: var(--font-corps) !important;
  background: var(--nv-creme-bg) !important;
}

.editor-styles-wrapper h1,
.editor-styles-wrapper h2,
.editor-styles-wrapper h3 {
  font-family: var(--font-titre) !important;
  text-transform: uppercase !important;
}
