/* ==========================================================
   CMDOR — socle (typographie, mise en page, formulaires)
   Charte : vert #507E64, noir #212121, Inter
   ========================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --cm-vert: #507E64;
  --cm-vert-f: #3B5E4A;
  --cm-vert-clair: #EAF1ED;
  --cm-noir: #212121;
  --cm-texte: #2b2f2d;
  --cm-gris: #5b6660;
  --cm-gris-c: #767676;
  --cm-bord: #E2E2E2;
  --cm-fond: #ffffff;
  --cm-fond-2: #F6F7F6;
  --cm-rouge: #D62F3A;
  --cm-ambre: #B7791F;
  --cm-rayon: 15px;
  --cm-rayon-champ: 12px;
  --cm-largeur: 1600px;
  --cm-marge: 20px;
  --cm-police: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cm-haut: 92px; /* hauteur du menu fixe (menu-glass) */
}

/* ---------- Remise à zéro ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--cm-haut); }
body {
  margin: 0;
  font: 400 16px/1.6 var(--cm-police);
  color: var(--cm-texte);
  background: var(--cm-fond);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video, iframe { max-width: 100%; }
img, video { height: auto; }
img { vertical-align: middle; border: 0; }
figure { margin: 0 0 1.5em; }
hr { border: 0; border-top: 1px solid var(--cm-bord); margin: 2em 0; }
table { border-collapse: collapse; width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Texte ---------- */
h1, h2, h3, h4, h5, h6 { color: var(--cm-noir); font-family: var(--cm-police); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 750; }
h3 { font-size: 20px; font-weight: 700; }
h4 { font-size: 17px; font-weight: 700; }
h5, h6 { font-size: 15px; font-weight: 700; }
p, ul, ol, dl, blockquote, pre { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.3em; }
li { margin: .2em 0; }
a { color: var(--cm-vert-f); text-decoration: none; transition: color .2s; }
a:hover { color: var(--cm-vert); }
.entry-content a, .woocommerce-product-details__short-description a, .woocommerce-Tabs-panel a { text-decoration: underline; text-underline-offset: 2px; }
strong, b { font-weight: 650; }
small { font-size: 85%; }
blockquote { border-left: 3px solid var(--cm-vert); padding: .2em 0 .2em 1.1em; color: var(--cm-gris); font-style: italic; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--cm-fond-2); border-radius: 6px; }
code { padding: .1em .35em; }
pre { padding: 1em; overflow: auto; }
::selection { background: rgba(80, 126, 100, .2); }
:focus-visible { outline: 2px solid var(--cm-vert); outline-offset: 2px; }

/* ---------- Accessibilité ---------- */
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute !important; word-wrap: normal !important;
}
.skip-link:focus {
  clip: auto; clip-path: none; width: auto; height: auto; margin: 0;
  top: 8px; left: 8px; z-index: 100000; padding: 12px 18px;
  background: #fff; color: var(--cm-noir); border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.bt-d-none { display: none !important; }

/* ---------- Mise en page ---------- */
.container {
  width: 100%;
  max-width: var(--cm-largeur);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--cm-marge);
  padding-right: var(--cm-marge);
}
.content-wrapper { padding-top: 28px; padding-bottom: 64px; } /* le menu réserve déjà sa hauteur (menu-glass) */
/* une page avec son propre en-tête (catalogue) gère déjà le passage sous le menu */
.cmdcl-entete ~ .content-wrapper { padding-top: 0; }
/* mêmes mesures que Botiga (grille à gouttières de 15 px, filtres sur 300 px) */
.row.main-row { display: flex; flex-wrap: wrap; align-items: flex-start; margin-left: -15px; margin-right: -15px; }
#primary { flex: 1 1 0; min-width: 0; width: 100%; padding-left: 15px; padding-right: 15px; }
#secondary { flex: 0 0 300px; max-width: 300px; padding-left: 15px; padding-right: 15px; }
.cmdor-avec-filtres #secondary { order: -1; }
@media (max-width: 991px) {
  :root { --cm-haut: 76px; }
  #secondary { flex-basis: 100%; max-width: 100%; }
}

