/* =========================================================
   AMAIC — distributeur officiel Mattei au Maroc
   Feuille de styles principale
   ========================================================= */

:root {
  --red: #E2231A;
  --red-dark: #B71C14;
  --black: #1A1A1A;
  --black-soft: #262626;
  --gray-900: #2b2b2b;
  --gray-700: #555555;
  --gray-500: #7a7a7a;
  --gray-200: #e6e6e6;
  --gray-100: #f3f3f3;
  --white: #ffffff;
  --radius: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.08);
  --container: 1180px;
  --ff-head: 'Oswald', 'Arial Narrow', sans-serif;
  --ff-body: 'Inter', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--ff-body);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--ff-head);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--black);
  margin: 0 0 16px;
  line-height: 1.15;
}

h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 16px; color: var(--gray-700); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 80px 0; }
.section--tight { padding: 56px 0; }
.section--dark { background: var(--black); color: var(--white); }
.section--dark h2, .section--dark h3 { color: var(--white); }
.section--dark p { color: #c9c9c9; }
.section--gray { background: var(--gray-100); }

.eyebrow {
  display: inline-block;
  font-family: var(--ff-head);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: var(--red);
  margin-bottom: 10px;
  font-weight: 600;
}

.section-head {
  max-width: 720px;
  margin: 0 0 44px;
}
.section-head.center { margin-inline: auto; text-align: center; }

.section-head__bar {
  width: 56px;
  height: 4px;
  background: var(--red);
  margin: 0 0 20px;
}
.section-head.center .section-head__bar { margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  font-family: var(--ff-head);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn--primary { background: var(--red); color: var(--white); }
.btn--primary:hover { background: var(--red-dark); }
.btn--outline { border-color: var(--white); color: var(--white); }
.btn--outline:hover { background: var(--white); color: var(--black); }
.btn--dark { border-color: var(--black); color: var(--black); }
.btn--dark:hover { background: var(--black); color: var(--white); }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--black);
  color: #d6d6d6;
  font-size: 0.82rem;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}
.topbar a { color: #d6d6d6; }
.topbar a:hover { color: var(--white); }
.topbar__links { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar__links span { color: var(--red); margin-right: 6px; }
.topbar__tag { color: #9a9a9a; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.74rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  box-shadow: 0 2px 14px rgba(0,0,0,0.06);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.nav__logo img { height: 46px; width: auto; }
.nav__list {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav__list a {
  display: inline-block;
  padding: 10px 16px;
  font-family: var(--ff-head);
  text-transform: uppercase;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--black);
  border-radius: var(--radius);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav__list a:hover { color: var(--red); }
.nav__list a.is-active { color: var(--red); }
.nav__cta {
  background: var(--red);
  color: var(--white) !important;
  padding: 10px 20px !important;
}
.nav__cta:hover { background: var(--red-dark); color: var(--white) !important; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span { width: 26px; height: 3px; background: var(--black); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: var(--white);
  display: flex;
  align-items: center;
  min-height: 72vh;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(10,10,10,0.92) 0%, rgba(10,10,10,0.75) 38%, rgba(226,35,26,0.55) 100%);
}
.hero__content { position: relative; z-index: 2; max-width: 680px; }
.hero__content h1 { color: var(--white); }
.hero__content p { color: #e7e7e7; font-size: 1.08rem; max-width: 560px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

.page-hero {
  min-height: 46vh;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat { text-align: center; }
.stat__num {
  font-family: var(--ff-head);
  font-size: clamp(2rem, 4vw, 2.6rem);
  color: var(--red);
  font-weight: 700;
}
.stat__label {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
}
.section--dark .stat__label { color: #b7b7b7; }

/* ---------- Grids & cards ---------- */
.grid {
  display: grid;
  gap: 28px;
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--6 { grid-template-columns: repeat(6, 1fr); }

.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.card__img { height: 190px; overflow: hidden; background: var(--gray-100); }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 22px 22px 26px; flex: 1; display: flex; flex-direction: column; }
.card__body h3 { margin-bottom: 10px; }
.card__body p { font-size: 0.93rem; margin-bottom: 14px; }
.card__list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  font-size: 0.9rem;
  color: var(--gray-700);
}
.card__list li {
  padding: 6px 0 6px 20px;
  position: relative;
  border-top: 1px dashed var(--gray-200);
}
.card__list li:first-child { border-top: none; }
.card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 8px;
  height: 8px;
  background: var(--red);
}
.card__link {
  margin-top: auto;
  font-family: var(--ff-head);
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--red);
  font-weight: 600;
}

/* Feature (icon) card */
.feature {
  text-align: center;
  padding: 26px 18px;
}
.feature__icon {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 18px;
  border: 3px solid var(--gray-200);
}
.feature__icon img { width: 100%; height: 100%; object-fit: cover; }
.feature h3 { font-size: 1.05rem; }
.feature p { font-size: 0.88rem; }

/* Sector pill grid */
.sector {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 150px;
  color: var(--white);
}
.sector img { width: 100%; height: 100%; object-fit: cover; }
.sector::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.1) 65%);
}
.sector span {
  position: absolute;
  left: 14px;
  bottom: 12px;
  right: 14px;
  z-index: 2;
  font-family: var(--ff-head);
  text-transform: uppercase;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  font-weight: 600;
}

/* Flag / presence grid */
.presence {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.presence__item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.presence__item img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}
.presence__item strong { display: block; font-size: 0.95rem; }
.presence__item span { font-size: 0.82rem; color: var(--gray-500); }
.presence__item--highlight {
  border-color: var(--red);
  background: #fff5f4;
}

/* Value / why cards */
.value-card {
  background: var(--white);
  border-left: 4px solid var(--red);
  box-shadow: var(--shadow-sm);
  padding: 28px 26px;
  border-radius: var(--radius);
}
.value-card h3 { margin-bottom: 10px; }
.value-card p { margin: 0; font-size: 0.93rem; }

/* CTA band */
.cta-band {
  background: var(--red);
  color: var(--white);
  padding: 56px 0;
  text-align: center;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: #ffe3e1; max-width: 560px; margin-inline: auto; }
.cta-band .btn--primary { background: var(--black); }
.cta-band .btn--primary:hover { background: var(--black-soft); }

/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: start;
}
.contact-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.contact-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}
.contact-card h4 { margin: 0 0 4px; text-transform: none; font-family: var(--ff-body); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gray-500); }
.contact-card p { margin: 0; font-weight: 600; color: var(--black); font-size: 1rem; }

