.detail-header {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: 5rem;
}

.detail-header .detail-nav,
.detail-header .language-picker { justify-self: end; }

.detail-hero {
  position: relative;
  isolation: isolate;
  background: #101827;
}

.detail-hero-media,
.detail-hero.has-photo::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}

.detail-hero.has-photo::after {
  content: "";
  background:
    linear-gradient(90deg, #0a0d15f5 1%, #0a0d15cc 32%, #0a0d1533 74%),
    linear-gradient(0deg, #0a0d15e6, transparent 52%, #0a0d153b);
}

.detail-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-focus, 50% 48%);
}

.detail-hero.is-portrait .detail-hero-media { inset-inline-start: 37%; }
.detail-hero.is-portrait::after {
  background:
    linear-gradient(90deg, #101827 32%, #101827 37%, #10182745 64%, #10182714),
    linear-gradient(0deg, #0a0d15de, transparent 52%);
}

.detail-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(4rem, 12vw, 9rem);
  padding-block: 1.2rem clamp(2rem, 7vw, 5.4rem);
}

.has-photo .detail-hero-inner { min-height: clamp(28rem, 62svh, 38rem); }

.detail-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .38rem .85rem;
  border: 1px solid #ffffff65;
  border-radius: 999px;
  background: #0a0d15de;
  color: var(--paper);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 650;
}

.detail-back:hover,
.detail-catalog a:hover { text-decoration: underline; }

.detail-hero-copy { min-width: 0; }
.detail-hero h1,
.detail-layout h2 {
  font-family: var(--display);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.detail-hero h1 {
  max-width: 15ch;
  font-size: clamp(2.85rem, 6.7vw, 6.25rem);
  line-height: 1.01;
  text-wrap: balance;
}

.detail-hero p {
  max-width: 39ch;
  margin-top: 1rem;
  color: #f6eee5;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.detail-hero .experience-price {
  color: #ffe0ae;
  font-weight: 700;
}

.detail-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem 1.2rem;
  margin-top: 1.45rem;
}

.detail-gallery-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding-inline: .65rem;
  border-radius: .35rem;
  background: #0a0d15b0;
  color: var(--paper);
  font-weight: 650;
  text-underline-offset: .25em;
}

.detail-hero .agency-button > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.detail-page [hidden] { display: none; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, .56fr);
  grid-template-areas: "overview booking" "gallery gallery" "catalog catalog";
  align-items: start;
  gap: clamp(1.75rem, 4vw, 3.65rem) clamp(2rem, 6vw, 5.75rem);
  padding-block: clamp(2.1rem, 5.5vw, 4.65rem);
}

.detail-overview { grid-area: overview; }
.detail-booking { grid-area: booking; }
.detail-gallery { grid-area: gallery; }
.detail-catalog { grid-area: catalog; }
.detail-layout h2 {
  margin-bottom: .9rem;
  font-size: clamp(1.8rem, 3vw, 2.75rem);
  line-height: 1.12;
}

.detail-introduction {
  max-width: 62ch;
  font-size: clamp(1.05rem, 1.55vw, 1.2rem);
  line-height: 1.65;
}

.detail-itinerary-heading {
  margin-top: 1.35rem;
  color: var(--paper);
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 400;
}

.detail-overview h2::before,
.detail-gallery h2::before {
  display: block;
  width: 2.75rem;
  height: 2px;
  margin-bottom: .85rem;
  background: var(--accent);
  content: "";
}

.detail-itinerary,
.detail-highlights {
  margin: 1rem 0 0;
  padding-inline-start: 1.55rem;
}

.detail-itinerary li,
.detail-highlights li {
  padding: .65rem 0 .65rem .35rem;
  border-bottom: 1px solid var(--line);
}

.detail-layout li::marker {
  color: var(--accent);
  font-weight: 700;
}