/* Pages et articles */
.entry-header { margin-bottom: 28px; }
.entry-title, .page-title { margin: 0; }
.entry-meta { color: var(--cm-gris); font-size: 14px; margin: 8px 0 0; }
.entry-thumb { margin-bottom: 28px; }
.entry-thumb img { border-radius: var(--cm-rayon); width: 100%; }
.entry-content { max-width: 860px; overflow-wrap: break-word; }
.page .entry-content, .woocommerce-cart .entry-content, .woocommerce-checkout .entry-content, .woocommerce-account .entry-content { max-width: none; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content img { border-radius: 12px; }
.alignwide { max-width: 1200px; }
.alignfull { max-width: none; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.wp-caption-text, figcaption { color: var(--cm-gris); font-size: 14px; text-align: center; margin-top: 8px; }
.page-header { margin-bottom: 32px; }

/* Liste d'articles */
.cmdor-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; }
.cmdor-carte-lien { display: block; color: var(--cm-noir); }
.cmdor-carte img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--cm-rayon); margin-bottom: 14px; }
.cmdor-carte-titre { font-size: 19px; margin: 0 0 8px; }
.cmdor-carte-extrait { color: var(--cm-gris); font-size: 15px; }
.cmdor-404 { text-align: center; padding: 40px 0; }
.cmdor-404 form { max-width: 520px; margin: 24px auto; }

/* Pagination (articles + boutique) */
.navigation.pagination, .woocommerce-pagination { margin: 48px 0 0; display: flex; justify-content: center; }
.nav-links, .woocommerce-pagination ul.page-numbers { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; border: 0; }
.woocommerce-pagination ul.page-numbers li { margin: 0; border: 0; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--cm-noir); }
a.page-numbers:hover { background: var(--cm-fond-2); color: var(--cm-noir); }
.page-numbers.current { background: var(--cm-vert); color: #fff; }

/* ---------- Formulaires ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"],
input[type="number"], input[type="tel"], input[type="date"], textarea, select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--cm-bord);
  border-radius: var(--cm-rayon-champ);
  background: #fff;
  font-size: 15px;
  line-height: 1.4;
  color: var(--cm-noir);
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
textarea { min-height: 120px; resize: vertical; }
select {
  padding-right: 40px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23212121' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 15px center;
}
input:focus, textarea:focus, select:focus { border-color: var(--cm-vert); outline: none; box-shadow: 0 0 0 3px rgba(80, 126, 100, .15); }
input::placeholder, textarea::placeholder { color: #9a9a9a; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--cm-vert); width: 18px; height: 18px; vertical-align: -3px; margin: 0 8px 0 0; }
label { font-size: 14px; font-weight: 600; color: var(--cm-noir); }
fieldset { border: 0; padding: 0; margin: 0 0 1.5em; }
legend { font-weight: 700; margin-bottom: .6em; }

/* Recherche */
.search-form, .woocommerce-product-search { display: flex; gap: 8px; }
.search-form label { flex: 1; }
.search-field { flex: 1; }

/* ---------- Boutons ---------- */
/* volontairement pas « button » tout court : les boutons des snippets (menu, filtres…) gardent leur style */
.button, button[type="submit"], input[type="submit"], input[type="button"], input[type="reset"], .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--cm-vert);
  color: #fff;
  font: 600 15px/1.2 var(--cm-police);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
