:root {
  --cdmi-upgrade-ink: #211b17;
  --cdmi-upgrade-muted: #74695f;
  --cdmi-upgrade-paper: #fbf9f6;
  --cdmi-upgrade-card: #ffffff;
  --cdmi-upgrade-gold: #9b7340;
  --cdmi-upgrade-gold-dark: #79552a;
  --cdmi-upgrade-line: #e8dfd4;
  --cdmi-upgrade-success: #327a4c;
}

/* Home video: preserve text contrast without masking the showroom. */
.cdmi-hero-shade {
  background: linear-gradient(90deg, rgba(13, 10, 8, .55) 0%, rgba(13, 10, 8, .25) 40%, rgba(13, 10, 8, 0) 85%) !important;
}

.cdmi-guide-shell,
.cdmi-calculator-section {
  color: var(--cdmi-upgrade-ink);
  background: var(--cdmi-upgrade-paper);
  font-family: "Quicksand", sans-serif;
}

.cdmi-guide-shell *,
.cdmi-calculator-section * {
  box-sizing: border-box;
}

.cdmi-guide-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.cdmi-guide-hero {
  padding: clamp(78px, 10vw, 130px) 0 clamp(54px, 8vw, 92px);
  text-align: center;
  background: linear-gradient(180deg, #fff 0%, #f8f4ee 100%);
  border-bottom: 1px solid var(--cdmi-upgrade-line);
}

.cdmi-guide-kicker {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--cdmi-upgrade-gold-dark);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.cdmi-guide-hero h1,
.cdmi-guide-heading h2,
.cdmi-guide-heading h1 {
  margin: 0;
  color: var(--cdmi-upgrade-ink);
  font-weight: 500;
  letter-spacing: -.025em;
}

.cdmi-guide-hero h1 {
  font-size: clamp(2.15rem, 5vw, 4.6rem);
  line-height: 1.05;
}

.cdmi-guide-subtitle {
  max-width: 760px;
  margin: 18px auto 0;
  color: #493e36;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.cdmi-guide-intro {
  max-width: 820px;
  margin: 18px auto 0;
  color: var(--cdmi-upgrade-muted);
  line-height: 1.75;
}

.cdmi-guide-section {
  padding: clamp(54px, 8vw, 96px) 0;
}

.cdmi-guide-section + .cdmi-guide-section {
  border-top: 1px solid var(--cdmi-upgrade-line);
}

.cdmi-guide-heading {
  max-width: 760px;
  margin: 0 auto 34px;
  text-align: center;
}

.cdmi-guide-heading h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.8rem);
}

.cdmi-guide-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 3.5rem);
  line-height: 1.08;
}

.cdmi-guide-heading p {
  margin: 12px 0 0;
  color: var(--cdmi-upgrade-muted);
  line-height: 1.65;
}

.cdmi-space-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.cdmi-space-card,
.cdmi-style-card {
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--cdmi-upgrade-line);
  background: var(--cdmi-upgrade-card);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.cdmi-space-card:hover,
.cdmi-style-card:hover {
  transform: translateY(-3px);
  border-color: #cfb58f;
  box-shadow: 0 15px 34px rgba(67, 47, 30, .08);
}

.cdmi-space-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 28px;
  border: 1px solid #d9c5a7;
  border-radius: 50%;
  color: var(--cdmi-upgrade-gold-dark);
  font-size: 1rem;
}

.cdmi-space-card h3,
.cdmi-style-card h3 {
  margin: 0 0 9px;
  font-size: 1.02rem;
  font-weight: 600;
}

.cdmi-space-card p,
.cdmi-style-card p {
  margin: 0;
  color: var(--cdmi-upgrade-muted);
  line-height: 1.58;
}

.cdmi-calculator-section {
  padding: clamp(54px, 8vw, 86px) 0;
  background: #f1ebe3;
}

.cdmi-calculator-only-page {
  min-height: 70vh;
}

.cdmi-calculator-page {
  padding-top: clamp(34px, 5vw, 62px);
  padding-bottom: clamp(42px, 6vw, 72px);
}

.cdmi-calculator-page .cdmi-guide-heading {
  margin-bottom: 24px;
}

.cdmi-calculator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: stretch;
}

.cdmi-calculator-form,
.cdmi-calculator-results {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid #ddd0c1;
  background: #fff;
}

.cdmi-calculator-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.cdmi-field label {
  display: block;
  margin-bottom: 8px;
  color: #4f443b;
  font-size: .88rem;
  font-weight: 600;
}