.detail-facts { margin: 1.15rem 0 0; }
.detail-facts > div {
  padding: .8rem 1rem;
  border-inline-start: 2px solid #a68054;
  background: #121c2b;
}
.detail-facts > div + div { margin-top: .6rem; }
.detail-facts dt { color: var(--accent); font-weight: 700; }
.detail-facts dd { margin: .2rem 0 0; line-height: 1.55; }
.detail-layout p, .detail-facts dd { color: var(--muted); }
.detail-preparation { margin-top: 1.1rem; }
.detail-preparation a, .detail-catalog a { color: var(--accent); }

.detail-booking {
  padding: clamp(1rem, 2.7vw, 2rem);
  border: 1px solid #8e7154;
  border-radius: 1rem;
  background: linear-gradient(155deg, #1a2537, #111b2a 82%);
  box-shadow: 0 1rem 2.6rem #0003;
}

.detail-booking:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.detail-booking h2 { font-size: clamp(1.75rem, 2.65vw, 2.6rem); }
.detail-booking p { font-size: .9375rem; }
.detail-booking #cancellation-note { margin-block-start: .65rem; }
.detail-policy-link {
  display: block;
  width: fit-content;
  padding-block: .55rem;
  color: var(--accent);
  font-size: .9375rem;
  text-underline-offset: .2em;
}
.detail-booking form { margin-top: 1.2rem; }
.detail-booking :is(summary, .draft-copy):focus-visible,
.detail-draft h3:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: .9rem .7rem;
  margin-bottom: 1rem;
}

.detail-fields label {
  display: grid;
  min-width: 0;
  gap: .35rem;
  font-size: .875rem;
  font-weight: 700;
}

.detail-fields .wide-field { grid-column: 1 / -1; }

.detail-fields input,
.detail-fields textarea,
.draft-message {
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: .55rem .5rem;
  border: 1px solid #7c899e;
  border-radius: .35rem;
  background: #0a111e;
  color: var(--paper);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
}

.detail-fields textarea, .draft-message { resize: vertical; }
.detail-fields :is(input, textarea):focus-visible,
.draft-message:focus-visible,
.detail-booking button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.detail-booking .agency-button {
  justify-content: center;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
}

.detail-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1rem;
}
.detail-request-actions .agency-button { flex: 1 1 10rem; }
.detail-prepare { width: 100%; margin-top: .9rem; }

.detail-booking summary {
  align-content: center;
  min-height: 44px;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.detail-optional { margin: -.35rem 0 .75rem; }
.detail-optional .detail-fields { margin-top: .45rem; }
.detail-demo, .detail-draft {
  margin-top: 1.35rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}
.detail-demo p { margin-top: .3rem; }
.detail-draft h3 {
  margin-bottom: .45rem;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 400;
}
.detail-draft label {
  display: grid;
  gap: .35rem;
  margin-top: .9rem;
  font-size: .875rem;
  font-weight: 700;
}
.draft-copy {
  min-height: 44px;
  padding: .4rem .25rem;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}
.draft-status:not(:empty) { margin-top: .45rem; }
.demo-result:not(:empty) { margin-top: .95rem; color: var(--accent); }

.detail-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.45rem, 1.3vw, 1rem);
}

.detail-gallery-note { margin-bottom: .85rem; }

.gallery-thumbnail {
  position: relative;
  overflow: hidden;
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--navy);
  cursor: zoom-in;
}

.gallery-thumbnail::after {
  position: absolute;
  right: .48rem;
  bottom: .48rem;
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border: 1px solid #ffffff50;
  border-radius: 50%;
  background: #0a111ed9;
  color: #fff;
  content: "+";
  font: 1.1rem/1 system-ui;
}

.gallery-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

.gallery-thumbnail:focus-visible,
.gallery-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.gallery-open { overflow: hidden; }