.map-frame {
  width: 100%;
  height: 260px;
  border: 0;
  border-radius: var(--radius);
  margin-top: 8px;
}

.form {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.form label {
  display: block;
  font-family: var(--ff-head);
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form .field { margin-bottom: 18px; }
.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--ff-body);
  font-size: 0.95rem;
  background: var(--gray-100);
}
.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: 2px solid var(--red);
  background: var(--white);
}
.form textarea { resize: vertical; min-height: 120px; }
.form__note { font-size: 0.8rem; color: var(--gray-500); margin-top: 10px; }
.form__success {
  display: none;
  background: #eaf7ee;
  color: #1c7a37;
  border: 1px solid #bfe6cb;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-top: 14px;
}
.form__success.is-visible { display: block; }
.form__error {
  display: none;
  background: #fbeaea;
  color: #a32424;
  border: 1px solid #f0c2c2;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-top: 14px;
}
.form__error.is-visible { display: block; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--black);
  color: #c9c9c9;
  padding: 60px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid #333;
}
.footer-grid h4 {
  color: var(--white);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 10px; font-size: 0.9rem; }
.footer-grid a:hover { color: var(--red); }
.footer-logo { display: inline-block; background: var(--white); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; }
.footer-logo img { height: 34px; }
.footer-grid p { color: #9f9f9f; font-size: 0.88rem; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding: 20px 0;
  font-size: 0.8rem;
  color: #8a8a8a;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom a:hover { color: var(--red); }

/* ---------- Breadcrumb / page intro ---------- */
.page-hero .eyebrow { color: #ffb3ae; }

/* ---------- Anchors offset for sticky header ---------- */
[id] { scroll-margin-top: 90px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--6 { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .presence { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .nav__list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px 18px;
    box-shadow: 0 12px 20px rgba(0,0,0,0.08);
    display: none;
  }
  .nav__list.is-open { display: flex; }
  .nav__list a { padding: 12px 8px; }
  .nav__toggle { display: flex; }
  .nav__cta { text-align: center; }

  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .grid--6 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .topbar .container { flex-direction: column; align-items: flex-start; }
}
