#product-dialog .afs-detail-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 20px;
  background: #fff;
  border-bottom: 1px solid #d8d8d8;
}
#product-dialog .afs-detail-tabs button,
#product-dialog .afs-detail-ask,
#product-dialog .afs-related-controls button {
  background: #fff;
  color: #181818;
  border: 1px solid #a8a8a8;
  border-radius: 6px;
  min-height: 44px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}
#product-dialog .afs-detail-tabs [aria-selected="true"],
#product-dialog .afs-detail-ask {
  background: #181818;
  color: #fff;
  border-color: #181818;
}
#product-dialog [role="tabpanel"][hidden] { display: none !important; }
#product-dialog .afs-detail-finishes { padding: 20px; }
#product-dialog #detail-image { top: 146px; }
#product-dialog #detail-add { justify-self: start; min-height: 44px; }
#product-dialog .afs-detail-related-slot { grid-column: 1 / -1; margin-top: 12px; min-width: 0; }
#product-dialog .afs-related-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
#product-dialog .afs-related-header h3 { margin: 0; }
#product-dialog .afs-related-controls { display: flex; gap: 6px; }
#product-dialog .afs-related-controls button { min-width: 44px; }
#product-dialog .afs-related-row { overflow-x: auto; overscroll-behavior-x: contain; margin-top: 12px; }
#product-dialog .afs-related-track { position: relative; display: flex; gap: 12px; padding: 2px; }
#product-dialog .afs-related-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 max(158px, calc((100% - 40px) / 4));
  min-width: 0;
  padding: 8px;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
}
#product-dialog .afs-related-open { display: grid; gap: 8px; background: #fff; color: inherit; border: 0; padding: 0; font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
#product-dialog .afs-related-open img,
#product-dialog .afs-related-open .catalog-image-placeholder { width: 100%; height: 108px; object-fit: contain; }
#product-dialog .afs-related-card p { font-size: .82rem; margin: 6px 0 10px; }
#product-dialog .afs-related-card .catalog-add-button { margin-top: auto; min-height: 44px; }
#product-dialog .afs-detail-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
#product-dialog .afs-detail-swatches button { display: grid; gap: 5px; background: #fff; color: inherit; border: 1px solid #a8a8a8; border-radius: 4px; padding: 6px; font: inherit; font-size: .83rem; cursor: pointer; }
#product-dialog .afs-detail-swatches button[aria-pressed="true"] { border-color: #181818; box-shadow: inset 0 0 0 1px #181818; }
#product-dialog .afs-detail-swatches img { width: 100%; height: 62px; object-fit: cover; }
#product-dialog .afs-detail-swatch-caption { margin: 6px 0 10px; }
@media (max-width: 700px) {
  #product-dialog .afs-detail-tabs { padding: 6px 14px; }
  #product-dialog .afs-detail-tabs button { flex: 1; }
  #product-dialog .afs-detail-finishes { padding: 14px; }
  #product-dialog #detail-image { position: static; }
  #product-dialog .afs-related-card { flex-basis: max(140px, 49%); }
}
.catalog-card .afs-detail-product-name { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }

body:has(#product-dialog.afs-detail-page[open]) { overflow: visible; }
body:has(#product-dialog.afs-detail-page[open]) > main { display: none; }
#product-dialog.afs-catalog-product-dialog.afs-detail-page {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: 1320px;
  max-height: none;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  background: #fff;
}
#product-dialog.afs-detail-page .afs-catalog-popup-head {
  position: static;
  border: 0;
  padding: 14px 4% 12px;
}
#product-dialog.afs-detail-page .afs-catalog-popup-head h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#product-dialog.afs-catalog-product-dialog.afs-detail-page #detail-close {
  width: auto !important;
  white-space: nowrap;
  padding: 0 12px !important;
  font: inherit !important;
}
#product-dialog .afs-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-areas: "gallery identity" "gallery details";
  grid-template-rows: auto 1fr;
  column-gap: clamp(22px, 4vw, 56px);
  margin: 0 4%;
  padding: clamp(16px, 2.5vw, 32px);
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  background: #fafafa;
}
#product-dialog .afs-detail-hero { grid-area: gallery; min-width: 0; }
#product-dialog .afs-detail-identity { grid-area: identity; min-width: 0; }
#product-dialog .afs-detail-content { grid-area: details; min-width: 0; }
#product-dialog .afs-detail-identity #detail-brand { margin: 0; }
#product-dialog.afs-detail-page #detail-image {
  position: static;
  box-sizing: border-box;
  width: 100%;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid #d8d8d8;
  border-radius: 9px;
  background: #fff;
}
#product-dialog.afs-detail-page #detail-image > img,
#product-dialog.afs-detail-page #detail-image .afs-gallery-photo {
  display: block;
  width: 100%;
  height: clamp(270px, 34vw, 420px);
  max-height: none;
  object-fit: contain;
}
#product-dialog.afs-detail-page .afs-gallery-stage { height: auto; min-height: 0; overflow: hidden; border: 0; border-radius: 6px; background: #fff; }
#product-dialog.afs-detail-page [data-gallery-product="venue-astoria-sofa"] .afs-gallery-photo {
  transform: translateY(-10%) scale(1.55);
}
#product-dialog.afs-detail-page .afs-detail-tabs {
  margin: 12px 0 0;
  padding: 4px;
  background: #f5f5f5;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
}
#product-dialog.afs-detail-page .afs-detail-tabs button:not([aria-selected="true"]) {
  background: transparent;
  border-color: transparent;
}
#product-dialog.afs-detail-page .afs-catalog-product-body {
  display: block;
  padding: 0;
}
#product-dialog.afs-detail-page .afs-detail-actions { margin-top: 10px; }
#product-dialog .afs-detail-primary-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#product-dialog .afs-detail-primary-actions > button { margin: 0; min-height: 44px; }
#product-dialog .afs-detail-primary-actions > .afs-detail-ask {
  inline-size: var(--afs-overview-width, auto);
  min-height: var(--afs-overview-height, 44px);
}
#product-dialog.afs-detail-page #detail-title {
  display: block;
  font-size: clamp(29px, 4vw, 48px);
  line-height: 1.1;
  margin: 10px 0;
}
#product-dialog.afs-detail-page #detail-description { max-width: 56ch; line-height: 1.55; margin: 14px 0 10px; }
#product-dialog .afs-detail-dimensions { font-weight: 600; }
#product-dialog :is(.afs-detail-dimensions,.afs-detail-finish-summary):empty { display: none; }
#product-dialog.afs-detail-page #detail-resources { margin-top: 12px; }
#product-dialog.afs-detail-page #detail-resources > details > summary { cursor: pointer; padding: 12px 0; border-top: 1px solid #d8d8d8; }
#product-dialog.afs-detail-page .afs-catalog-popup-foot { position: static; padding-inline: 4%; }
#product-dialog.afs-detail-page .afs-detail-finishes { padding: 14px 0 0; }
#product-dialog.afs-detail-page .afs-detail-related-slot:not(:has(.afs-related-card)) { display: none; }
#product-dialog.afs-detail-page .afs-detail-related-slot {
  margin: 20px 4% 24px;
  padding: clamp(12px, 2vw, 24px);
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  background: #fafafa;
}
#product-dialog .afs-related-card { background: #fff; }
#product-dialog.afs-detail-page:has(#afs-detail-overview[hidden]) .afs-detail-related-slot { display: none; }
#product-dialog.afs-detail-page .afs-gallery-status { margin: 5px 0; }
#product-dialog.afs-detail-page .floor-gallery-zoom { margin: 0 0 6px auto; }
#product-dialog #detail-image.afs-product-gallery[data-gallery-kind="photos"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
}
#product-dialog [data-gallery-kind="photos"] :is(.afs-gallery-stage,.afs-gallery-credit) { grid-column: 1 / -1; }
#product-dialog [data-gallery-kind="photos"] .afs-gallery-thumbnails { grid-column: 1; grid-row: 2; margin: 0; }
#product-dialog [data-gallery-kind="photos"] .floor-gallery-zoom { grid-column: 2; grid-row: 2; margin: 0; }
#product-dialog [data-gallery-kind="photos"] .afs-gallery-status {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
@media (max-width: 700px) {
  #product-dialog .afs-detail-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "identity" "gallery" "details";
    grid-template-rows: auto;
    padding: 14px;
    row-gap: 10px;
  }
  #product-dialog.afs-detail-page #detail-image > img,
  #product-dialog.afs-detail-page #detail-image .afs-gallery-photo { height: min(56vw, 300px); }
  #product-dialog.afs-detail-page [data-gallery-product="venue-astoria-sofa"] .afs-gallery-photo {
    transform: translateY(-8%) scale(1.48);
  }
}
