.detail-page {
  background: #f4f8f6;
}

.detail-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 70px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  background: rgba(244, 248, 246, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(201, 214, 207, .72);
}

.detail-topbar .brand {
  color: var(--ink);
  text-decoration: none;
}

.detail-topbar .nav {
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.detail-topbar .nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.detail-topbar .nav a:hover {
  background: rgba(221, 200, 148, .2);
}

.detail-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 64px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  margin-bottom: 14px;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
  gap: 22px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.detail-gallery {
  display: block;
  min-width: 0;
  height: 100%;
}

.detail-main-image,
.photo-modal-panel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #102f36;
}

.detail-main-image {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 560px;
}

.detail-main-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #102f36;
}

.detail-image-count {
  position: absolute;
  left: 14px;
  bottom: 14px;
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(10, 33, 38, .78);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.detail-photo-cta {
  position: absolute;
  right: 14px;
  bottom: 14px;
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, .95);
  color: var(--primary);
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.detail-main-image::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, rgba(16, 47, 54, 0), rgba(16, 47, 54, .34));
  pointer-events: none;
}

.detail-image-count,
.detail-photo-cta,
.detail-nav {
  z-index: 2;
}

.detail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--primary);
  font-size: 30px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.detail-nav.prev { left: 12px; }
.detail-nav.next { right: 12px; }

.detail-thumbs {
  display: none;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0 0;
}

.detail-thumb {
  flex: 0 0 84px;
  height: 64px;
  border: 2px solid transparent;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.detail-thumb.active {
  border-color: var(--accent);
}

.detail-summary {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 4px 4px 4px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  position: sticky;
  top: 88px;
}

.detail-heading {
  display: grid;
  gap: 9px;
}

.detail-kicker {
  margin: 0;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.detail-status-row,
.detail-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.detail-code {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.detail-summary h1 {
  margin: 0;
  color: var(--ink);
  font-size: 31px;
  line-height: 1.13;
  letter-spacing: 0;
}

.detail-price-card {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  padding: 15px;
  border: 1px solid #d8c48f;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8e6, #fffdf8);
}

.detail-price-card > span {
  flex: 0 0 auto;
  color: #836727;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: right;
}

.detail-price {
  font-size: 32px;
}

.detail-usd {
  color: var(--muted);
  font-weight: 900;
}

.detail-location {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.4;
}

.detail-mini-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.detail-mini-fact {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfc;
}

.detail-mini-fact strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.detail-mini-fact span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.detail-assurance {
  display: grid;
  gap: 8px;
}

.detail-assurance div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.detail-assurance strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.detail-assurance span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.detail-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.detail-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  padding: 22px;
}

.photo-modal.open {
  display: grid;
  place-items: center;
}

.photo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 26, 30, .82);
}

.photo-modal-panel {
  width: min(1100px, 100%);
  height: min(760px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  z-index: 1;
}

.photo-modal-panel img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: #102f36;
}

.photo-modal-close,
.photo-modal-nav {
  position: absolute;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.photo-modal-close {
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  font-size: 28px;
  line-height: 1;
}

.photo-modal-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 30px;
}

.photo-modal-nav.prev { left: 14px; }
.photo-modal-nav.next { right: 14px; }

.photo-modal-footer {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fff;
}

.photo-modal-footer span {
  color: var(--ink);
  font-weight: 950;
}

.photo-modal-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.photo-modal-thumb {
  flex: 0 0 82px;
  height: 62px;
  border: 2px solid transparent;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.photo-modal-thumb.active {
  border-color: var(--accent);
}

@media (max-width: 1180px) {
  .detail-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
  }

  .detail-main-image {
    min-height: 500px;
  }

  .detail-summary h1 {
    font-size: 28px;
  }

  .detail-price-card {
    align-items: start;
    flex-direction: column;
  }

  .detail-price-card > span {
    text-align: left;
  }
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.detail-main {
  display: grid;
  gap: 18px;
}

.detail-section,
.detail-side-card,
.detail-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.detail-section,
.detail-side-card {
  padding: 18px;
}

.detail-section h2,
.detail-side-card h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.detail-section .sub,
.detail-side-card .sub {
  margin: 0 0 14px;
}

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

.detail-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfc;
}

.detail-item strong {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.detail-item span {
  display: block;
  margin-top: 4px;
  font-weight: 900;
  color: var(--ink);
}

.cost-box {
  border-radius: 8px;
  padding: 14px;
  background: #fff7e7;
  border: 1px solid #f0d9a6;
  line-height: 1.55;
}

.detail-tags {
  min-height: 42px;
}

.detail-side {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 88px;
}

.detail-checklist {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-checklist li {
  display: flex;
  gap: 8px;
  color: var(--ink);
  font-weight: 850;
}

.detail-checklist li::before {
  content: "✓";
  color: var(--accent-strong);
  font-weight: 950;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.related-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: inherit;
  text-decoration: none;
}

.related-card img {
  width: 128px;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  background: #dfe8e2;
}

.related-card strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.related-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.detail-empty {
  margin-top: 24px;
  padding: 26px;
  text-align: center;
}

@media (max-width: 1020px) {
  .detail-hero,
  .detail-body {
    grid-template-columns: 1fr;
  }

  .detail-summary,
  .detail-side {
    position: static;
  }

  .detail-summary {
    padding: 4px 2px 0;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .detail-shell {
    width: min(100% - 20px, 720px);
    padding-top: 12px;
  }

  .detail-topbar .nav {
    display: none;
  }

  .detail-gallery {
    display: block;
    min-height: 0;
  }

  .detail-main-image {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .detail-main-image img {
    object-fit: contain;
  }

  .detail-thumbs {
    display: flex;
  }

  .detail-summary h1 {
    font-size: 23px;
  }

  .detail-price {
    font-size: 26px;
  }

  .related-grid,
  .detail-actions,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-mini-facts {
    grid-template-columns: repeat(3, 1fr);
  }

  .detail-section,
  .detail-side-card,
  .detail-hero {
    padding: 14px;
  }

  .photo-modal {
    padding: 10px;
  }

  .photo-modal-panel {
    height: min(680px, calc(100vh - 20px));
  }
}

@media (max-width: 460px) {
  .detail-mini-facts {
    grid-template-columns: 1fr 1fr;
  }

  .related-card {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .related-card img {
    width: 104px;
    height: 78px;
  }
}
