*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #FAFAF8;
  --bg-card: #FFFFFF;
  --text: #1C1C1E;
  --text-muted: #6B6B6B;
  --text-light: #9A9A9A;
  --green: #4A7C59;
  --green-light: #EBF2ED;
  --green-dark: #2E5438;
  --sand: #E8E0D0;
  --sand-dark: #C8BAA0;
  --border: #EAEAE6;
  --border-strong: #D0CEC8;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250,250,248,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 64px; display: flex; align-items: center;
  padding: 0 max(2rem, calc((100% - 1200px)/2 + 2rem));
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px;
  background: var(--green); border-radius: 50% 50% 50% 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg { width: 16px; height: 16px; fill: white; }
.logo-name { font-family: var(--font-display); font-size: 22px; font-weight: 500; color: var(--text); letter-spacing: 0.02em; }
.logo-name span { color: var(--green); }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 14px; font-weight: 400; letter-spacing: 0.01em; transition: color 0.2s; }
.nav-links a:hover { color: var(--green); }
.nav-cta {
  background: var(--green); color: white; border: none; padding: 8px 20px;
  border-radius: var(--radius); font-family: var(--font-body); font-size: 13px;
  font-weight: 500; cursor: pointer; text-decoration: none; letter-spacing: 0.02em;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--green-dark); }

/* ── PAGE SECTIONS ── */
.page { display: none; }
.page.active { display: block; }

/* ── HERO ── */
.hero {
  min-height: 100vh; padding-top: 64px;
  display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(180deg, #F0EDE6 0%, var(--bg) 100%);
  position: relative; overflow: hidden;
}
.hero-bg-text {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-display); font-size: clamp(120px, 20vw, 220px);
  font-weight: 300; color: rgba(74,124,89,0.06); white-space: nowrap;
  pointer-events: none; letter-spacing: -0.02em;
}
.hero-content {
  max-width: 1200px; margin: 0 auto; padding: 4rem 2rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
}
.hero-eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--green); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 8px;
}
.hero-eyebrow::before { content: ''; display: block; width: 24px; height: 1px; background: var(--green); }
h1 {
  font-family: var(--font-display); font-size: clamp(42px, 5vw, 68px);
  font-weight: 400; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 1.5rem;
}
h1 em { font-style: italic; color: var(--green); }
.hero-desc { color: var(--text-muted); font-size: 16px; font-weight: 300; line-height: 1.8; margin-bottom: 2.5rem; max-width: 440px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary {
  background: var(--green); color: white; border: none; padding: 14px 28px;
  border-radius: var(--radius); font-family: var(--font-body); font-size: 14px;
  font-weight: 500; cursor: pointer; text-decoration: none; transition: background 0.2s;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary {
  background: transparent; color: var(--text); border: 1px solid var(--border-strong);
  padding: 14px 28px; border-radius: var(--radius); font-family: var(--font-body);
  font-size: 14px; font-weight: 400; cursor: pointer; text-decoration: none; transition: border-color 0.2s;
}
.btn-secondary:hover { border-color: var(--green); color: var(--green); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.5rem; text-align: center;
}
.stat-num { font-family: var(--font-display); font-size: 42px; font-weight: 400; color: var(--green); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-top: 6px; letter-spacing: 0.02em; }

/* ── CATEGORIES BAR ── */
.categories-bar {
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  padding: 0 max(2rem, calc((100% - 1200px)/2 + 2rem));
  display: flex; align-items: center; gap: 0; overflow-x: auto;
}
.cat-btn {
  padding: 16px 20px; font-size: 13px; font-weight: 400; color: var(--text-muted);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap; transition: all 0.2s; letter-spacing: 0.01em;
}
.cat-btn:hover { color: var(--green); }
.cat-btn.active { color: var(--green); border-bottom-color: var(--green); font-weight: 500; }

/* ── SECTION ── */
.section { max-width: 1200px; margin: 0 auto; padding: 5rem 2rem; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 3rem; }
.section-eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--green); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 8px;
}
.section-eyebrow::before { content: ''; display: block; width: 20px; height: 1px; background: var(--green); }
h2 { font-family: var(--font-display); font-size: clamp(32px, 3vw, 48px); font-weight: 400; letter-spacing: -0.02em; }
h2 em { font-style: italic; color: var(--green); }
.section-count { font-size: 13px; color: var(--text-muted); }