.cdmi-field input,
.cdmi-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid #cfc1b2;
  border-radius: 4px;
  color: var(--cdmi-upgrade-ink);
  background: #fff;
  font: inherit;
  font-size: 1rem;
}

.cdmi-field input:focus,
.cdmi-field select:focus {
  outline: 2px solid rgba(155, 115, 64, .28);
  outline-offset: 1px;
  border-color: var(--cdmi-upgrade-gold);
}

.cdmi-field-error {
  display: block;
  min-height: 18px;
  margin-top: 5px;
  color: #9d392f;
  font-size: .76rem;
}

.cdmi-calculator-note {
  margin: 22px 0 0;
  padding: 14px 16px;
  border-left: 2px solid var(--cdmi-upgrade-gold);
  color: var(--cdmi-upgrade-muted);
  background: #fbf8f3;
  font-size: .86rem;
  line-height: 1.55;
}

.cdmi-calculator-results {
  display: grid;
  align-content: center;
  gap: 12px;
  background: #171411;
  color: #fff;
}

.cdmi-result-card {
  padding: 22px 0;
  border-bottom: 1px solid rgba(255,255,255,.16);
}

.cdmi-result-card:last-of-type { border-bottom: 0; }

.cdmi-result-label {
  display: block;
  margin-bottom: 8px;
  color: #cbb89f;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.cdmi-result-value {
  display: block;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  font-weight: 500;
  line-height: 1.1;
}

.cdmi-result-detail,
.cdmi-result-warning {
  margin: 7px 0 0;
  color: #d7cec5;
  font-size: .86rem;
  line-height: 1.5;
}

.cdmi-result-warning {
  padding: 12px;
  color: #f4dfbc;
  background: rgba(155, 115, 64, .18);
}

.cdmi-temperature-grid,
.cdmi-style-grid {
  display: grid;
  gap: 16px;
}

.cdmi-temperature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cdmi-style-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.cdmi-temperature-card {
  padding: 24px;
  border: 1px solid var(--cdmi-upgrade-line);
  background: #fff;
}

.cdmi-temperature-dot {
  display: block;
  width: 100%;
  height: 9px;
  margin-bottom: 22px;
  border-radius: 999px;
}

