/* Sodimo — Le Meilleur du Liban et de l'Orient
   Brand: #4b5759 primary, #a2c32a→#5d9934 accent, Montserrat */

:root {
  --primary: #4b5759;
  --primary-ink: #2d3638;
  --accent-start: #a2c32a;
  --accent-end: #5d9934;
  --muted: #7b8386;
  --bg: #ffffff;
  --bg-soft: #f7f7f5;
  --border: #e5e7e5;
  --maxw: 1280px;
  --gap: clamp(16px, 2vw, 32px);
  --radius: 10px;
  --transition: .25s ease;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Prevent horizontal scroll on narrow viewports */
html, body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-end); }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font);
  color: var(--primary);
  margin: 0 0 .6em;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 3.75rem); }
h3 { font-size: clamp(1.5rem, 3vw, 3rem); }
h4 { font-size: clamp(1.25rem, 2.2vw, 2.5rem); }
h5 { font-size: clamp(1.1rem, 1.6vw, 1.8rem); }
h6 { font-size: 1.125rem; text-transform: uppercase; letter-spacing: .05em; }

p { margin: 0 0 1em; }
.muted { color: var(--muted); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); }
.narrow { max-width: 900px; margin: 0 auto; }

/* --- Header ---
   Two states:
   • default (.site-header)          → transparent, white logo/nav (lives over hero/page-hero)
   • .site-header.scrolled           → solid white, color logo/nav (after scroll, or on pages with no hero)
*/
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: transparent;
  transition: background .25s ease, box-shadow .25s ease, border-color .25s ease;
  border-bottom: 1px solid transparent;
  color: #fff;
}
.site-header.scrolled,
.site-header.force-solid {
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,.05);
  color: var(--primary);
}
.site-header.force-solid .site-logo .logo-white { display: none; }
.site-header.force-solid .site-logo .logo-color { display: block; }
.site-header.force-solid .nav a.active, .site-header.force-solid .nav a:hover { color: var(--accent-end); }
.site-header.force-solid .lang-switch { border-left-color: var(--border); }
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px clamp(16px, 3vw, 32px);
  gap: 24px;
}

/* Dual-logo swap: ship both, show one based on header state */
.site-logo { display: inline-flex; align-items: center; }
.site-logo img { height: 48px; width: auto; display: block; transition: opacity .25s ease; }
.site-logo .logo-white { display: block; }
.site-logo .logo-color { display: none; }
.site-header.scrolled .site-logo .logo-white { display: none; }
.site-header.scrolled .site-logo .logo-color { display: block; }
@media (max-width: 640px) { .site-logo img { height: 38px; } }

.nav { display: flex; gap: 6px; align-items: center; }
.nav a {
  font-weight: 600;
  font-size: .875rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-radius: 6px;
  position: relative;
  color: inherit;
  transition: color var(--transition);
}
.nav a.active, .nav a:hover { color: var(--accent-start); }
.site-header.scrolled .nav a.active, .site-header.scrolled .nav a:hover { color: var(--accent-end); }
.nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px;
  height: 2px; background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
  transform: scaleX(0); transform-origin: left; transition: transform var(--transition);
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }

.lang-switch {
  display: flex; gap: 2px; align-items: center;
  margin-left: 8px; padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,.25);
}
.site-header.scrolled .lang-switch { border-left-color: var(--border); }
.lang-switch a {
  font-size: .75rem; padding: 6px 10px; letter-spacing: .12em;
  border-radius: 4px; font-weight: 700;
  opacity: .7;
}
.lang-switch a.active { opacity: 1; }
.lang-switch a:hover { opacity: 1; }