/* ── PRODUCT GRID ── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5px; background: var(--border); }
.product-card {
  background: var(--bg-card); padding: 2rem; cursor: pointer;
  transition: background 0.2s; position: relative; overflow: hidden;
}
.product-card:hover { background: #FEFEFE; }
.product-card:hover .card-arrow { opacity: 1; transform: translate(0, 0); }
.card-category {
  font-size: 10px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green); margin-bottom: 1rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.card-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); display: inline-block; }
.card-name { font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 1.25; margin-bottom: 0.5rem; }
.card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.5rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 1rem; }
.card-price { font-family: var(--font-display); font-size: 20px; font-weight: 500; color: var(--text); }
.card-price span { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.card-arrow {
  width: 32px; height: 32px; border-radius: 50%; background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translate(-4px, 4px); transition: all 0.25s;
}
.card-arrow svg { width: 14px; height: 14px; stroke: var(--green); fill: none; stroke-width: 2; }
.no-products { text-align: center; padding: 4rem 2rem; color: var(--text-muted); font-style: italic; font-family: var(--font-display); font-size: 20px; background: var(--bg-card); }

/* ── SERVICES ── */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.service-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.service-card:hover { border-color: var(--green); box-shadow: var(--shadow-md); }
.service-icon {
  width: 44px; height: 44px; background: var(--green-light); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; margin-bottom: 1.25rem;
}
.service-icon svg { width: 20px; height: 20px; stroke: var(--green); fill: none; stroke-width: 1.5; }
.service-name { font-family: var(--font-display); font-size: 20px; font-weight: 400; margin-bottom: 0.5rem; }
.service-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; }

/* ── CONTACT BAND ── */
.contact-band {
  background: var(--green-dark); color: white; padding: 4rem 2rem; text-align: center;
}
.contact-band h2 { color: white; font-family: var(--font-display); font-size: clamp(28px, 3vw, 42px); font-weight: 300; margin-bottom: 0.5rem; }
.contact-band p { color: rgba(255,255,255,0.7); margin-bottom: 2rem; font-weight: 300; }
.contact-links { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.contact-link {
  background: rgba(255,255,255,0.12); color: white; border: 1px solid rgba(255,255,255,0.2);
  padding: 12px 24px; border-radius: var(--radius); text-decoration: none;
  font-size: 14px; transition: background 0.2s;
}
.contact-link:hover { background: rgba(255,255,255,0.2); }

/* ── FOOTER ── */
footer {
  background: var(--text); color: rgba(255,255,255,0.5); padding: 2.5rem 2rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: gap-1rem;
  max-width: 100%; font-size: 13px;
}
footer .logo-name { color: white; font-size: 18px; }
.footer-admin { color: rgba(255,255,255,0.3); text-decoration: none; font-size: 12px; transition: color 0.2s; }
.footer-admin:hover { color: rgba(255,255,255,0.7); }

/* ── ADMIN LOGIN ── */
.admin-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding-top: 64px;
}
.login-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 3rem; width: 100%; max-width: 400px; box-shadow: var(--shadow-md);
}
.login-card .logo { justify-content: center; margin-bottom: 2rem; }
.login-title { font-family: var(--font-display); font-size: 28px; font-weight: 400; text-align: center; margin-bottom: 0.25rem; }
.login-sub { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 2rem; }
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); font-family: var(--font-body); font-size: 14px;
  background: var(--bg); color: var(--text); transition: border-color 0.2s; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--green); }