.button:hover, button[type="submit"]:hover, input[type="submit"]:hover, .wp-block-button__link:hover { background: var(--cm-vert-f); color: #fff; }
.button:active, button[type="submit"]:active { transform: scale(.98); }
.button:disabled, button[type="submit"]:disabled, .button.disabled { opacity: .45; cursor: not-allowed; }
button { cursor: pointer; }
.button.alt { background: var(--cm-noir); }
.button.alt:hover { background: #000; }
.is-style-outline .wp-block-button__link { background: transparent; color: var(--cm-noir); box-shadow: inset 0 0 0 1.5px var(--cm-noir); }

/* ---------- Divers ---------- */
.sticky, .bypostauthor { display: block; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.wp-block-image img { border-radius: 12px; }
iframe { border: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Chaty : motif WhatsApp du formulaire retiré (68 Ko pour un fond à 3,5 % d'opacité) ---------- */
.chaty-whatsapp-form::before { background-image: none !important; }

/* ---------- Pages converties depuis Elementor (Outils > Sortir d'Elementor) ---------- */
.entry-content > .wp-block-cover, .entry-content > .cmdor-el-fond,
.entry-content .wp-block-column > .wp-block-cover, .entry-content .wp-block-column > .cmdor-el-fond { border-radius: var(--cm-rayon); overflow: hidden; }
.entry-content > .wp-block-cover, .entry-content > .cmdor-el-fond { margin: 0 0 32px; }
.entry-content .wp-block-cover { padding: 56px 32px; min-height: 280px; }
.entry-content .cmdor-el-fond { padding: 32px; }
.entry-content .wp-block-cover h1, .entry-content .wp-block-cover h2, .entry-content .wp-block-cover h3,
.entry-content .cmdor-el-fond.has-text-color h1, .entry-content .cmdor-el-fond.has-text-color h2, .entry-content .cmdor-el-fond.has-text-color h3,
.entry-content .wp-block-cover a:not(.wp-block-button__link), .entry-content .cmdor-el-fond.has-text-color a:not(.wp-block-button__link) { color: inherit; }
.entry-content .wp-block-columns { gap: 32px; margin: 0 0 32px; align-items: flex-start; }
.entry-content .wp-block-column > *:last-child { margin-bottom: 0; }
.entry-content .wp-block-heading { margin-top: 1.2em; }
.entry-content > .wp-block-heading:first-child, .entry-content .wp-block-column > .wp-block-heading:first-child,
.entry-content .wp-block-cover__inner-container > .wp-block-heading:first-child, .entry-content .cmdor-el-fond > .wp-block-heading:first-child { margin-top: 0; }
.entry-content .wp-block-image { margin: 0 0 24px; }
.entry-content .wp-block-image img { border-radius: 12px; }
.entry-content .wp-block-buttons { margin: 8px 0 24px; gap: 12px; }
.entry-content .wp-block-cover .wp-block-button__link { background: #fff; color: var(--cm-noir); }
.cmdor-carte-google { margin: 0 0 32px; }
.cmdor-carte-google iframe { display: block; border-radius: var(--cm-rayon); }
@media (max-width: 781px) {
  .entry-content .wp-block-cover { padding: 40px 20px; }
  .entry-content .cmdor-el-fond { padding: 24px 20px; }
  .entry-content .wp-block-columns { gap: 20px; }
}
.entry-content .wp-block-image.aligncenter { display: block; text-align: center; margin-left: auto; margin-right: auto; }
.entry-content .wp-block-image.aligncenter img { display: block; margin: 0 auto; height: auto; }
.entry-content .wp-block-button__link { text-decoration: none; }
.entry-content .wp-block-image > figure.aligncenter { display: block; text-align: center; margin: 0 auto; }
.entry-content .wp-block-image > figure.aligncenter img { display: block; margin: 0 auto; height: auto; }
.entry-content .wp-block-image > figure.alignright { float: none; text-align: right; margin: 0; }
.entry-content .wp-block-image > figure.alignright img { margin-left: auto; display: block; }
/* conteneurs Elementor « aligner les éléments : centre » */
.entry-content .cmdor-el-centre { text-align: center; }
.entry-content .cmdor-el-centre .wp-block-buttons { justify-content: center; }
.entry-content .cmdor-el-centre .wp-block-image img { margin-left: auto; margin-right: auto; }

/* Pages du thème (Contact, Essai vélo, Atelier) : même largeur que le menu et les pages boutique */
#primary.cmdor-pleine { padding-left: 0; padding-right: 0; }

/* hCaptcha se charge au premier geste du visiteur : on masque le faux message « failed to load » affiché en attendant */
.h-captcha:not(:has(iframe))::after { content: none !important; }
.wpforms-recaptcha-container .h-captcha:not([data-size]):not(:has(iframe)) { display: none; }
