/* V29 product detail layout. All selectors stay on product routes. */

body:has(.x-product-detail),
body:has(.konic-source-product),
body:has(.product-hero) {
  background: #fff !important;
}

/* Office: a broad gallery and an editorial information column on one surface. */
html[data-konic-context="office"] .extended-main:has(.x-product-detail) {
  max-width: 1440px;
  padding-left: clamp(20px, 2.5vw, 44px);
  padding-right: clamp(20px, 2.5vw, 44px);
  padding-bottom: 64px;
  background: #fff;
}

html[data-konic-context="office"] .x-product-detail {
  grid-template-columns: minmax(0, 1.48fr) minmax(350px, 1fr) !important;
  gap: clamp(24px, 3vw, 52px) !important;
  min-height: 0 !important;
  margin-top: 20px !important;
  align-items: start;
  background: #fff;
}

html[data-konic-context="office"] .x-product-gallery,
html[data-konic-context="office"] .x-product-info {
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
}

html[data-konic-context="office"] .x-product-gallery {
  grid-template-rows: minmax(0, auto) auto !important;
  overflow: visible !important;
}

html[data-konic-context="office"] .x-product-stage {
  height: clamp(500px, 48vw, 680px) !important;
  min-height: 0 !important;
  padding: clamp(18px, 2vw, 32px) !important;
  background: #fff !important;
}

html[data-konic-context="office"] .x-product-stage img,
html[data-konic-context="office"] .x-product-stage .x-source-main-image {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  padding: 0 !important;
  object-fit: contain !important;
}

html[data-konic-context="office"] .x-product-thumbs {
  height: auto !important;
  min-height: 0 !important;
  padding: 16px 0 0 !important;
  gap: 12px !important;
  border-top: 0 !important;
  background: #fff !important;
}

html[data-konic-context="office"] .x-product-thumb {
  height: 104px !important;
  border-color: #e4e2df !important;
  border-radius: 6px !important;
  background: #fff !important;
}

html[data-konic-context="office"] .x-product-thumb.is-active {
  border-color: #db151b !important;
}

html[data-konic-context="office"] .x-product-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start !important;
  align-self: stretch;
  padding: clamp(24px, 3vw, 46px) 0 24px !important;
  color: #1b1b1b !important;
}