.menu-toggle {
  display: none; background: none; border: 0; padding: 10px; cursor: pointer;
  width: 44px; height: 44px;
  color: inherit;
}
.menu-toggle span { display: block; width: 22px; height: 2px; background: currentColor; margin: 5px auto; transition: var(--transition); }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Spacer so page content isn't hidden under the fixed header on non-hero pages */
.header-spacer { height: 76px; }
@media (max-width: 640px) { .header-spacer { height: 66px; } }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; color: var(--primary);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 8px 16px 16px;
    display: none;
    z-index: 40;
  }
  .nav.open { display: flex; }
  /* Tap targets: min 44px height for all nav links */
  .nav a {
    padding: 14px 12px;
    min-height: 44px;
    display: flex; align-items: center;
    border-bottom: 1px solid var(--border);
    color: var(--primary);
  }
  .nav a:last-child { border-bottom: 0; }
  .nav a.active, .nav a:hover { color: var(--accent-end); }
  .lang-switch {
    margin: 8px 0 0; padding: 8px 0 0;
    border-left: 0; border-top: 1px solid var(--border);
  }
  .lang-switch a {
    min-height: 44px; display: inline-flex; align-items: center;
    padding: 8px 12px; color: var(--primary);
  }
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: clamp(420px, 70vh, 720px);
  display: grid; align-items: center;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg { position: absolute; inset: 0; z-index: -2; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(135deg, rgba(0,0,0,.55), rgba(75,87,89,.35));
}
.hero__inner { padding: clamp(48px, 8vw, 80px) 0; }
.hero__eyebrow {
  text-transform: uppercase; letter-spacing: .25em; font-size: .875rem;
  font-weight: 700; opacity: .9; margin-bottom: 1rem;
}
.hero__title {
  color: #fff;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: -.01em;
  font-size: clamp(2.25rem, 6vw, 5.25rem);
  line-height: 1.05;
  margin: 0 0 1.5rem;
}
.hero__title span { display: block; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  font-weight: 700; font-size: .875rem; letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 999px;
  background-image: linear-gradient(90deg, var(--accent-start) 0%, var(--accent-end) 50%, var(--accent-start) 100%);
  background-size: 200% 100%;
  background-position: 0% 50%;
  color: #fff;
  transition: background-position .4s ease, transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 6px 20px rgba(93,153,52,.25);
  border: 0; cursor: pointer;
}
.btn:hover { background-position: 100% 50%; transform: translateY(-1px); color: #fff; }
.btn--ghost {
  background: transparent; color: #fff; box-shadow: none;
  border: 2px solid rgba(255,255,255,.7);
}
.btn--ghost:hover { background: rgba(255,255,255,.15); color: #fff; }
.btn--dark {
  background: var(--primary); color: #fff; box-shadow: 0 6px 20px rgba(75,87,89,.25);
}
.btn--dark:hover { background: var(--primary-ink); color: #fff; }

/* --- Sections --- */
.section { padding: clamp(56px, 8vw, 120px) 0; }
.section--soft { background: var(--bg-soft); }
.section-title { text-align: center; margin-bottom: clamp(32px, 4vw, 56px); }
.section-title .eyebrow {
  display: inline-block; font-size: .75rem; letter-spacing: .25em; text-transform: uppercase;
  font-weight: 700; color: var(--accent-end); margin-bottom: .75rem;
}
.section-title h2 { margin: 0; }
.section-title p { max-width: 720px; margin: 12px auto 0; color: var(--muted); }

/* --- Category cards --- */
.categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.category-card {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 1695 / 651;
  display: block;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  transition: transform var(--transition), box-shadow var(--transition);
}
.category-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.category-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(0,0,0,.14); }
.category-card:hover img { transform: scale(1.04); }
@media (max-width: 900px) {
  .categories { grid-template-columns: 1fr; }
  /* Give category banners more visual weight at 1-col on mobile */
  .category-card { min-height: 140px; }
}

/* --- Brand grid --- */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.brand-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 255 / 162;
  display: grid; place-items: center;
  padding: 16px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.brand-tile:hover { border-color: var(--accent-end); transform: translateY(-3px); box-shadow: 0 14px 28px rgba(0,0,0,.08); }
.brand-tile img { max-height: 100%; max-width: 100%; object-fit: contain; }

/* --- Product grid (category thumbnails) --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(0,0,0,.08); }
.product-card .thumb { aspect-ratio: 1/1; overflow: hidden; background: var(--bg-soft); }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product-card:hover .thumb img { transform: scale(1.06); }
.product-card .label {
  display: block; padding: 14px 10px 16px;
  font-weight: 700; font-size: .78rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary);
}

/* --- Feature grid (2-column text+image) --- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.feature img { border-radius: var(--radius); box-shadow: 0 20px 40px rgba(0,0,0,.1); }
.feature--reverse { direction: rtl; }
.feature--reverse > * { direction: ltr; }
@media (max-width: 800px) {
  .feature, .feature--reverse { grid-template-columns: 1fr; direction: ltr; }
}

/* --- Stats row --- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--gap); text-align: center;
  padding: clamp(24px, 4vw, 40px); background: var(--bg-soft); border-radius: var(--radius);
}
.stat .num {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700; color: var(--accent-end); line-height: 1;
}
.stat .label { margin-top: 8px; font-size: .875rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

/* --- Breadcrumb / page hero --- */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-ink) 100%);
  color: #fff;
  padding: clamp(72px, 10vw, 140px) 0 clamp(48px, 6vw, 90px);
  text-align: center;
}
.page-hero h1 { color: #fff; margin: 0 0 .5rem; text-transform: uppercase; }
.page-hero p { color: rgba(255,255,255,.85); max-width: 720px; margin: 0 auto; }

/* --- Prose (long-form article content) --- */
.prose { max-width: 820px; margin: 0 auto; }
.prose h2, .prose h3, .prose h4 { margin-top: 2em; }
.prose p, .prose li { color: var(--primary); line-height: 1.75; }
.prose ul { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose strong { color: var(--primary-ink); }

/* --- Contact form --- */
.contact-form {
  display: grid; gap: 14px;
  max-width: 640px; margin: 0 auto;
}
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .contact-form .row { grid-template-columns: 1fr; } }
.contact-form label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.contact-form input, .contact-form textarea, .contact-form select {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--border);
  background: transparent;
  padding: 10px 0;
  font-family: inherit; font-size: 1rem; color: var(--primary);
  transition: border-color var(--transition);
}
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus {
  outline: none; border-bottom-color: var(--accent-end);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form .btn { justify-self: start; }

.contact-grid {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.contact-grid .info h3 { margin-bottom: .6em; }
.contact-grid .info p { margin: 0 0 .6em; }
.contact-grid .info a { font-weight: 600; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

/* --- Catalogue banner --- */
.catalogue {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px);
  align-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-ink) 100%);
  color: #fff; border-radius: var(--radius); padding: clamp(28px, 4vw, 56px);
}
.catalogue h3, .catalogue h2 { color: #fff; }
.catalogue img { border-radius: var(--radius); }
@media (max-width: 800px) {
  .catalogue { grid-template-columns: 1fr; text-align: center; }
  .catalogue img { max-width: 280px; margin: 0 auto; }
}

/* --- Footer --- */
.site-footer {
  background: var(--primary);
  color: #fff;
  padding: 72px 0 28px;
  margin-top: clamp(56px, 8vw, 120px);
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--accent-start); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.2fr;
  gap: clamp(24px, 4vw, 48px);
}
.footer-grid h6 {
  color: #fff; text-transform: uppercase; letter-spacing: .12em;
  font-size: .875rem; margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255,255,255,.15);
  display: inline-block;
}
.footer-grid .tagline { opacity: .85; max-width: 260px; }
.footer-logo img { height: 48px; margin-bottom: 14px; }

