/* =========================
   SOFAS PRODUCT — RUMATO
   clean rebuild
   ========================= */

:root{
  --product-bg:#ECE9E3;
  --product-panel:#e2ddd4;
  --product-soft:#d8d1c7;
  --product-ink:#111;
  --product-muted:rgba(17,17,17,.66);
  --product-line:rgba(17,17,17,.14);
  --product-font:"Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* page */

.sofa-product-page{
  background:var(--product-bg);
  color:var(--product-ink);
  font-family:var(--product-font);
}

.rumato-product{
  max-width:1440px;
  margin:0 auto;
  padding:96px 40px 120px;
}

/* =========================
   HERO
   ========================= */

.product-hero{
  display:grid;
  grid-template-columns:1.55fr .45fr;
  gap:18px;
  min-height:720px;
  margin-bottom:88px;
}

.product-hero__visual{
  margin:0;
  overflow:hidden;
  background:var(--product-soft);
}

.product-hero__visual picture{
  display:block;
  width:100%;
  height:100%;
}

.product-hero__visual img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  object-position:center;
}

.product-hero__panel{
  padding:42px;
  background:var(--product-panel);
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
}

.product-hero__panel span{
  margin-bottom:auto;
  font-size:13px;
  line-height:1;
  font-weight:600;
  letter-spacing:.08em;
  color:rgba(17,17,17,.48);
}

.product-hero__panel h1{
  margin:0 0 18px;
  padding:0;
  border:0;
  font-size:clamp(72px,8vw,128px);
  line-height:.82;
  font-weight:500;
  letter-spacing:-.085em;
  color:var(--product-ink);
}

.product-hero__panel p{
  margin:0;
  max-width:520px;
  font-size:17px;
  line-height:1.48;
  font-weight:500;
  color:var(--product-muted);
}

/* =========================
   STATEMENT
   ========================= */

.product-statement{
  max-width:980px;
  margin:0 0 96px;
}

.product-statement p{
  margin:0;
  font-size:clamp(34px,4.5vw,68px);
  line-height:1.02;
  font-weight:400;
  letter-spacing:-.045em;
  color:var(--product-ink);
}

/* =========================
   CONFIG HEAD
   ========================= */

.product-config{
  margin-bottom:28px;
}

.product-config__head{
  display:grid;
  grid-template-columns:220px minmax(0,1fr);
  gap:28px;
  margin-bottom:22px;
}

.product-config__head span{
  font-size:13px;
  line-height:1;
  font-weight:600;
  letter-spacing:.08em;
  text-transform:lowercase;
  color:rgba(17,17,17,.54);
}

.product-config__head p{
  margin:0;
  max-width:680px;
  font-size:26px;
  line-height:1.12;
  font-weight:500;
  letter-spacing:-.045em;
  color:var(--product-ink);
}

/* =========================
   CONFIGURATOR
   ========================= */

.sofa-filter{
  display:grid;
  grid-template-columns:.82fr 1.18fr;
  gap:18px;
  margin:0;
  border:0;
  border-radius:0;
  background:transparent;
  overflow:visible;
}

.filters{
  padding:28px;
  background:var(--product-panel);
  display:grid;
  grid-template-columns:1fr 1fr;
  grid-template-areas:
    "shape shape"
    "len1 len2"
    "arms chaise"
    "depth sleep"
    "comment comment";
  gap:16px;
  align-content:start;
  border:0;
}

.field{
  display:grid;
  gap:7px;
}

.field--shape{grid-area:shape;}
.field--len1{grid-area:len1;}
.field--len2{grid-area:len2;}
.field--arms{grid-area:arms;}
.field--chaise{grid-area:chaise;}
.field--depth{grid-area:depth;}
.field--sleep{grid-area:sleep;}
.field--comment{grid-area:comment;}

.filters:not(.is-corner) .field--len2{
  display:none;
}

.label{
  margin:0;
  font-size:13px;
  line-height:1.2;
  font-weight:600;
  letter-spacing:.02em;
  color:rgba(17,17,17,.68);
}

