/* ============================================================
   Bambo House — décoration marocaine artisanale
  compressible, responsive, bilingue ar/fr avec RTL
   ============================================================ */

:root {
  --ink: #25251f;
  --muted: #77766d;
  --gold: #b18a4b;
  --cream: #f6f2e9;
  --sand: #e9dfcf;
  --white: #fff;
  --line: #e7e0d5;
  --serif: Georgia, "Times New Roman", serif;
}

html[lang="ar"] { --serif: "Cairo", Georgia, serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, "Cairo", Helvetica, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
}
html[lang="ar"] body { font-family: "Cairo", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.serif { font-family: var(--serif); font-weight: 400; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Bandeau & navigation ---------- */
.top {
  background: #262820;
  color: #f8f3e8;
  text-align: center;
  padding: 9px 14px;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.nav {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: 6%;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 20;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, serif;
  font-size: 25px;
  letter-spacing: 0.16em;
  line-height: 1.1;
  white-space: nowrap;
}
.logo-mark { width: 40px; height: 40px; flex: none; object-fit: contain; }
.logo-word { display: block; }
.logo small {
  display: block;
  font: 9px Arial, sans-serif;
  letter-spacing: 0.24em;
  text-align: center;
  color: var(--gold);
  margin-top: 4px;
}
.links { display: flex; gap: 26px; font-size: 13px; }
.links a:hover { color: var(--gold); }
.navright { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-block;
  background: var(--ink);
  color: white;
  padding: 14px 22px;
  border: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  transition: opacity 0.2s, transform 0.2s;
}
.btn:hover { opacity: 0.86; transform: translateY(-1px); }
.btn.gold { background: var(--gold); }
.btn.outline { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-block { width: 100%; }

.lang-toggle, .cart-toggle, .mobile-menu {
  height: 40px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: bold;
}
.lang-toggle { padding-inline: 12px; letter-spacing: 0.06em; }
.lang-toggle:hover, .cart-toggle:hover { border-color: var(--gold); color: var(--gold); }
.cart-toggle { position: relative; padding-inline: 12px; line-height: 1; }
.cart-count {
  position: absolute;
  inset-inline-start: -7px;
  inset-block-start: -7px;
  background: var(--gold);
  color: #fff;
  border-radius: 999px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  font-size: 10px;
}
.mobile-menu { display: none; padding-inline: 12px; }

/* ---------- Hero ---------- */
.hero {
  min-height: 570px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--cream);
}
.hero-copy {
  padding: 95px 9% 80px 13%;
  padding-inline-start: 13%;
  padding-inline-end: 9%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: bold;
}
.hero h1 { font-size: clamp(40px, 5vw, 67px); line-height: 1.12; margin: 22px 0; }
.hero p { line-height: 1.9; color: #65645c; max-width: 450px; }
.hero-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.hero-img {
  background: linear-gradient(0deg, #0002, #0000),
    url('../assets/images/ambiance-salle-a-manger.jpg') center/cover;
  min-height: 500px;
}

.trust {
  display: flex;
  justify-content: center;
  gap: 60px;
  padding: 22px 5%;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: #605f57;
  flex-wrap: wrap;
}
.trust span::before { content: '✦'; color: var(--gold); margin-inline-end: 9px; }

/* ---------- Sections ---------- */
.section { padding: 82px 7%; }
.section-head { text-align: center; max-width: 650px; margin: 0 auto 42px; }
.section-head h2 { font-size: 42px; margin: 12px 0; }
.section-head p { color: var(--muted); line-height: 1.8; font-size: 14px; }

.categories { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat { height: 300px; position: relative; overflow: hidden; background: #ddd; display: block; }
.cat img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.cat:hover img { transform: scale(1.05); }
.cat::after { content: ''; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, #0009); }
.cat label {
  position: absolute;
  inset-block-end: 22px;
  inset-inline-start: 22px;
  color: #fff;
  z-index: 1;
  font: 24px var(--serif);
}

.products { background: #faf8f3; }
.filters { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.filter {
  border: 1px solid var(--line);
  background: white;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 12px;
}
.filter:hover { border-color: var(--gold); }
.filter.active { background: var(--ink); color: white; border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product { background: white; }
.product img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #eee; }
.pimg { position: relative; }
.pimg .alt { position: absolute; inset: 0; height: 100%; opacity: 0; transition: opacity .35s; }
.product:hover .pimg .alt { opacity: 1; }
.pinfo { padding: 16px; }
.pinfo small { color: var(--gold); text-transform: uppercase; letter-spacing: 0.12em; font-size: 10px; }
.pinfo h3 { font: 20px var(--serif); margin: 9px 0; }
.pinfo .pdesc { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 0 0 12px; }
.price { font-size: 14px; font-weight: bold; }
.pinfo button {
  margin-top: 13px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--ink);
  background: white;
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.2s, color 0.2s;
}
.pinfo button:hover { background: var(--ink); color: #fff; }

/* ---------- Sur mesure ---------- */
.custom { display: grid; grid-template-columns: 1fr 1fr; background: var(--cream); }
.custom-img {
  position: relative;
  min-height: 480px;
  background: url('../assets/images/Ensemble-Salle---Manger-Bois---Rotin-.jpg') center/cover;
}
.custom-img::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
}
.custom-caption {
  position: absolute;
  z-index: 1;
  bottom: 26px;
  right: 28px;
  color: #fff;
  font: 600 18px/1.4 Cairo, Arial, sans-serif;
  text-shadow: 0 2px 8px #0008;
}
.custom-content { padding: 70px 10%; align-self: center; }
.custom h2 { font-size: 42px; margin: 12px 0; }
.custom p { color: var(--muted); line-height: 1.8; }
.calc { background: white; padding: 24px; margin-top: 25px; box-shadow: 0 10px 35px #0000000a; }
.calc h3 { margin-top: 0; font-size: 22px; }
.field { margin: 13px 0; }
.field label { display: block; font-size: 12px; margin-bottom: 7px; color: #555; }
.field input, .field select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--gold); }
.estimate { font: 30px var(--serif); color: var(--gold); margin: 15px 0; }
.hint { color: #888; font-size: 11px; }

/* ---------- Galerie, étapes, FAQ ---------- */
.gallery { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; }
.gallery img { width: 100%; height: 260px; object-fit: cover; }
.gallery img:first-child { height: 532px; grid-row: span 2; }

.work-section { background: var(--cream); }
.work-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.work-item { margin: 0; background: #fff; overflow: hidden; box-shadow: 0 8px 25px #0000000a; }
.work-item img { width: 100%; height: 240px; object-fit: cover; transition: transform 0.4s; }
.work-item:hover img { transform: scale(1.04); }
.work-item figcaption { padding: 12px 14px; font-size: 13px; font-weight: bold; color: var(--ink); }
.work-featured { grid-row: span 2; }
.work-featured img { height: 496px; }

.steps-section { background: var(--cream); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step { border-top: 1px solid var(--gold); padding-top: 20px; }
.step b { font: 34px var(--serif); color: var(--gold); }
.step h3 { font: 21px var(--serif); margin: 8px 0; }
.step p { font-size: 13px; color: var(--muted); line-height: 1.8; }
.faq { max-width: 850px; margin: auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 19px 0; }
.faq summary { cursor: pointer; font: 19px var(--serif); }
.faq p { color: var(--muted); line-height: 1.8; font-size: 14px; }

/* ---------- CTA & footer ---------- */
.cta { background: #282a23; color: white; text-align: center; padding: 75px 20px; }
.cta h2 { font-size: 42px; margin: 12px 0; }
.cta p { color: #d4d0c6; }
.footer { background: #1d1f1a; color: #eee; padding: 55px 7% 25px; }
.footgrid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 35px; }
.footer p, .footer a { color: #c4c1b8; font-size: 13px; line-height: 1.9; }
.footer a:hover { color: #fff; }
.footer h4 { font: 18px var(--serif); font-weight: 400; }
.copyright { border-top: 1px solid #44463e; margin-top: 35px; padding-top: 20px; color: #aaa; font-size: 11px; }
.wa {
  position: fixed;
  inset-inline-end: 22px;
  inset-block-end: 22px;
  background: #218b54;
  color: #fff;
  border-radius: 50px;
  padding: 15px 20px;
  z-index: 15;
  box-shadow: 0 5px 20px #0003;
  font-size: 13px;
}

/* ---------- Panier ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: #0c1812aa;
  z-index: 30;
}
.cart-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(420px, 100%);
  background: #fff;
  z-index: 31;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px #0002;
  transform: translateX(110%);
  transition: transform 0.3s ease;
}
html[dir="rtl"] .cart-drawer { transform: translateX(-110%); }
.cart-drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 22px; }
.close-btn { border: 0; background: none; font-size: 18px; padding: 6px; }
.cart-items { flex: 1; overflow-y: auto; padding: 6px 20px; }
.cart-empty { color: var(--muted); text-align: center; padding-block: 60px; font-size: 14px; }
.cart-item { display: flex; gap: 12px; padding-block: 15px; border-bottom: 1px solid var(--line); }
.cart-item img { width: 68px; height: 68px; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info strong { display: block; font-size: 14px; }
.cart-item-info small { color: var(--muted); font-size: 12px; }
.qty-control { display: inline-flex; align-items: center; gap: 8px; margin-top: 7px; border: 1px solid var(--line); }
.qty-control button { width: 26px; height: 26px; border: 0; background: var(--cream); }
.qty-control span { font-size: 12px; min-width: 14px; text-align: center; }
.cart-item-end { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.cart-item-end strong { font-size: 13px; white-space: nowrap; }
.remove-btn { border: 0; background: none; color: var(--muted); font-size: 11px; text-decoration: underline; }
.cart-footer { padding: 20px; border-top: 1px solid var(--line); background: #faf8f3; }
.cart-total { display: flex; justify-content: space-between; margin-bottom: 16px; font-size: 14px; }
.cart-total strong { color: var(--gold); }
.drawer-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; }

.toast {
  position: fixed;
  inset-block-end: 26px;
  inset-inline: 0;
  margin-inline: auto;
  width: max-content;
  max-width: calc(100% - 40px);
  background: var(--ink);
  color: #fff;
  padding: 13px 22px;
  border-radius: 4px;
  font-size: 13px;
  z-index: 40;
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateY(0); }


/* ---------- Pergola sur mesure (fenêtre) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #000000a8;
  overflow: auto;
}
.modal-box {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  width: 100%;
  max-width: 940px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
}
.modal-close {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #fffe;
  font-size: 16px;
}
.pg-gallery { background: var(--cream); }
.pg-gallery #pgMain { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pg-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; }
.pg-thumbs img {
  width: 68px;
  height: 52px;
  flex: none;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.65;
  border: 2px solid transparent;
}
.pg-thumbs img.active { opacity: 1; border-color: var(--gold); }
.pg-form { padding: 34px 28px; align-self: center; }
.pg-form h2 { font-size: 30px; margin: 0 0 8px; }
.pg-form p { color: var(--muted); line-height: 1.8; margin: 0 0 6px; }
.pg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pg-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 8px;
  padding: 14px 16px;
  background: var(--cream);
}
.pg-summary span { display: block; font-size: 12px; color: var(--muted); }
.pg-summary strong { font-size: 20px; color: var(--gold); }
.pg-form .hint { display: block; margin-bottom: 14px; }
.btn:disabled, button.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 850px) {
  .modal { align-items: flex-start; padding: 12px; }
  .modal-box { grid-template-columns: 1fr; max-height: none; }
  .pg-form { padding: 24px 20px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 850px) {
  .links { display: none; }
  .links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    inset-block-start: 78px;
    inset-inline: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 14px 6%;
    gap: 4px;
  }
  .mobile-menu { display: block; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 65px 8%; }
  .hero-img { min-height: 330px; }
  .categories, .grid { grid-template-columns: repeat(2, 1fr); }
  .custom { grid-template-columns: 1fr; }
  .custom-img { min-height: 300px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footgrid { grid-template-columns: 1fr 1fr; }
  .trust { gap: 18px; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery img:first-child { height: 260px; grid-row: auto; }
  .work-gallery { grid-template-columns: 1fr 1fr; }
  .work-featured { grid-row: auto; }
  .work-featured img { height: 240px; }
}

@media (max-width: 520px) {
  .nav { padding-inline: 5%; height: 68px; }
  .links.open { inset-block-start: 68px; }
  .logo { font-size: 21px; }
  .logo-mark { width: 32px; height: 32px; object-fit: contain; }
  .navright { gap: 6px; }
  .navright .btn.gold { display: none; }
  .lang-toggle, .cart-toggle, .mobile-menu { height: 36px; padding-inline: 9px; }
  .hero h1 { font-size: 43px; }
  .section { padding: 60px 5%; }
  .section-head h2, .custom h2, .cta h2 { font-size: 34px; }
  .categories { gap: 9px; }
  .cat { height: 190px; }
  .cat label { font-size: 18px; inset-inline-start: 12px; inset-block-end: 14px; }
  .grid { gap: 10px; }
  .pinfo { padding: 11px; }
  .pinfo h3 { font-size: 17px; }
  .steps { gap: 15px; }
  .footgrid { grid-template-columns: 1fr; }
  .gallery { gap: 8px; }
  .gallery img, .gallery img:first-child { height: 180px; }
  .work-item img, .work-featured img { height: 180px; }
  .work-item figcaption { padding: 9px 10px; font-size: 11px; }
  .wa { padding: 12px 14px; inset-inline-end: 12px; inset-block-end: 12px; }
}

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