.footer-form { display: flex; flex-direction: column; gap: 10px; }
.footer-form input {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  padding: 12px 14px;
  color: #fff; font-family: inherit; font-size: .95rem;
}
.footer-form input::placeholder { color: rgba(255,255,255,.55); }
.footer-form button {
  align-self: flex-start;
}

.footer-bottom {
  margin-top: 48px; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  font-size: .8rem; opacity: .75;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* --- Cookie / info notice --- */
.cookie-notice {
  position: fixed; left: 16px; right: 16px; bottom: 16px;
  z-index: 60;
  background: var(--primary); color: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 48px rgba(0,0,0,.3);
  padding: 10px 14px;
  font-size: .9rem;
}
.cookie-notice[hidden] { display: none !important; }
.cookie-notice .cookie-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.cookie-notice p { margin: 0; max-width: 80ch; }
.cookie-notice a { color: var(--accent-start); text-decoration: underline; }
.cookie-notice .btn { padding: 8px 18px; font-size: .8rem; }
@media (max-width: 640px) {
  .cookie-notice { left: 8px; right: 8px; bottom: 8px; }
  .cookie-notice .cookie-inner { flex-direction: column; align-items: stretch; }
  .cookie-notice .btn { align-self: flex-end; }
}

/* --- Consent checkbox (contact form) --- */
.consent {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .85rem; color: var(--muted); line-height: 1.5;
}
.consent input[type=checkbox] {
  margin-top: 3px; flex-shrink: 0;
  accent-color: var(--accent-end);
  width: 16px; height: 16px;
}

/* --- Form status messages --- */
.form-status {
  font-size: .875rem; margin-top: 8px;
  min-height: 1.2em;
}
.form-status.sending { color: var(--muted); }
.form-status.success { color: var(--accent-end); font-weight: 600; }
.form-status.error   { color: #c0392b; font-weight: 600; }

/* --- Utils & animations --- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* --- Breadcrumbs --- */
.crumbs { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; margin-bottom: 12px; }
.crumbs a { color: inherit; }
.crumbs span { margin: 0 8px; }

/* --- Mobile refinements (≤640px / iPhone) --- */
@media (max-width: 640px) {
  /* Hero: tighten title spacing */
  .hero__title { font-size: clamp(2rem, 9vw, 3.5rem); }
  .hero__eyebrow { font-size: .8rem; }

  /* Stats: force 2-column layout on phones */
  .stats {
    grid-template-columns: 1fr 1fr;
    padding: 20px 16px;
    gap: 16px;
  }

  /* Page hero padding */
  .page-hero {
    padding: clamp(56px, 12vw, 100px) 0 clamp(32px, 6vw, 60px);
  }

  /* Section padding */
  .section { padding: clamp(40px, 8vw, 80px) 0; }

  /* Feature: remove the last bottom margin on brands page to avoid excessive spacing */
  .feature[style*="margin-bottom:56px"] { margin-bottom: 40px !important; }

  /* Footer CTA button full-width on small screens */
  .footer-form button { align-self: stretch; text-align: center; justify-content: center; }

  /* Footer bottom: stack vertically */
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Catalogue banner: center button */
  .catalogue .btn { display: inline-flex; }

  /* Product label font can't go below 12px — bump up slightly */
  .product-card .label { font-size: .8rem; }

  /* Ensure btn tap target is at least 44px tall */
  .btn { padding: 14px 24px; min-height: 44px; }
}

/* Touch: remove hover transform effects that feel broken on tap */
@media (hover: none) {
  .category-card:hover { transform: none; }
  .brand-tile:hover { transform: none; }
  .product-card:hover { transform: none; }
  .btn:hover { transform: none; }
}
