/* SCREEN 03 product detail presentation. Existing product, pricing and cart logic stays in app.js. */

/* Shared customer-facing legibility tokens. Layout is intentionally untouched. */
body .site-header .primary-nav .nav-inner button,
body .site-header .header-category-nav button { font-weight: 650 !important; }
.breadcrumb,
.breadcrumb button { color: #54483f; font-weight: 600; }
.category-filter,
.check-filter,
.catalog-toolbar label,
.product-page label { color: #3f342c; font-weight: 600; }

body:has(#product.active) {
  background:
    radial-gradient(circle at 50% 0, rgba(210, 167, 104, .14), transparent 34rem),
    #33281f;
  color: #20150f;
}

body:has(#product.active) .announcement-bar { display: none; }

body:has(#product.active) .site-header {
  position: relative;
  inset: auto;
  z-index: 30;
  width: min(1340px, calc(100% - 16px));
  min-height: 58px;
  margin: 8px auto 0;
  border: 0;
  border-radius: 17px 17px 0 0;
  background: linear-gradient(100deg, #26180f, #160f0a 68%, #21150e);
  box-shadow: 0 18px 50px rgba(10, 6, 4, .22);
}

body:has(#product.active) .site-header .header-main {
  width: 100%;
  max-width: none;
  min-height: 58px;
  padding: 0 20px;
  gap: 12px;
}

body:has(#product.active) .brand-button { min-width: 184px; padding: 0; color: #f7d79c; text-align: left; }
body:has(#product.active) .brand-button img { width: 35px; height: 35px; border: 0; background: transparent; object-fit: contain; }
body:has(#product.active) .brand-copy strong {
  color: #f4d18f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .035em;
  text-transform: uppercase;
}
body:has(#product.active) .brand-copy small { color: rgba(255, 246, 229, .82); font-size: 8px; font-weight: 550; }
body:has(#product.active) .primary-nav { position: static; margin-left: auto; background: transparent; box-shadow: none; }
body:has(#product.active) .primary-nav .nav-inner { display: flex; align-items: center; gap: 2px; }
body:has(#product.active) .primary-nav button,
body:has(#product.active) .header-category-nav button {
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  color: rgba(255, 249, 238, .94);
  background: transparent;
  font-size: 10px;
  font-weight: 650;
}
body:has(#product.active) .primary-nav button:hover,
body:has(#product.active) .primary-nav button.is-active { color: #f1bd61; background: transparent; }
body:has(#product.active) .header-category-nav { display: none; }

body:has(#product.active) .header-search { width: 38px; min-width: 38px; height: 38px; border: 0; background: transparent; overflow: hidden; }
body:has(#product.active) .header-search input,
body:has(#product.active) .search-label { display: none; }
body:has(#product.active) .header-search:hover,
body:has(#product.active) .header-search:focus-within,
body:has(#product.active) .header-search.is-open { width: 178px; min-width: 178px; border: 1px solid rgba(255, 246, 229, .22); border-radius: 6px; }
body:has(#product.active) .header-search:hover input,
body:has(#product.active) .header-search:focus-within input,
body:has(#product.active) .header-search.is-open input { display: block; min-width: 0; padding-left: 9px; color: #fff8ed; background: transparent; font-size: 10px; }
body:has(#product.active) .header-search button { width: 38px; min-width: 38px; height: 38px; padding: 0; border: 0; color: #fff8ed; background: transparent; font-size: 22px; }
body:has(#product.active) .header-actions { gap: 2px; }
body:has(#product.active) .header-action { width: 38px; min-width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; color: #fff8ed; background: transparent; }
body:has(#product.active) .header-action > span:not(.action-icon) { display: none; }
body:has(#product.active) .header-action .action-icon { font-size: 20px; }

body:has(#product.active) #product {
  width: min(1340px, calc(100% - 16px));
  margin: 0 auto 34px;
  padding: 0;
  border-radius: 0 0 17px 17px;
  overflow: clip;
  background: linear-gradient(105deg, #fffaf2, #f7efe3 68%, #fffaf3);
  box-shadow: 0 28px 70px rgba(10, 6, 4, .24);
}

body:has(#product.active) #product > .shell { width: 100%; max-width: none; padding: 17px 20px 32px; }
body:has(#product.active) .product-page .breadcrumb { margin: 0 0 13px; color: #5f554c; font-size: 9px; }

body:has(#product.active) .product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .72fr);
  gap: 38px;
  align-items: start;
}

body:has(#product.active) .product-gallery { position: relative; display: grid; grid-template-columns: 1fr; gap: 9px; }
body:has(#product.active) .product-detail-flags { position: absolute; z-index: 2; top: 9px; right: 9px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; pointer-events: none; }
body:has(#product.active) .product-detail-flags span { padding: 5px 8px; border-radius: 4px; color: #fff; background: #b87823; box-shadow: 0 3px 8px rgba(39, 23, 13, .16); font-size: 9px; font-weight: 700; }
body:has(#product.active) .product-detail-flags .discount { background: #e6422c; }
body:has(#product.active) .product-detail-flags .dealer { background: #2f5d49; }
body:has(#product.active) .product-main-image {
  grid-row: 1;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8c9b7;
  border-radius: 7px;
  background: #eee5da;
}
body:has(#product.active) .product-main-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
body:has(#product.active) .product-detail-gallery { grid-row: 2; display: flex; gap: 7px; overflow-x: auto; padding: 0 0 2px; }
body:has(#product.active) .product-thumb { flex: 0 0 auto; width: 68px; height: 58px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 5px; background: #eee5da; }
body:has(#product.active) .product-thumb img { width: 100%; height: 100%; object-fit: cover; }
body:has(#product.active) .product-thumb.is-active { border-color: #ae752e; box-shadow: 0 0 0 1px rgba(174, 117, 46, .2); }

body:has(#product.active) .product-info { position: static; padding: 3px 0 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
body:has(#product.active) .product-category { display: inline-flex; margin: 0 0 7px; color: #8b5c20; font-size: 9px; font-weight: 700; letter-spacing: .03em; text-transform: none; }
body:has(#product.active) .product-info h1 {
  max-width: 20ch;
  margin: 0 0 14px;
  color: #17100c;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(25px, 2.15vw, 32px);
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: -.025em;
}
body:has(#product.active) .product-code { display: none; }
body:has(#product.active) .product-description { display: -webkit-box; max-width: 45ch; margin: 0; overflow: hidden; color: #4f453d; font-size: 12px; line-height: 1.62; font-weight: 500; white-space: pre-line; -webkit-line-clamp: 6; -webkit-box-orient: vertical; }
body:has(#product.active) .product-detail-price { margin: 20px 0 0; }
body:has(#product.active) .product-detail-price .price { color: #17100c; font-family: Arial, Helvetica, sans-serif; font-size: 29px; line-height: 1.1; font-weight: 800; }
body:has(#product.active) .product-detail-price .price-unavailable { color: #675d55; font-size: 13px; font-weight: 650; }
body:has(#product.active) .product-cta { width: 100%; min-height: 42px; margin-top: 18px; border-radius: 5px; }

body:has(#product.active) .product-config-panel { margin-top: 17px; padding-top: 14px; border-top: 1px solid rgba(103, 74, 49, .2); }
body:has(#product.active) .product-config-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 10px; }
body:has(#product.active) .product-config-heading h2 { margin: 0; color: #22170f; font-size: 14px; line-height: 1.2; font-weight: 750; }
body:has(#product.active) .customization-summary { margin: 0; color: #5f5146; font-size: 9px; }
body:has(#product.active) .customization-summary > strong { display: none; }
body:has(#product.active) .customization-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
body:has(#product.active) .customization-chips span { padding: 3px 5px; border-radius: 3px; color: #5c4732; background: #eadbc5; font-size: 8px; font-weight: 650; }
body:has(#product.active) .product-chosen-support,
body:has(#product.active) .order-preview-support { display: none !important; }

body:has(#product.active) .product-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
body:has(#product.active) .option-group { margin: 0; border: 0; border-radius: 0; overflow: visible; background: transparent; }
body:has(#product.active) .option-group:has(textarea) { grid-column: 1 / -1; }
body:has(#product.active) .option-group details { height: 100%; }
body:has(#product.active) .option-group summary { padding: 0 0 6px; color: #3f342c; cursor: default; font-size: 10px; font-weight: 700; }
body:has(#product.active) .option-group summary::after { display: none; }
body:has(#product.active) .option-choices { padding: 0; border: 0; }
body:has(#product.active) .option-choices textarea,
body:has(#product.active) .option-select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d6c8b8;
  border-radius: 5px;
  color: #2e251f;
  background: rgba(255, 253, 249, .82);
  font-size: 10px;
  font-weight: 550;
}
body:has(#product.active) .option-choices textarea { height: 40px; min-height: 40px; resize: vertical; }
body:has(#product.active) .option-select[multiple] { min-height: 94px; }
body:has(#product.active) .option-select-footer { margin-top: 4px; }
body:has(#product.active) .option-select-hint { color: #63584f; font-size: 8px; font-weight: 500; }
body:has(#product.active) .clear-option-selection { padding: 3px 5px; border: 0; color: #735a40; background: transparent; font-size: 8px; font-weight: 650; text-decoration: underline; }

body:has(#product.active) .product-purchase-row { display: grid; grid-template-columns: auto minmax(130px, .45fr) minmax(240px, .85fr); gap: 14px; align-items: end; margin-top: 14px; }
body:has(#product.active) .quantity-field { display: grid; gap: 5px; margin: 0; color: #3c3028; font-size: 10px; font-weight: 700; }
body:has(#product.active) .quantity-input { display: grid; grid-template-columns: 36px 56px 36px; width: max-content; border: 1px solid #d3c4b0; border-radius: 5px; overflow: hidden; }
body:has(#product.active) .quantity-input button { width: 36px; min-height: 38px; padding: 0; color: #2b211b; background: #fffdf9; font-size: 16px; }
body:has(#product.active) .quantity-input input { width: 56px; min-height: 38px; padding: 5px; border: 0; border-inline: 1px solid #d3c4b0; border-radius: 0; background: #fffdf9; text-align: center; font-size: 11px; font-weight: 650; }
body:has(#product.active) .quantity-field small { max-width: 150px; color: #62574e; font-size: 8px; font-weight: 500; }
body:has(#product.active) .product-live-total { display: block; min-width: 0; margin: 0; padding: 0; border-radius: 0; background: transparent; }
body:has(#product.active) .product-live-total .product-subtotal-line { display: none; }
body:has(#product.active) .product-live-total .grand-total { display: grid; gap: 2px; padding: 0; border: 0; }
body:has(#product.active) .product-live-total .grand-total span { color: #62574e; font-size: 8px; font-weight: 600; }
body:has(#product.active) .product-live-total .grand-total strong { color: #21150e; font-size: 18px; font-weight: 800; }
body:has(#product.active) .product-add-button { width: 100%; min-height: 40px; padding: 8px 16px; border-radius: 5px; color: #fff; background: #17110d; font-size: 11px; font-weight: 700; }
body:has(#product.active) .product-add-button:hover { background: #3b281d; }
body:has(#product.active) #status { min-height: 15px; margin: 6px 0 0; font-size: 9px; }

body:has(#product.active) .product-accordions { margin-top: 12px; border-top: 1px solid rgba(103, 74, 49, .2); }
body:has(#product.active) .product-accordions details { border-bottom: 1px solid rgba(103, 74, 49, .16); }
body:has(#product.active) .product-accordions summary { display: flex; align-items: center; justify-content: space-between; min-height: 38px; padding: 0; color: #352a22; cursor: pointer; list-style: none; font-size: 10px; font-weight: 700; }
body:has(#product.active) .product-accordions summary::-webkit-details-marker { display: none; }
body:has(#product.active) .product-accordions summary::after { content: "⌄"; font-size: 14px; transition: transform .18s; }
body:has(#product.active) .product-accordions details[open] summary::after { transform: rotate(180deg); }
body:has(#product.active) .product-accordions > details > p { margin: 0; padding: 0 0 12px; color: #51463e; font-size: 10px; line-height: 1.55; white-space: pre-line; }
body:has(#product.active) .product-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0 0 12px; }
body:has(#product.active) .product-meta-grid div { padding: 8px 10px; border: 1px solid #ded1c1; border-radius: 4px; background: rgba(255, 253, 249, .66); }
body:has(#product.active) .product-meta-grid span { color: #64594f; font-size: 8px; font-weight: 550; }
body:has(#product.active) .product-meta-grid strong { margin-top: 2px; color: #2f251f; font-size: 10px; }
body:has(#product.active) .product-assurances { display: flex; gap: 18px; margin-top: 12px; padding: 10px 0 0; border: 0; }
body:has(#product.active) .product-assurances p { margin: 0; color: #5a4f46; font-size: 8px; font-weight: 550; }
body:has(#product.active) .product-assurances span { color: #8a642b; }
body:has(#product.active) #relatedProductsSection { margin-top: 30px; }
body:has(#product.active) .site-footer { display: none; }

/* Product photo lightbox: the whole source image stays visible without scroll/crop. */
body:has(#product.active) .image-preview-dialog {
  box-sizing: border-box;
  width: min(94vw, 1200px);
  height: min(92vh, 1000px);
  max-width: none;
  max-height: none;
  padding: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #241b16;
}
body:has(#product.active) .image-preview-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
body:has(#product.active) .image-preview-dialog img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(min(94vw, 1200px) - 24px);
  max-height: calc(min(92vh, 1000px) - 24px);
  object-fit: contain;
  border-radius: 7px;
  background: #f6f1e9;
}

body:has(#product.active) .product-main-image:focus-visible,
body:has(#product.active) .product-thumb:focus-visible,
body:has(#product.active) .product-add-button:focus-visible,
body:has(#product.active) .option-select:focus-visible,
body:has(#product.active) .option-choices textarea:focus-visible,
body:has(#product.active) .quantity-input button:focus-visible,
body:has(#product.active) .quantity-input input:focus-visible { outline: 2px solid #b87c2d; outline-offset: 2px; }

@media (max-width: 1100px) {
  body:has(#product.active) .site-header,
  body:has(#product.active) #product { width: min(100% - 20px, 1040px); }
  body:has(#product.active) .primary-nav { display: none; }
  body:has(#product.active) .mobile-menu-toggle { display: inline-flex; color: #fff8ed; }
  body:has(#product.active) .brand-button { min-width: 0; margin-right: auto; }
  body:has(#product.active) .product-detail { grid-template-columns: minmax(0, 1fr) minmax(320px, .78fr); gap: 24px; }
  body:has(#product.active) .product-main-image { height: auto; }
  body:has(#product.active) .product-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  body:has(#product.active) .site-header { width: 100%; margin: 0; border-radius: 0; }
  body:has(#product.active) #product { width: 100%; margin: 0; border-radius: 0; }
  body:has(#product.active) #product > .shell { padding: 14px 14px 28px; }
  body:has(#product.active) .product-detail { grid-template-columns: 1fr; gap: 16px; }
  body:has(#product.active) .product-gallery { min-width: 0; }
  body:has(#product.active) .product-main-image { height: auto; }
  body:has(#product.active) .product-info h1 { max-width: none; font-size: 25px; }
  body:has(#product.active) .product-options { grid-template-columns: 1fr; }
  body:has(#product.active) .product-purchase-row { grid-template-columns: auto 1fr; }
  body:has(#product.active) .product-add-button { grid-column: 2; }
  body:has(#product.active) .product-assurances { flex-direction: column; gap: 6px; }
}

@media (max-width: 430px) {
  body:has(#product.active) .site-header .header-main { min-height: 58px; padding: 0 12px; gap: 6px; }
  body:has(#product.active) #dealerLoginOpen { display: none; }
  body:has(#product.active) .brand-copy { display: flex !important; }
  body:has(#product.active) .brand-copy strong { font-size: 13px; }
  body:has(#product.active) .brand-copy small { font-size: 7px; }
  body:has(#product.active) .brand-button img { width: 31px; height: 31px; }
  body:has(#product.active) .header-search,
  body:has(#product.active) .header-search button,
  body:has(#product.active) .header-action { width: 34px; min-width: 34px; height: 34px; }
  body:has(#product.active) .product-page .breadcrumb { font-size: 8px; }
  body:has(#product.active) .product-main-image { height: auto; }
  body:has(#product.active) .product-thumb { width: 54px; height: 47px; }
  body:has(#product.active) .product-info h1 { font-size: 22px; }
  body:has(#product.active) .product-description { font-size: 10px; -webkit-line-clamp: 5; }
  body:has(#product.active) .product-detail-price .price { font-size: 24px; }
  body:has(#product.active) .product-config-heading { display: block; }
  body:has(#product.active) .customization-summary { margin-top: 6px; }
  body:has(#product.active) .customization-chips { justify-content: flex-start; }
  body:has(#product.active) .product-purchase-row { grid-template-columns: auto 1fr; gap: 9px; }
  body:has(#product.active) .product-live-total { align-self: center; }
  body:has(#product.active) .product-add-button { grid-column: 1 / -1; }
  body:has(#product.active) .product-meta-grid { grid-template-columns: 1fr; }
  body:has(#product.active) .image-preview-dialog { width: 96vw; height: 88vh; padding: 8px; }
  body:has(#product.active) .image-preview-dialog img {
    max-width: calc(96vw - 16px);
    max-height: calc(88vh - 16px);
  }
}
