/*
Theme Name: Kech Rent
Theme URI: https://example.com/kech-rent
Author: Kech-Rent
Description: Thème location de voiture à Marrakech – hero + filtres, liste véhicules, contact, FAQ, header sticky, menu mobile, cookies, RTL, réservation AJAX, Google Sheets, e-mail notifications, page d’options admin.
Version: 3.0
Text Domain: kech-rent
License: GPL-2.0+
*/

:root {
  --kr-primary: #B36A2E;
  --kr-primary-weak: rgba(179,106,46,.14);
  --kr-text: #111827;
  --kr-muted: #6b7280;
  --kr-bg: #ffffff;
  --kr-border: #e5e7eb;
  --kr-radius: 14px;
  --kr-shadow: 0 10px 30px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--kr-text);
  background: var(--kr-bg);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--kr-primary); text-decoration: none; }
a:hover { opacity: .9; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ===== Header sticky + nav ===== */
#kr-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  transition: background .25s ease, box-shadow .25s ease;
}
#kr-header.scrolled { background: rgba(255,255,255,.95); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.kr-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .8rem 1.2rem; max-width: 1200px; margin: 0 auto;
}
.kr-brand img { height: 40px; width: auto; display: block; }
nav.kr-nav ul {
  display: flex; align-items: center; gap: 1.5rem;
  list-style: none; margin: 0; padding: 0;
}
nav.kr-nav a { font-weight: 600; color: #333; transition: color .25s; }
nav.kr-nav a:hover { color: var(--kr-primary); }
.kr-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1rem; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; cursor: pointer; text-decoration: none;
  background: #f9fafb; color: #111;
}
.kr-btn-primary { background: var(--kr-primary); color: #fff; }
.kr-btn-ghost { background: #fff; border: 1px solid var(--kr-border); color: #374151; }

/* Mobile menu */
#kr-menu-btn { display: none; font-size: 1.8rem; background: none; border: none; cursor: pointer; }
#kr-menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px); opacity: 0; pointer-events: none;
  transition: opacity .2s ease; z-index: 9998;
}
#kr-menu-overlay.active { opacity: 1; pointer-events: auto; }
.menu-panel {
  position: absolute; right: 0; top: 0; height: 100%; width: min(320px,80%);
  background: #fff; padding: 20px; border-top-left-radius: 16px; border-bottom-left-radius: 16px;
  box-shadow: -10px 0 30px rgba(0,0,0,.1);
}
.menu-close {
  border: none; background: transparent; font-size: 2rem; line-height: 1; margin: 0 0 10px; cursor: pointer;
}
.menu-links ul { list-style: none; margin: 0; padding: 0; }
.menu-links a { display: block; padding: .8rem 0; border-bottom: 1px solid #eee; color: #333; font-weight: 600; }
.menu-links a:hover { color: var(--kr-primary); }
@media (max-width: 900px) { nav.kr-nav { display: none; } #kr-menu-btn { display: block; } }

/* ===== Hero + filtre (home) ===== */
.kr-hero-home {
  padding: 80px 0 40px; color: #fff; text-align: center;
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.25)), url('assets/img/hero.jpg') center/cover no-repeat;
}
.kr-hero-title { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 .5rem; }
.kr-hero-sub { opacity: .9; margin: 0 0 1.2rem; }
.kr-filter {
  margin: 18px auto 0; background: #fff; color: #111; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.12); padding: 14px; display: grid; gap: 10px;
  grid-template-columns: 1fr; max-width: 980px;
}
.kr-filter label { display: block; font-weight: 700; margin: 0 0 6px; }
.kr-filter .kr-input { height: 44px; }
.kr-filter .kr-actions { display: flex; gap: 10px; justify-content: flex-end; }
@media(min-width:900px){
  .kr-filter { grid-template-columns: repeat(5,1fr); align-items: center; padding: 16px; }
  .kr-filter .kr-actions { grid-column: 5/6; }
}

/* ===== Sections ===== */
.kr-section { padding: 50px 0; }
.kr-section h2 { margin: 0 0 10px; font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
.kr-muted { color: var(--kr-muted); }
.kr-columns { display: grid; gap: 18px; }
@media(min-width:900px){ .kr-columns { grid-template-columns: 1.1fr .9fr; } }

/* ===== Grilles & Cartes véhicule ===== */
.kr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin: 30px 0;
}
.kr-card {
  background: #fff; border-radius: var(--kr-radius); box-shadow: var(--kr-shadow);
  overflow: hidden; transform: translateY(8px); opacity: 0;
  transition: transform .5s, opacity .5s, box-shadow .25s;
}
.kr-card.reveal { transform: none; opacity: 1; }
.kr-card .thumb { width: 100%; display: block; transition: transform .5s; }
.kr-card:hover .thumb { transform: scale(1.04); }
.kr-card .pad { padding: 12px; }
.price { font-weight: 800; color: var(--kr-primary); }

/* ===== Formulaires (globaux) ===== */
.kr-form { display: grid; gap: 10px; grid-template-columns: 1fr; }
.kr-field>span { display: block; font-weight: 700; margin: 2px 0 6px; }
.kr-input,
.kr-field input,
.kr-field textarea,
.kr-field select {
  width: 100%; padding: .8rem .9rem; border: 1px solid var(--kr-border);
  border-radius: 12px; background: #fff; box-shadow: inset 0 1px 0 rgba(0,0,0,.02);
  transition: border-color .2s, box-shadow .2s;
}
.kr-input:focus,
.kr-field input:focus,
.kr-field textarea:focus,
.kr-field select:focus {
  outline: none; border-color: rgba(179,106,46,.55);
  box-shadow: 0 0 0 3px var(--kr-primary-weak);
}
@media(min-width:900px){
  .kr-form { grid-template-columns: 1fr 1fr; }
  .kr-form textarea { grid-column: 1 / -1; }
}

/* ===== FAQ ===== */
.faq { max-width: 900px; margin: 0 auto; }
.faq details {
  background: #fff; border: 1px solid #eee; border-radius: 14px;
  padding: 12px 14px; margin: 10px 0;
}
.faq summary { font-weight: 700; cursor: pointer; outline: none; }
.faq p { margin: .6rem 0 0; }

/* ===== Contact + Map ===== */
.contact-card { background:#fff; border:1px solid #eee; border-radius:16px; padding:16px; box-shadow: var(--kr-shadow); }
.contact-grid { display: grid; gap: 18px; }
@media(min-width:900px){ .contact-grid { grid-template-columns: 1fr 1fr; } }
.kr-map { border:0; width:100%; height:360px; border-radius:16px; }

/* ===== Cookie banner ===== */
#kr-cookie[hidden]{ display:none; }
.kr-cookie .cookie-text { margin-right:10px; }
.kr-cookie .cookie-link { color:#93c5fd; text-decoration:underline; }
.kr-cookie .kr-btn { padding:.6rem .9rem; border-radius:12px; font-weight:700; }
#kr-cookie .kr-cookie-box {
  background:#0f131a; color:#cbd5e1; border-radius:14px;
  max-width:1000px; margin:0 auto 12px; padding:14px;
  display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between;
}

/* ===== Footer ===== */
footer { border-top:1px solid #eee; margin-top:40px; padding:30px 0; color:#555; text-align:center; }

/* ===== Utils ===== */
.row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.text-center { text-align:center; }

/* ===== RTL ===== */
[dir="rtl"] body {
  font-family: Tajawal, Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
}
[dir="rtl"] .kr-header-inner { direction: rtl; }
[dir="rtl"] nav.kr-nav ul { flex-direction: row-reverse; }
[dir="rtl"] .menu-panel { right:auto; left:0; border-top-right-radius:16px; border-bottom-right-radius:16px; border-top-left-radius:0; border-bottom-left-radius:0; }
/* correction formulaire
 * 
 * /* === Fix visibilité formulaire single vehicle === */
.single-vehicle .kr-card,
.single-vehicle #krVehicleForm { 
  display:block !important;
  opacity:1 !important; 
  visibility:visible !important;
}

/* Étapes (par défaut : étape 1 visible, étape 2 masquée) */
.single-vehicle #kr-step-1 { display:block !important; }
.single-vehicle #kr-step-2 { display:none; } /* sera affiché par JS */

/* Champs */
.single-vehicle .kr-form { 
  display:grid; 
  gap:10px; 
  grid-template-columns:1fr; 
  color:#111; 
}
@media(min-width:900px){
  .single-vehicle .kr-form { grid-template-columns:1fr 1fr; }
  .single-vehicle .kr-form textarea { grid-column:1 / -1; }
}

.single-vehicle .kr-field>span { 
  display:block; 
  font-weight:700; 
  margin:2px 0 6px; 
  color:#111; 
}
.single-vehicle .kr-input,
.single-vehicle .kr-field input,
.single-vehicle .kr-field select,
.single-vehicle .kr-field textarea {
  background:#fff !important;
  color:#111 !important;
  border:1px solid #e5e7eb !important;
  border-radius:12px;
  padding:.8rem .9rem;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.02);
}
.single-vehicle .kr-field input::placeholder,
.single-vehicle .kr-field textarea::placeholder { color:#9ca3af; }

/* Carte contenant le formulaire */
.single-vehicle .kr-card {
  background:#fff;
  border:1px solid #eee;
  border-radius:14px;
  box-shadow:0 10px 30px rgba(0,0,0,.06);
  padding:16px;
}

/* Boutons */
.single-vehicle .kr-btn { 
  background:#f9fafb; 
  color:#111; 
  border:1px solid #e5e7eb; 
  border-radius:12px; 
  font-weight:700; 
}
.single-vehicle .kr-btn-primary { 
  background:#B36A2E; 
  color:#fff; 
  border-color:transparent; 
}

/* S’assure que rien ne masque le formulaire (z-index/overlay) */
.single-vehicle #kr-header { z-index:9999; }
.single-vehicle .kr-card { position:relative; z-index:1; }
/* Badges disponibilité */
.kr-badge{display:inline-flex;align-items:center;font-size:.75rem;font-weight:800;border-radius:999px;padding:.25rem .55rem;border:1px solid transparent}
.kr-badge.avail{background:#ecfdf5;color:#065f46;border-color:#a7f3d0}
.kr-badge.full{background:#fff1f2;color:#9f1239;border-color:#fecdd3}
/* === Mini-calendrier réservations === */
.kr-cal-wrap{margin-top:16px}
.kr-cal-loading{font-size:.95rem;color:#6b7280;margin:6px 0}
.kr-cal-legend{display:flex;gap:14px;align-items:center;font-size:.85rem;color:#374151;margin-top:8px}
.kr-dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;vertical-align:middle}
.kr-dot.free{background:#10b981}
.kr-dot.res{background:#ef4444}

.kr-cal-month{border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;margin-bottom:12px;background:#fff}
.kr-cal-head{background:#f9fafb;padding:8px 12px;font-weight:700;text-transform:capitalize}
.kr-cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:0}
.kr-cal-wd{padding:6px 8px;font-size:.8rem;font-weight:700;color:#6b7280;background:#f3f4f6;text-align:center;border-bottom:1px solid #e5e7eb}
.kr-cal-cell{height:38px;display:flex;align-items:center;justify-content:center;border-right:1px solid #f3f4f6;border-bottom:1px solid #f3f4f6;font-size:.9rem}
.kr-cal-cell:nth-child(7n){border-right:0}
.kr-cal-cell.out{background:#fafafa;color:#9ca3af}
.kr-cal-cell.res{background:#fee2e2;color:#991b1b;font-weight:700}
/* Sélection de plage */
.kr-cal-cell{height:38px;display:flex;align-items:center;justify-content:center;border-right:1px solid #f3f4f6;border-bottom:1px solid #f3f4f6;font-size:.9rem;background:#fff;cursor:pointer}
.kr-cal-cell span{pointer-events:none}
.kr-cal-cell.out{background:#fafafa;color:#9ca3af;cursor:default}
.kr-cal-cell.res{background:#eee;color:#9ca3af;cursor:not-allowed;pointer-events:none}

/* Etat sélectionné */
.kr-cal-cell.sel{background:#d1fae5;color:#065f46;font-weight:700}
.kr-cal-cell.sel-start,
.kr-cal-cell.sel-end{background:#10b981;color:#064e3b}
.kr-cal-cell.sel-start{border-top-left-radius:10px;border-bottom-left-radius:10px}
.kr-cal-cell.sel-end{border-top-right-radius:10px;border-bottom-right-radius:10px}

/* Petit feedback erreur */
@keyframes kr-shake{10%,90%{transform:translateX(-1px)}20%,80%{transform:translateX(2px)}30%,50%,70%{transform:translateX(-4px)}40%,60%{transform:translateX(4px)}}
.kr-cal-cell.shake{animation:kr-shake .35s ease}
/* Barre d'en-tête + nav */
.kr-cal-head-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.kr-cal-title{text-transform:capitalize;font-weight:800}
.kr-cal-nav{border:1px solid #e5e7eb;background:#fff;border-radius:8px;width:34px;height:34px;line-height:32px;text-align:center;font-size:18px;cursor:pointer}
.kr-cal-nav:hover{background:#f9fafb}

/* Past/today */
.kr-dot.past{background:#9ca3af}
.kr-cal-cell.past{background:#f3f4f6;color:#9ca3af;cursor:not-allowed;pointer-events:none}

/* Sélection (reprend tes styles) */
.kr-cal-cell{height:38px;display:flex;align-items:center;justify-content:center;border-right:1px solid #f3f4f6;border-bottom:1px solid #f3f4f6;font-size:.9rem;background:#fff;cursor:pointer}
.kr-cal-cell span{pointer-events:none}
.kr-cal-cell.out{background:#fafafa;color:#9ca3af;cursor:default}
.kr-cal-cell.res{background:#eee;color:#9ca3af;cursor:not-allowed;pointer-events:none}
.kr-cal-cell.sel{background:#d1fae5;color:#065f46;font-weight:700}
.kr-cal-cell.sel-start,.kr-cal-cell.sel-end{background:#10b981;color:#064e3b}
.kr-cal-cell.sel-start{border-top-left-radius:10px;border-bottom-left-radius:10px}
.kr-cal-cell.sel-end{border-top-right-radius:10px;border-bottom-right-radius:10px}

/* Feedback erreur */
@keyframes kr-shake{10%,90%{transform:translateX(-1px)}20%,80%{transform:translateX(2px)}30%,50%,70%{transform:translateX(-4px)}40%,60%{transform:translateX(4px)}}
.kr-cal-cell.shake{animation:kr-shake .35s ease}

/* === Réservé/Bloqué : rouge clair apaisant === */
.kr-dot.res{ background:#fecaca; } /* légende (rouge-200) */

.kr-cal-cell.res{
  background:#fee2e2;            /* rouge-100 */
  color:#b91c1c;                  /* rouge-700 (lisible mais pas agressif) */
  border-color:#fecaca;           /* petite bordure ton sur ton */
  cursor:not-allowed;
}

.kr-cal-cell.res:hover,
.kr-cal-cell.res:focus{
  background:#ffe4e6;            /* légère variation au survol/focus */
  color:#b91c1c;
  outline:none;
}

/* On garde le gris pour le passé/jour courant */
.kr-dot.past{ background:#9ca3af; }
.kr-cal-cell.past{
  background:#f3f4f6;
  color:#9ca3af;
}

/* (optionnel) coins adoucis pour toutes les cases */
.kr-cal-cell{ border-radius:6px; }
/* === Légende du calendrier (correction du style des "dots") === */

/* Base commune */
.kr-cal-legend .kr-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}

/* Disponible → petit cercle blanc à contour noir */
.kr-cal-legend .kr-dot.free {
  background: #fff;
  border: 1.5px solid #000;
}

/* Réservé/Bloqué → rouge clair doux */
.kr-cal-legend .kr-dot.res {
  background: #fee2e2;
  border: 1px solid #fecaca;
}

/* Passé → gris */
.kr-cal-legend .kr-dot.past {
  background: #9ca3af;
  border: 1px solid #9ca3af;
}