.cdmi-temperature-dot.warm { background: linear-gradient(90deg, #d88a35, #ffe7a8); }
.cdmi-temperature-dot.neutral { background: linear-gradient(90deg, #d7cec0, #fff); }
.cdmi-temperature-dot.cool { background: linear-gradient(90deg, #9bb9d1, #eef8ff); }

.cdmi-temperature-card strong { display: block; margin-bottom: 7px; }
.cdmi-temperature-card p { margin: 0; color: var(--cdmi-upgrade-muted); line-height: 1.55; }

.cdmi-guide-disclaimer {
  margin: 20px auto 0;
  max-width: 760px;
  color: var(--cdmi-upgrade-muted);
  font-size: .84rem;
  line-height: 1.55;
  text-align: center;
}

.cdmi-style-number {
  display: block;
  margin-bottom: 36px;
  color: var(--cdmi-upgrade-gold);
  font-size: .8rem;
  letter-spacing: .15em;
}

.cdmi-guide-cta {
  padding: clamp(56px, 8vw, 90px) 0;
  color: #fff;
  text-align: center;
  background: #171411;
}

.cdmi-guide-cta h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.7rem); font-weight: 500; }
.cdmi-guide-cta p { max-width: 680px; margin: 14px auto 26px; color: #d4c9bd; line-height: 1.65; }
.cdmi-guide-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.cdmi-guide-button,
.cdmi-share-product {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 20px;
  border: 1px solid var(--cdmi-upgrade-gold);
  border-radius: 4px;
  color: #fff;
  background: var(--cdmi-upgrade-gold-dark);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}

.cdmi-guide-button.secondary {
  color: #fff;
  background: transparent;
  border-color: rgba(255,255,255,.5);
}

/* Product-page additions reuse the real gallery, data and cart button. */
.cdmi-product-detail-grid {
  align-items: start;
}

.cdmi-product-information {
  min-width: 0;
}

body.cdmi-sticky-ready .cdmi-primary-purchase-controls {
  display: none !important;
}

@media (min-width: 1024px) {
  .cdmi-product-detail-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr) !important;
    gap: clamp(32px, 4vw, 64px) !important;
  }

  .cdmi-product-gallery {
    position: sticky;
    top: 96px;
  }

  .cdmi-product-information > * {
    max-width: 620px;
  }
}
.cdmi-product-reference {
  margin: -6px 0 13px;
  color: #81766d;
  font-size: .86rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cdmi-share-product {
  align-self: flex-start;
  min-height: 40px;
  margin: -8px 0 22px;
  padding: 8px 14px;
  color: #2d251f;
  background: transparent;
  border-color: #cbb18d;
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.cdmi-share-product svg { width: 17px; height: 17px; }
.cdmi-share-product:hover { color: #fff; border-color: #7f5a2f; background: #7f5a2f; }

.cdmi-size-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 22px;
  color: #765629;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cdmi-product-sticky-space { height: calc(var(--cdmi-sticky-height, 94px) + 12px); }

.cdmi-product-sticky-bar {
  position: fixed;
  z-index: 1200;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid #d9cec2;
  background: rgba(255, 253, 250, .97);
  box-shadow: 0 -10px 30px rgba(35, 26, 20, .11);
  backdrop-filter: blur(12px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

body.cdmi-cart-visible .cdmi-product-sticky-bar,
body.cdmi-sticky-suspended .cdmi-product-sticky-bar,
body.cdmi-mobile-keyboard-open .cdmi-product-sticky-bar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(105%);
}

body.cdmi-cart-visible .cdmi-product-sticky-space,
body.cdmi-sticky-suspended .cdmi-product-sticky-space,
body.cdmi-mobile-keyboard-open .cdmi-product-sticky-space { height: 0; }

.cdmi-product-sticky-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  min-height: 86px;
  margin: 0 auto;
  padding: 11px 0 calc(11px + env(safe-area-inset-bottom));
}

.cdmi-sticky-product {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: #211b17;
}

.cdmi-sticky-product img {
  width: 64px;
  height: 64px;
  border-radius: 5px;
  object-fit: cover;
}

.cdmi-sticky-name,
.cdmi-sticky-price { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdmi-sticky-name { font-weight: 600; }
.cdmi-sticky-price { margin-top: 3px; color: #77552b; font-size: .87rem; }

.cdmi-sticky-quantity {
  display: grid;
  grid-template-columns: 48px 58px 48px;
  height: 52px;
  border: 1px solid #cfc2b5;
  border-radius: 5px;
  overflow: hidden;
}

.cdmi-sticky-quantity button,
.cdmi-sticky-quantity input {
  border: 0;
  border-radius: 0;
  color: #211b17;
  background: #fff;
  font: inherit;
  text-align: center;
  font-size: 1rem;
}

.cdmi-sticky-quantity button { cursor: pointer; font-size: 1.25rem; }

.cdmi-sticky-quantity input { border-left: 1px solid #ded4ca; border-right: 1px solid #ded4ca; appearance: textfield; }
.cdmi-sticky-add {
  min-width: 250px;
  min-height: 54px;
  padding: 12px 30px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  background: #7f5a2f;
  font: inherit;
  font-weight: 700;
}

.cdmi-sticky-add:disabled { opacity: .55; }

.cdmi-share-toast {
  position: fixed;
  z-index: 1300;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 4px;
  color: #fff;
  background: #211b17;
  box-shadow: 0 8px 22px rgba(0,0,0,.2);
}

@media (max-width: 980px) {
  .cdmi-space-grid,
  .cdmi-style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cdmi-calculator { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .cdmi-guide-container { width: min(100% - 24px, 620px); }
  .cdmi-guide-section { padding: 48px 0; }
  .cdmi-space-grid,
  .cdmi-temperature-grid,
  .cdmi-style-grid { grid-template-columns: 1fr; }
  .cdmi-space-card,
  .cdmi-style-card { min-height: 0; }
  .cdmi-calculator-form,
  .cdmi-calculator-results { padding: 20px 16px; }
  .cdmi-calculator-fields { grid-template-columns: 1fr; gap: 12px; }
  .cdmi-product-sticky-space { height: calc(var(--cdmi-sticky-height, 68px) + 8px); }
  .cdmi-product-sticky-inner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    min-height: 60px;
    width: 100%;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }
  .cdmi-sticky-product { display: none; }
  .cdmi-sticky-quantity { grid-template-columns: 40px 44px 40px; height: 48px; }
  .cdmi-sticky-quantity input { min-width: 0; width: 44px; font-size: 16px; }
  .cdmi-sticky-add { min-width: 0; width: 100%; min-height: 48px; padding-inline: 10px; font-size: .92rem; }
  .cdmi-share-product { margin-bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .cdmi-space-card,
  .cdmi-style-card { transition: none; }
}
