/* =========================
   BEDS 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 */

.bed-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.80fr .20fr;
  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);
}
.product-hero{
  width:calc(100% + 240px);
  margin-left:-120px;

  display:grid;
  grid-template-columns:1.65fr .35fr;
  gap:18px;
}

/* =========================
   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);
}

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

.bed-filter{
  width:100%;
  margin:0;
  background:transparent;
}

.bed-filter .filters{
  width:100%;
  padding:28px;
  background:var(--product-panel);

  display:grid;
  grid-template-columns:
    minmax(190px, .9fr)
    minmax(300px, 1.35fr)
    minmax(190px, .9fr)
    minmax(230px, 1fr);

  grid-template-areas:
    "size border headboard lift"
    "comment comment comment comment";

  gap:22px 24px;
  align-items:end;
}

.bed-filter .field{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:9px;
}

.bed-filter .field--size{
  grid-area:size;
}

.bed-filter .field--border{
  grid-area:border;
}

.bed-filter .field--headboard{
  grid-area:headboard;
}

.bed-filter .field--lift{
  grid-area:lift;
}

.bed-filter .field--comment{
  grid-area:comment;
  margin-top:2px;
}

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

.bed-filter .select,
.bed-filter textarea.comment{
  width:100%;
  min-width:0;
  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;
}

.bed-filter .select{
  height:44px;
  padding:0 38px 0 13px;
  appearance:none;
  cursor:pointer;

  background-image:
    linear-gradient(45deg, transparent 50%, rgba(17,17,17,.55) 50%),
    linear-gradient(135deg, rgba(17,17,17,.55) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 19px,
    calc(100% - 12px) 19px;
  background-size:5px 5px, 5px 5px;
  background-repeat:no-repeat;
}

.bed-filter .select:hover,
.bed-filter textarea.comment:hover{
  border-color:rgba(17,17,17,.28);
}

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

.bed-filter textarea.comment{
  height:72px;
  min-height:72px;
  padding:14px;
  resize:none;
  line-height:1.4;
}

/* Толщина борта */

.bed-filter .pills{
  width:100%;
  height:44px;
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:8px;
}

.bed-filter .pill{
  appearance:none;
  width:100%;
  min-width:0;
  height:44px;
  padding:0 12px;

  border:1px solid var(--product-line);
  border-radius:0;
  background:transparent;

  color:var(--product-ink);
  font-family:var(--product-font);
  font-size:13px;
  line-height:1;
  font-weight:600;

  cursor:pointer;
  transition:
    background .18s ease,
    color .18s ease,
    border-color .18s ease;
}

.bed-filter .pill:hover{
  border-color:rgba(17,17,17,.4);
}

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

/* Подъемный механизм */

.bed-filter .inline-control{
  width:100%;
  height:44px;
  padding:0 13px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;

  border:1px solid var(--product-line);
}

.bed-filter .inline-control .label{
  white-space:nowrap;
}

.bed-filter .switch{
  position:relative;
  display:block;
  width:44px;
  height:22px;
  flex:0 0 44px;

  background:rgba(17,17,17,.18);
  border-radius:0;
  cursor:pointer;
}

.bed-filter .switch::before{
  content:"";
  position:absolute;
  top:2px;
  left:2px;

  width:18px;
  height:18px;

  background:#fff;
  border-radius:0;
  transition:left .2s ease;
}

.bed-filter input[type="checkbox"].toggle{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

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

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

/* =========================
   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{
  width:100%;
  aspect-ratio:1 / 1;
  background-color:#fff;
  background-position:center;
  background-size:contain;
  background-repeat: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;
}
/* =========================
   FABRIC SWITCH — LIKE ORSO
   ========================= */

.fabric-select{
  width:100%;
  min-height:52px;
  padding:14px 16px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;

  background:var(--product-panel);
}

.fabric-select .fabric-more{
  appearance:none;
  margin:0;
  padding:0;
  border:0;
  background:transparent;

  color:var(--product-ink);
  font-family:var(--product-font);
  font-size:13px;
  line-height:1.2;
  font-weight:600;
  text-align:left;

  cursor:pointer;
}

/* Сам checkbox скрываем, но label-switch оставляем */

.fabric-select input.toggle{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  opacity:0 !important;
  overflow:hidden !important;
  pointer-events:none !important;
}

/* Видимый переключатель */

.fabric-select label.switch{
  position:relative !important;
  display:block !important;

  width:44px !important;
  min-width:44px !important;
  height:22px !important;
  flex:0 0 44px !important;

  margin:0 !important;
  padding:0 !important;

  border:0 !important;
  border-radius:0 !important;
  background:rgba(17,17,17,.18) !important;

  cursor:pointer;
}

/* Белый бегунок */

.fabric-select label.switch::before{
  content:"" !important;
  position:absolute !important;

  top:2px !important;
  left:2px !important;

  display:block !important;
  width:18px !important;
  height:18px !important;

  border-radius:0 !important;
  background:#fff !important;

  transition:left .2s ease !important;
}

/* Выбранная ткань */

.fabric-select input.toggle:checked + label.switch{
  background:var(--product-ink) !important;
}

.fabric-select input.toggle:checked + label.switch::before{
  left:24px !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;
  }

  .bed-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;
  }
}