.gallery-viewer {
  position: fixed;
  inset: 0;
  width: min(70rem, calc(100% - 1rem));
  height: min(56rem, calc(100dvh - 1rem));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: clamp(.55rem, 2vw, 1.1rem);
  border: 1px solid #8e7154;
  border-radius: .75rem;
  background: #101827;
  color: var(--paper);
}

.gallery-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: .5rem;
}

.gallery-viewer::backdrop { background: #080b12eb; }

.gallery-viewer-bar,
.gallery-viewer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
}

.gallery-viewer h2 {
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.75vw, 1.75rem);
  font-weight: 400;
}

.gallery-viewer-media {
  display: grid;
  place-items: center;
  min-height: 0;
  background: #080d17;
}

.gallery-viewer-media img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.gallery-button {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid #8e7154;
  border-radius: .35rem;
  background: #1a2537;
  color: var(--paper);
  font: 1.45rem/1 system-ui;
  cursor: pointer;
}

.gallery-button:hover { background: #273448; }

.gallery-status {
  color: var(--muted);
  font-size: .875rem;
  text-align: center;
  overflow-wrap: anywhere;
}

.detail-catalog a {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
}

.detail-catalog {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.4rem;
  padding-block: .45rem;
  border-block: 1px solid var(--line);
}

.detail-footer { border-top: 1px solid var(--line); }

@media (width > 1000px) {
  .detail-gallery-grid:has(> :nth-child(3):last-child, > :nth-child(6):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-gallery-grid:has(> :nth-child(5):last-child) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .detail-gallery-grid:has(> :nth-child(5):last-child) > .gallery-thumbnail {
    grid-column: span 2;
  }

  .detail-gallery-grid:has(> :nth-child(5):last-child) > .gallery-thumbnail:nth-child(-n+2) {
    grid-column: span 3;
  }

  .detail-gallery-grid:has(> :nth-child(5):last-child) > .gallery-thumbnail:nth-child(-n+2) img {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 1000px) {
  .detail-gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "booking" "overview" "gallery" "catalog";
  }
}

@media (max-width: 600px) {
  .detail-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .detail-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 .55rem;
    padding-block: .35rem .2rem;
  }
  .detail-header .agency-brand { justify-self: start; }
  .detail-header .agency-brand img { width: 3.35rem; }
  .detail-header .agency-brand strong { font-size: 1.45rem; }
  .detail-header .agency-brand small { font-size: .56rem; letter-spacing: .09em; }
  .detail-header .language-picker { grid-column: 2; grid-row: 1; font-size: .875rem; }
  .detail-header .detail-nav {
    grid-column: 1 / -1;
    justify-content: space-between;
    column-gap: .65rem;
    border-top: 1px solid var(--line);
    justify-self: stretch;
  }
  .detail-header .detail-nav a { font-size: .81rem; }

  .detail-hero.has-photo::after {
    background: linear-gradient(0deg, #0a0d15fa 3%, #0a0d15df 30%, #0a0d1580 58%, #0a0d151f 82%);
  }
  .has-photo .detail-hero-inner { min-height: 30rem; }
  .detail-hero-photo { object-position: var(--hero-mobile-focus, var(--hero-focus, 50% 48%)); }

  .detail-hero.is-portrait { --portrait-photo-height: clamp(21rem, 100vw, 28rem); }
  .detail-hero.is-portrait .detail-hero-media,
  .detail-hero.is-portrait::after {
    inset-inline-start: 0;
    bottom: auto;
    height: var(--portrait-photo-height);
  }
  .detail-hero.is-portrait::after {
    background: linear-gradient(0deg, #101827, #10182735 24%, transparent 55%);
  }
  .detail-hero.is-portrait .detail-hero-inner {
    justify-content: flex-start;
    gap: 0;
  }
  .detail-hero.is-portrait .detail-hero-copy {
    margin-top: calc(var(--portrait-photo-height) - 4.85rem);
  }
}

@media (max-width: 435px) {
  .detail-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 360px) {
  .detail-header .detail-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 .55rem;
  }
}