.select,
textarea.comment{
  width:100%;
  min-height:42px;
  padding:10px 12px;
  border:1px solid var(--product-line);
  border-radius:0;
  background:transparent;
  color:var(--product-ink);
  font-family:var(--product-font);
  font-size:14px;
  font-weight:500;
  outline:none;
}

.select:focus,
textarea.comment:focus{
  border-color:rgba(17,17,17,.42);
}

textarea.comment{
  height:84px;
  resize:none;
}

.inline-control{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:42px;
}

.pills{
  display:flex;
  flex-wrap:nowrap;
  gap:8px;
}

.pill{
  appearance:none;
  min-height:36px;
  padding:8px 12px;
  border:1px solid var(--product-line);
  border-radius:0;
  background:transparent;
  color:var(--product-ink);
  font-family:var(--product-font);
  font-size:13px;
  font-weight:600;
  cursor:pointer;
}

.pill[aria-pressed="true"]{
  background:var(--product-ink);
  color:var(--product-bg);
  border-color:var(--product-ink);
}

.switch{
  position:relative;
  width:44px;
  height:22px;
  flex-shrink:0;
  background:rgba(17,17,17,.18);
  border-radius:0;
  cursor:pointer;
}

.switch::before{
  content:"";
  position:absolute;
  top:2px;
  left:2px;
  width:18px;
  height:18px;
  background:#fff;
  border-radius:0;
  transition:left .2s ease;
}

input[type="checkbox"].toggle{
  display:none;
}

input[type="checkbox"].toggle:checked + .switch{
  background:var(--product-ink);
}

input[type="checkbox"].toggle:checked + .switch::before{
  left:24px;
}

/* preview */

.preview{
  min-height:520px;
  height:auto;
  width:100%;
  background:var(--product-panel);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.preview img{
  max-width:92%;
  max-height:92%;
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
}

/* =========================
   FABRICS
   ========================= */

.fabric-selector{
  height:360px;
  margin-top:18px;
  border:0;
  border-radius:0;
  background:transparent;
  overflow:visible;
}

.fabric-grid{
  height:100%;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
}

.fabric-col{
  display:grid;
  grid-template-rows:1fr auto;
  background:var(--product-panel);
  border:0;
}

.fabric-card{
  position:relative;
  min-height:260px;
  background:var(--product-soft) center/cover no-repeat;
  overflow:hidden;
}

.fabric-card.dimmed{
  filter:saturate(.45) brightness(.92);
  opacity:.62;
}

.fabric-title{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  padding:14px;
  font-size:15px;
  line-height:1.2;
  font-weight:600;
  text-align:center;
  color:var(--product-ink);
  cursor:pointer;
}

.palette{
  position:absolute;
  inset:0;
  display:none;
  grid-template-columns:repeat(5,1fr);
  gap:10px;
  padding:12px;
  background:rgba(236,233,227,.94);
  backdrop-filter:blur(2px);
}

.sw{
  position:relative;
  width:100%;
  height:100%;
  border:0;
  border-radius:0;
  cursor:pointer;
  background-position:center;
  background-size:cover;
}

.sw-badge{
  position:absolute;
  right:6px;
  bottom:6px;
  padding:3px 6px;
  background:rgba(236,233,227,.92);
  color:var(--product-ink);
  font-size:11px;
  line-height:1;
  font-weight:600;
}

.fabric-select{
  min-height:52px;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.fabric-more{
  appearance:none;
  border:0;
  background:none;
  padding:0;
  color:var(--product-ink);
  font-family:var(--product-font);
  font-size:13px;
  line-height:1.2;
  font-weight:600;
  cursor:pointer;
  text-align:left;
}

/* =========================
   PRICE + CTA
   ========================= */

.action-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin:18px 0 96px;
  padding:0;
  border:0;
}

.price{
  font-size:26px;
  line-height:1;
  font-weight:500;
  letter-spacing:-.045em;
}

.price strong{
  font-weight:600;
}

.btn-primary{
  appearance:none;
  min-width:260px;
  height:54px;
  padding:0 28px;
  border:1px solid var(--product-ink);
  border-radius:0;
  background:var(--product-ink);
  color:var(--product-bg);
  font-family:var(--product-font);
  font-size:14px;
  font-weight:700;
  cursor:pointer;
}

/* =========================
   ADDONS
   ========================= */

.addons{
  margin:0 0 96px;
}

.addon-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
}