html[data-konic-context="office"] .x-product-info::after { content: none !important; }
html[data-konic-context="office"] .x-product-info h1 {
  max-width: 100%;
  font-size: clamp(34px, 3.1vw, 49px) !important;
  line-height: 1.04 !important;
  letter-spacing: -.045em;
}
html[data-konic-context="office"] .x-product-model {
  margin-top: 18px;
  color: #6b6b6b !important;
}
html[data-konic-context="office"] .x-product-intro {
  margin: 26px 0 0;
  color: #545454 !important;
  font-size: 15px;
  line-height: 1.65;
}
html[data-konic-context="office"] .x-key-points {
  display: block;
  margin-top: 30px;
  border-top: 1px solid #dedede;
}
html[data-konic-context="office"] .x-key-points span,
html[data-konic-context="office"] .x-key-points span:nth-child(even) {
  display: block;
  min-height: 0;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid #dedede;
  color: #333;
  font-size: 13px;
}
html[data-konic-context="office"] .x-product-purchase {
  margin-top: auto !important;
  padding-top: 34px !important;
  color: #1b1b1b;
}
html[data-konic-context="office"] .x-product-price { color: #1b1b1b; }

html[data-konic-context="office"] .x-product-tabs.x-section {
  margin-top: 38px !important;
  overflow: visible;
  border-top: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
}
html[data-konic-context="office"] .x-tab-list {
  display: flex;
  justify-content: stretch;
  gap: 0;
  padding: 0;
  border-bottom: 0;
  background: #fff !important;
}
html[data-konic-context="office"] .x-tab-list button,
html[data-konic-context="office"] .x-tab-list button.is-active {
  flex: 1 1 0;
  min-height: 62px;
  padding: 0 12px;
  border-radius: 0;
  color: #6b6b6b !important;
  background: transparent !important;
  text-align: center;
}
html[data-konic-context="office"] .x-tab-list button.is-active {
  border-bottom: 2px solid #d71920;
  color: #d71920 !important;
}
html[data-konic-context="office"] .x-tab-panels,
html[data-konic-context="office"] .x-detail-panel {
  border: 0;
  border-radius: 0;
  background: #fff !important;
}
html[data-konic-context="office"] .x-detail-panel {
  max-width: 1120px;
  min-height: 0 !important;
  padding: 30px 0 52px !important;
  gap: 22px !important;
}
html[data-konic-context="office"] .x-detail-panel h2 {
  font-size: clamp(27px, 2.4vw, 38px);
}
html[data-konic-context="office"] .x-detail-panel p,
html[data-konic-context="office"] .x-detail-panel li {
  font-size: 14px;
  line-height: 1.75;
}
html[data-konic-context="office"] .x-source-file {
  padding-left: 0;
  padding-right: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
}

/* Home source-product pages keep their warmer typography and softer rhythm. */
.konic-source-product {
  width: min(1440px, calc(100% - 48px));
  margin-top: 20px;
  color: #211d19;
}
.konic-source-product__hero {
  grid-template-columns: minmax(0, 1.48fr) minmax(350px, 1fr);
  gap: clamp(24px, 3vw, 52px);
  align-items: start;
}
.konic-source-product__gallery,
.konic-source-product__copy,
.konic-source-product__tabs {
  min-height: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}
.konic-source-product__gallery { grid-template-rows: minmax(0, auto) auto; }
.konic-source-product__stage {
  height: clamp(360px, calc(100svh - 300px), 680px);
  padding: clamp(18px, 2vw, 32px);
}
.konic-source-product__stage img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.konic-source-product__thumbs {
  min-height: 0;
  padding: 16px 0 0;
  gap: 12px;
  border-top: 0;
  background: #fff;
}
.konic-source-product__thumb {
  height: 104px;
  border-color: #e5e0d8;
  border-radius: 6px;
}
.konic-source-product__copy {
  align-self: stretch;
  padding: clamp(24px, 3vw, 46px) 0 24px;
  color: #211d19;
}
.konic-source-product__copy::after { content: none; }
.konic-source-product__copy h1 {
  max-width: 100%;
  font-size: clamp(34px, 3.1vw, 49px);
  line-height: 1.08;
}
.konic-source-product__model { color: #766f68; }
.konic-source-product__description { color: #5e5750; font-size: 15px; line-height: 1.65; }
.konic-source-product__features {
  display: block;
  margin-top: 30px;
  border-top: 1px solid #e4ded5;
}
.konic-source-product__features li,
.konic-source-product__features li:nth-child(odd),
.konic-source-product__features li:nth-child(even) {
  min-height: 0;
  padding: 12px 0;
  border-right: 0;
  border-bottom: 1px solid #e4ded5;
  color: #3a332d;
}
.konic-source-product__purchase { padding-top: 34px; }
.konic-source-product__price small { color: #796f66; }
.konic-source-product__tabs {
  margin-top: 38px;
  border-top: 0;
}
.konic-source-product__tab-list {
  display: flex;
  gap: 0;
  border-bottom: 0;
}
.konic-source-product__tab-list button,
.konic-source-product__tab-list button.is-active {
  flex: 1 1 0;
  min-height: 62px;
  padding: 0 12px;
  color: #746c64;
  background: transparent;
  text-align: center;
}
.konic-source-product__tab-list button.is-active {
  border-bottom: 2px solid #ed1c24;
  color: #ed1c24;
}
.konic-source-product__panel { padding: 30px 0 52px; }
.konic-source-product__panel > h2 { display: block; margin: 0; font-size: clamp(27px, 2.4vw, 38px); }
.konic-source-product__panel p { font-size: 15px; line-height: 1.75; }
.konic-source-product__file {
  padding-left: 0;
  padding-right: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
}

/* Home's fallback detail template follows the same white, open layout. */
body:has(.product-hero) .product-hero {
  grid-template-columns: minmax(0, 1.48fr) minmax(350px, 1fr);
  min-height: 0;
  background: #fff;
}
body:has(.product-hero) .product-stage {
  min-height: clamp(500px, 48vw, 680px);
  background: #fff;
}
body:has(.product-hero) .product-stage::after { content: none; }
body:has(.product-hero) .product-stage img { width: 88%; height: 88%; }
body:has(.product-hero) .product-detail-copy {
  justify-content: flex-start;
  padding: clamp(32px, 4vw, 64px) clamp(24px, 3vw, 48px);
}
body:has(.product-hero) .product-detail-copy h1 { font-size: clamp(34px, 3.1vw, 49px); }
body:has(.product-hero) .product-notes { padding: 36px 0 72px; background: #fff; }
body:has(.product-hero) .detail-panels { gap: 0; border-top: 1px solid #e4ded5; }
body:has(.product-hero) .detail-panel {
  min-height: 0;
  padding: 26px 22px 28px 0;
  border: 0;
  border-bottom: 1px solid #e4ded5;
  border-radius: 0;
  background: #fff;
}
body:has(.product-hero) .detail-panel h2 { margin-top: 18px; }

@media (max-width: 900px) {
  html[data-konic-context="office"] .x-product-detail,
  .konic-source-product__hero,
  body:has(.product-hero) .product-hero {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html[data-konic-context="office"] .x-product-stage,
  .konic-source-product__stage { height: min(72vw, 560px) !important; min-height: 0 !important; }
  html[data-konic-context="office"] .x-product-info,
  .konic-source-product__copy { padding-top: 18px !important; }
  body:has(.product-hero) .product-stage { min-height: min(72vw, 560px); }
}

@media (max-width: 620px) {
  html[data-konic-context="office"] .extended-main:has(.x-product-detail) { padding-left: 16px; padding-right: 16px; }
  html[data-konic-context="office"] .x-product-detail { gap: 14px !important; margin-top: 12px !important; }
  html[data-konic-context="office"] .x-product-stage,
  .konic-source-product__stage { height: min(88vw, 410px) !important; padding: 8px !important; }
  html[data-konic-context="office"] .x-product-thumb,
  .konic-source-product__thumb { height: 78px !important; }
  html[data-konic-context="office"] .x-product-info,
  .konic-source-product__copy { min-height: 0 !important; padding: 18px 0 24px !important; }
  html[data-konic-context="office"] .x-product-info h1,
  .konic-source-product__copy h1 { font-size: clamp(30px, 8vw, 42px) !important; }
  html[data-konic-context="office"] .x-product-tabs.x-section,
  .konic-source-product__tabs { margin-top: 24px !important; }
  html[data-konic-context="office"] .x-tab-list,
  .konic-source-product__tab-list { gap: 22px; overflow-x: auto; white-space: nowrap; }
  html[data-konic-context="office"] .x-detail-panel,
  .konic-source-product__panel { padding: 24px 0 42px !important; }
  .konic-source-product { width: calc(100% - 32px); }
  body:has(.product-hero) .product-stage { min-height: min(88vw, 410px); }
  body:has(.product-hero) .product-detail-copy { padding: 20px 18px 36px; }
  body:has(.product-hero) .detail-panel { padding-right: 0; }
}
html[data-konic-context="home"] .konic-source-product__cta.is-unavailable:disabled,
.konic-source-product__cta.is-unavailable:disabled {
  background: #aaa6a2 !important;
  border-color: #aaa6a2 !important;
  color: #fff !important;
  cursor: not-allowed;
  box-shadow: none !important;
}
