.tour-detail-page {
  width: 100%;
  padding: 40px 0 40px 0;
  background: #f8fafc;
  color: #334155;
}

#main-content {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.tour-detail-container {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 28px;
}

.tour-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 20px;
}

.tour-detail-layout > * {
  min-width: 0;
}

.tour-detail-card {
  background: #fff;
  border: 1px solid #e8edf2;
  border-radius: 12px;
}

.tour-detail-main {
  padding: 28px;
}

.tour-detail-main > h2:first-child {
  margin: 0 0 20px;
  color: #172033;
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.tour-gallery-wrap {
  position: relative;
  margin-bottom: 28px;
}

.tour-gallery-grid {
  display: grid;
  grid-auto-columns: minmax(190px, 32%);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 1px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
  cursor: grab;
  user-select: none;
}

.tour-gallery-grid::-webkit-scrollbar {
  display: none;
}

.tour-gallery-grid.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.tour-gallery-item {
  position: relative;
  height: 184px;
  padding: 0;
  overflow: hidden;
  background: #f1f5f9;
  border: 0;
  border-radius: 9px;
  cursor: zoom-in;
  scroll-snap-align: start;
}

.tour-gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
  pointer-events: none;
  -webkit-user-drag: none;
}

.tour-gallery-item:hover img {
  transform: scale(1.035);
}

.tour-gallery-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  color: #334155;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 50%;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  line-height: 1;
  transform: translateY(-50%);
  transition:
    color 0.18s ease,
    background 0.18s ease,
    opacity 0.18s ease,
    transform 0.18s ease;
}

.tour-gallery-nav[hidden] {
  display: none;
}

.tour-gallery-nav svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tour-gallery-nav:hover {
  color: #fff;
  background: #2563eb;
  transform: translateY(-50%) scale(1.05);
}

.tour-gallery-nav:disabled {
  opacity: 0.38;
  cursor: default;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.tour-gallery-nav:disabled:hover {
  color: #334155;
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-50%);
}

.tour-gallery-nav.prev {
  left: -12px;
}

.tour-gallery-nav.next {
  right: -12px;
}

.tour-premium-heading {
  margin: 26px 0 12px;
  color: #172033;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
}

.tour-premium-heading .accent {
  color: #2563eb;
}

.has-accent-underline .accent {
  position: relative;
  display: inline-block;
  padding-bottom: 7px;
}

.has-accent-underline .accent::after {
  position: absolute;
  right: 8%;
  bottom: 1px;
  left: 8%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, #dce9fb 18%, #8bb4ed 50%, #dce9fb 82%, transparent 100%);
  content: "";
}

.tour-editor-content {
  color: #475569;
  font-size: 1rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.tour-editor-content > :first-child {
  margin-top: 0;
}

.tour-editor-content > :last-child {
  margin-bottom: 0;
}

.tour-editor-content h2,
.tour-editor-content h3,
.tour-editor-content h4 {
  margin: 1.25em 0 0.5em;
  color: #172033;
  line-height: 1.35;
}

.tour-editor-content img,
.tour-editor-content table {
  max-width: 100%;
}

.tour-editor-content img {
  height: auto;
  border-radius: 8px;
}

.tour-editor-content table {
  display: block;
  overflow-x: auto;
}

.tour-content-section {
  margin-top: 26px;
}

.tour-content-section > .tour-premium-heading {
  margin-bottom: 10px;
}

.tour-program-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tour-program-card,
.tour-info-panel,
.tour-note-box {
  padding: 16px;
  background: #fff;
  border: 1px solid #e8edf2;
  border-radius: 10px;
}

.tour-program-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tour-program-head h4 {
  margin: 0;
  color: #172033;
  font-size: 0.98rem;
  font-weight: 650;
}

.tour-program-day {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tour-program-list,
.tour-check-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: #526176;
  font-size: 0.92rem;
  line-height: 1.55;
}

.tour-info-grid {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.tour-info-grid.two-panels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tour-info-panel.is-muted {
  background: #fff7f6;
  border-color: #f4e2df;
}

.tour-info-panel:not(.is-muted) {
  background: #f2faf4;
  border-color: #dceee1;
}

.tour-info-panel:not(.is-muted) .tour-premium-heading .accent {
  color: #31805a;
}

.tour-info-panel:not(.is-muted) .tour-check-list {
  color: #456b52;
}

.tour-info-panel.is-muted .tour-premium-heading .accent {
  color: #bd6a62;
}

.tour-info-panel.is-muted .tour-check-list {
  color: #805e5a;
}

.tour-info-panel .tour-premium-heading,
.tour-note-box .tour-premium-heading {
  margin: 0;
  font-size: 1rem;
}

.tour-note-box {
  margin-top: 12px;
  background: #fffbeb;
  border-color: #fef0c7;
}

.tour-detail-sidebar {
  position: sticky;
  top: 18px;
  padding: 22px;
}

.tour-booking-title {
  margin: 0 0 18px;
  color: #172033;
  font-size: 1.25rem;
  font-weight: 700;
}

.tour-booking-title .accent {
  color: #2563eb;
}

.tour-booking-form {
  display: grid;
  gap: 14px;
}

.tour-booking-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.tour-booking-field {
  min-width: 0;
  grid-column: 1 / -1;
}

.tour-booking-field.half {
  grid-column: span 1;
}

.tour-booking-field label {
  display: block;
  margin-bottom: 6px;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
}

.tour-booking-field input,
.tour-booking-field select,
.tour-booking-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: #172033;
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
}

.tour-booking-field textarea {
  min-height: 82px;
  resize: vertical;
}

.tour-booking-field input:focus,
.tour-booking-field select:focus,
.tour-booking-field textarea:focus {
  border-color: #60a5fa;
  outline: 3px solid rgba(37, 99, 235, 0.12);
}

.tour-booking-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  grid-column: 1 / -1;
  padding: 12px 14px;
  background: #eff6ff;
  border-radius: 9px;
}