.login-error { color: #C0392B; font-size: 13px; text-align: center; margin-top: 1rem; display: none; }

/* ── ADMIN PANEL ── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; padding-top: 64px; }
.admin-sidebar {
  background: var(--bg-card); border-right: 1px solid var(--border);
  padding: 2rem 0; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto;
}
.sidebar-section { padding: 0 1.25rem; margin-bottom: 2rem; }
.sidebar-label { font-size: 10px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-light); padding: 0 0.75rem; margin-bottom: 0.5rem; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius); color: var(--text-muted); font-size: 14px;
  cursor: pointer; transition: all 0.15s; text-decoration: none;
}
.sidebar-link:hover, .sidebar-link.active { background: var(--green-light); color: var(--green); }
.sidebar-link svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; flex-shrink: 0; }
.sidebar-link .badge {
  margin-left: auto; background: var(--green); color: white;
  font-size: 10px; font-weight: 500; padding: 2px 7px; border-radius: 10px;
}
.admin-main { padding: 2.5rem; background: var(--bg); }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.admin-title { font-family: var(--font-display); font-size: 32px; font-weight: 400; }
.admin-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
.admin-stat {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}
.admin-stat-num { font-family: var(--font-display); font-size: 32px; font-weight: 400; color: var(--green); }
.admin-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── ADMIN TABLE ── */
.table-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.search-input-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-input-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--text-muted); fill: none; stroke-width: 1.5; }
.search-input-wrap input { padding-left: 36px; }
.filter-select { padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-card); font-size: 13px; font-family: var(--font-body); color: var(--text); cursor: pointer; }
.admin-table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background: var(--bg); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }
.td-name { font-weight: 500; }
.td-cat { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.cat-amendement { background: #E8F4EC; color: #2D7A4F; }
.cat-fertilisant { background: #FFF3E0; color: #B45309; }
.cat-materiel { background: #E3F2FD; color: #1565C0; }
.cat-service { background: #F3E5F5; color: #7B1FA2; }
.cat-semence { background: #E8F5E9; color: #2E7D32; }
.action-btn {
  background: none; border: none; cursor: pointer; padding: 6px; border-radius: var(--radius);
  color: var(--text-muted); transition: all 0.15s; display: inline-flex; align-items: center;
}
.action-btn:hover { background: var(--bg); color: var(--green); }
.action-btn.del:hover { background: #FDECEA; color: #C0392B; }
.action-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.empty-table { text-align: center; padding: 3rem; color: var(--text-muted); font-style: italic; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 2.5rem;
  width: 100%; max-width: 540px; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  transform: translateY(8px); transition: transform 0.2s;
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title { font-family: var(--font-display); font-size: 26px; font-weight: 400; margin-bottom: 0.25rem; }
.modal-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
textarea { resize: vertical; min-height: 80px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.btn-cancel { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); padding: 10px 20px; border-radius: var(--radius); font-family: var(--font-body); font-size: 14px; cursor: pointer; transition: border-color 0.2s; }
.btn-cancel:hover { border-color: var(--text-muted); }
.btn-save { background: var(--green); color: white; border: none; padding: 10px 24px; border-radius: var(--radius); font-family: var(--font-body); font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.btn-save:hover { background: var(--green-dark); }
.btn-danger { background: #C0392B; color: white; border: none; padding: 10px 20px; border-radius: var(--radius); font-family: var(--font-body); font-size: 14px; cursor: pointer; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 300;
  background: var(--text); color: white; padding: 12px 20px; border-radius: var(--radius);
  font-size: 14px; transform: translateY(80px); opacity: 0; transition: all 0.3s;
  display: flex; align-items: center; gap: 8px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green-dark); }
.toast.error { background: #C0392B; }
.toast svg { width: 16px; height: 16px; stroke: white; fill: none; stroke-width: 2; flex-shrink: 0; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero-content { grid-template-columns: 1fr; gap: 2rem; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .nav-links { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