.addon-card{
  display:flex;
  flex-direction:column;
  min-height:100%;
  border:0;
  border-radius:0;
  background:var(--product-panel);
  overflow:hidden;
}

.addon-media{
  height:320px;
  background:#fff center/cover no-repeat;
}

.addon-row{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:18px;
  padding:18px;
}

.addon-body{
  min-height:76px;
  display:grid;
  grid-template-rows:auto 20px auto;
  align-content:start;
  gap:4px;
}

.addon-title{
  margin:0;
  color:var(--product-ink);
  font-size:14px;
  line-height:1.25;
  font-weight:700;
}

.addon-gabarit{
  min-height:20px;
  color:var(--product-muted);
  font-size:13px;
  line-height:1.25;
  font-weight:600;
}

.addon-price{
  color:var(--product-ink);
  font-size:13px;
  line-height:1.25;
  font-weight:700;
}

.addon-ctrl{
  width:100%;
  min-width:0;
  margin-top:auto;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.qty-control{
  width:100%;
  height:40px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 16px;
  border:1px solid var(--product-ink);
  border-radius:0;
  color:var(--product-ink);
  background:transparent;
  font-family:var(--product-font);
  font-size:13px;
  font-weight:700;
}

.qty-btn{
  appearance:none;
  border:0;
  background:transparent;
  color:inherit;
  font:inherit;
  cursor:pointer;
  padding:0 6px;
}

.qty-val{
  min-width:24px;
  text-align:center;
}

.btn-add{
  appearance:none;
  width:100%;
  height:40px;
  border:1px solid var(--product-ink);
  border-radius:0;
  background:var(--product-ink);
  color:var(--product-bg);
  font-family:var(--product-font);
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}

/* =========================
   NOTES
   ========================= */

.product-notes{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  margin-bottom:120px;
}

.product-notes article{
  min-height:320px;
  padding:32px;
  background:var(--product-panel);
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
}

.product-notes span{
  margin-bottom:auto;
  color:rgba(17,17,17,.48);
  font-size:13px;
  font-weight:600;
  letter-spacing:.08em;
}

.product-notes h3{
  margin:0 0 14px;
  font-size:clamp(34px,4vw,72px);
  line-height:.88;
  font-weight:500;
  letter-spacing:-.075em;
}

.product-notes p{
  margin:0;
  max-width:520px;
  color:var(--product-muted);
  font-size:16px;
  line-height:1.48;
  font-weight:500;
}

/* =========================
   MODALS
   ========================= */

.fabric-modal-backdrop,
.article-modal-backdrop{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(0,0,0,.42);
  z-index:2147483000;
}

.fabric-modal-backdrop{
  z-index:2147483001;
}

.fabric-modal-backdrop[aria-hidden="true"],
.article-modal-backdrop[aria-hidden="true"]{
  display:none !important;
}

.fabric-modal-box,
.article-modal-box{
  position:relative;
  width:min(560px,100%);
  max-height:80vh;
  overflow:auto;
  padding:28px 28px 34px;
  background:var(--product-bg);
  color:var(--product-ink);
  border-radius:0;
  box-shadow:0 24px 70px rgba(0,0,0,.35);
  font-family:var(--product-font);
}

.fabric-modal-close,
.article-modal-close{
  position:absolute;
  top:18px;
  right:20px;
  border:0;
  background:transparent;
  color:var(--product-ink);
  font-size:16px;
  font-weight:700;
  cursor:pointer;
}

.fabric-modal-title,
.article-modal-title{
  margin:0 34px 18px 0;
  color:var(--product-ink);
  font-size:18px;
  line-height:1.25;
  font-weight:700;
}

.fabric-modal-body,
.article-modal-body{
  color:var(--product-muted);
  font-size:14px;
  line-height:1.55;
  white-space:pre-line;
}

/* mobile fabric overlay created by JS */

.sofa-fabric-overlay{
  position:fixed;
  inset:0;
  display:none;
  align-items:stretch;
  justify-content:center;
  background:rgba(0,0,0,.62);
  z-index:2147483600;
}

.sofa-fabric-overlay.is-open{
  display:flex;
}

.sofa-fabric-box{
  width:100%;
  max-width:480px;
  margin:16px;
  padding:16px 16px 24px;
  display:flex;
  flex-direction:column;
  background:var(--product-bg);
  border-radius:0;
  box-shadow:0 20px 50px rgba(0,0,0,.35);
}

.sofa-fabric-title{
  margin-bottom:10px;
  text-align:center;
  font-size:15px;
  font-weight:700;
}

.sofa-fabric-grid{
  flex:1;
  overflow:auto;
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
}

.sofa-fabric-swatch{
  position:relative;
  width:100%;
  aspect-ratio:1/1;
  border:0;
  border-radius:0;
  background-size:cover;
  background-position:center;
  cursor:pointer;
}

.sofa-fabric-swatch.is-selected{
  outline:2px solid var(--product-ink);
  outline-offset:2px;
}

.sofa-fabric-choose{
  position:fixed;
  display:none;
  padding:8px 14px;
  border:0;
  border-radius:0;
  background:var(--product-ink);
  color:var(--product-bg);
  font-size:13px;
  font-weight:700;
  z-index:2147483601;
  box-shadow:0 8px 18px rgba(0,0,0,.32);
}

/* =========================
   FOOTER PROTECTION
   ========================= */

.r-footer-video{
  width:100vw;
  margin-left:calc(50% - 50vw);
  margin-right:calc(50% - 50vw);
}

.r-footer-video,
.r-footer-video *{
  font-family:var(--product-font);
}

.r-footer-video a,
.r-footer-video a:visited,
.r-footer-video__action,
.r-footer-video__action:visited,
.r-footer-video__brand,
.r-footer-video__slogan,
.r-footer-video__action-label,
.r-footer-video__action-value{
  color:#ECE9E3 !important;
}

/* =========================
   RESPONSIVE
   ========================= */

@media(max-width:1200px){
  .addon-grid{
    grid-template-columns:repeat(2,1fr);
  }
}

@media(max-width:900px){
  .rumato-product{
    padding:72px 16px 80px;
  }

  .product-hero{
    grid-template-columns:1fr;
    min-height:0;
    margin-bottom:70px;
  }

  .product-hero__visual{
    height:58vh;
    min-height:420px;
  }

  .product-hero__panel{
    padding:28px;
  }

  .product-hero__panel h1{
    font-size:64px;
  }

  .product-statement{
    margin-bottom:70px;
  }

  .product-statement p{
    font-size:42px;
    line-height:.98;
  }

  .product-config__head{
    grid-template-columns:1fr;
    gap:14px;
  }

  .product-config__head p{
    font-size:24px;
  }

  .sofa-filter{
    grid-template-columns:1fr;
    gap:12px;
  }

  .filters{
    padding:24px;
  }

  .preview{
    min-height:340px;
  }

  .fabric-selector{
    height:auto;
  }

  .fabric-grid{
    display:flex;
    flex-direction:column;
    gap:14px;
  }

  .fabric-card{
    min-height:110px;
  }

  .action-bar{
    display:block;
    margin-bottom:70px;
  }

  .price{
    margin-bottom:14px;
    font-size:22px;
  }

  .btn-primary{
    width:100%;
  }

  .addon-grid{
    grid-template-columns:1fr;
  }

  .addon-media{
    height:280px;
  }

  .product-notes{
    grid-template-columns:1fr;
    margin-bottom:80px;
  }

  .product-notes article{
    min-height:260px;
    padding:28px;
  }
}

@media(max-width:600px){
  .rumato-product{
    padding-left:16px;
    padding-right:16px;
  }

  .product-hero__visual{
    min-height:320px;
    height:46vh;
  }

  .product-hero__panel h1{
    font-size:56px;
  }

  .product-statement p{
    font-size:34px;
  }

  .filters{
    display:flex;
    flex-direction:column;
  }

  .inline-control{
    align-items:flex-start;
    flex-direction:column;
  }

  .pills{
    width:100%;
  }

  .pill{
    flex:1;
  }

  .addon-media{
    height:240px;
  }

  .fabric-modal-box,
  .article-modal-box{
    max-height:85vh;
    padding:22px;
  }
}