.tour-booking-total span {
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tour-booking-total strong {
  color: #1d4ed8;
  font-size: 1.3rem;
  font-weight: 750;
}

.tour-booking-submit {
  width: 100%;
  min-height: 46px;
  grid-column: 1 / -1;
  color: #fff;
  background: #2563eb;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  transition: background 0.15s ease;
}

.tour-booking-submit:hover {
  background: #1d4ed8;
}

.tour-booking-alert {
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 0.86rem;
  line-height: 1.5;
}

.tour-booking-alert.success {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.tour-booking-alert.error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.related-tour-heading {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #edf1f5;
}

.related-tour-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-top: 1px solid #edf1f5;
}

.related-tour-card img {
  width: 72px;
  height: 58px;
  object-fit: cover;
  background: #f1f5f9;
  border-radius: 7px;
}

.related-tour-card a {
  color: #334155;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.related-tour-card a:hover {
  color: #2563eb;
}

.tour-lightbox {
  position: fixed;
  z-index: 99999;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: rgba(2, 6, 23, 0.94);
}

.tour-lightbox.is-open {
  display: flex;
}

.tour-lightbox button[hidden] {
  display: none;
}

.tour-lightbox img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tour-lightbox button {
  position: absolute;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.tour-lightbox button:hover {
  background: rgba(255, 255, 255, 0.27);
}

.tour-lightbox-close {
  top: 18px;
  right: 18px;
}

.tour-lightbox-prev {
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
}

.tour-lightbox-next {
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
}

body.tour-lightbox-open {
  overflow: hidden;
}

@media (max-width: 991.98px) {
  .tour-detail-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
  }

  .tour-detail-main {
    padding: 22px;
  }

  .tour-detail-sidebar {
    padding: 18px;
  }
}

@media (max-width: 900px) {
  .tour-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tour-detail-sidebar {
    position: static;
  }
}

@media (max-width: 767.98px) {
  .tour-detail-page {
    padding: 8px 0 0;
  }

  .tour-detail-container {
    max-width: none;
    padding: 0 10px;
  }

  .tour-detail-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .tour-detail-main,
  .tour-detail-sidebar {
    padding: 18px 16px;
  }

  .tour-detail-sidebar {
    position: static;
  }

  .tour-gallery-grid {
    grid-auto-columns: 70%;
    gap: 9px;
  }

  .tour-gallery-item {
    height: 165px;
  }

  .tour-gallery-nav {
    width: 34px;
    height: 34px;
  }

  .tour-gallery-nav.prev {
    left: -8px;
  }

  .tour-gallery-nav.next {
    right: -8px;
  }

  .tour-program-grid,
  .tour-info-grid.two-panels {
    grid-template-columns: minmax(0, 1fr);
  }

  .tour-lightbox {
    padding: 48px 16px;
  }

  .tour-lightbox-prev {
    left: 8px;
  }

  .tour-lightbox-next {
    right: 8px;
  }
}
