html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

main {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

:root {
  --gold: #c9a646;
  --emerald: #0f3d36;
  --sand: #f7f4ef;
  --charcoal: #121212;
}

/* Tour header green background – match home header height, only change colors */
.tour-header {
  background: rgba(15, 61, 54, 0.95) !important;
  border-bottom: 1px solid rgba(201, 166, 70, 0.2);
}

.tour-header .logo-name,
.tour-header .main-nav a:not(.nav-book-btn) {
  color: #fff !important;
}

.tour-header .logo-tagline {
  color: rgba(201, 166, 70, 0.9) !important;
}

.tour-header .menu-toggle {
  color: #fff;
}

/* Ensure menu toggle is clickable on mobile */
@media (max-width: 992px) {
  .tour-header .menu-toggle {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 1002;
    color: #fff;
    background: rgba(201, 166, 70, 0.2) !important;
    border: 1px solid rgba(201, 166, 70, 0.5) !important;
  }
  
  .tour-header .menu-toggle:hover,
  .tour-header .menu-toggle:active {
    background: rgba(201, 166, 70, 0.3) !important;
  }
  
  .tour-header .menu-toggle .menu-icon,
  .tour-header .menu-toggle .menu-icon-close {
    pointer-events: none;
    color: #fff;
  }
  
  .tour-header .main-nav {
    background: rgba(15, 61, 54, 0.98);
  }
  
  .tour-header .main-nav a:not(.mobile-logo):not(.nav-book-btn) {
    color: #fff;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes growX {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.fade-up {
  animation: fadeUp 800ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.grow-x {
  transform-origin: left;
  animation: growX 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .fade-up,
  .grow-x {
    animation: none !important;
  }
}

/* Hero section - completely remade */
.dambulla-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0;
  margin-top: 0;
  overflow: hidden;
  min-height: 35vh;
}

/* Mobile: remove all top spacing to touch header */
@media (max-width: 639px) {
  body {
    margin: 0;
    padding: 0;
  }
  
  main {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* Increase tour header height on mobile (match home header feel) */
  .site-header.tour-header .header-container {
    padding-top: 1.4rem !important;
    padding-bottom: 1.1rem !important;
  }
  
  .dambulla-hero {
    margin: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    position: relative;
    background: transparent !important;
    display: block;
    overflow: visible;
    line-height: 0;
  }
  
  .dambulla-hero > * {
    line-height: normal;
  }
  
  /* Pull section up to touch header - use negative margin if needed */
  main > section.dambulla-hero {
    margin-top: 0 !important;
  }
  
  /* Pull content wrapper up */
  .hero-content-wrapper {
    margin-top: 0 !important;
  }
  
  /* Pull breadcrumb nav up to touch header */
  .dambulla-hero-panel nav {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* Completely hide background image on mobile */
  .dambulla-hero .hero-bg,
  .dambulla-hero .hero-bg::after {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
  }
  
  .hero-gradient-overlay {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
  }
  
  .hero-content-wrapper {
    margin: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    padding-bottom: 1rem !important;
    background: #f7f4ef;
    position: relative;
    top: 0;
    transform: translateY(0);
  }
  
  /* Add small spacing from header */
  .dambulla-hero {
    padding-top: 0.75rem !important;
  }
  
  /* Remove spacing since breadcrumb is hidden */
  .dambulla-hero-panel > div:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  .dambulla-hero-inner {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto;
  }
  
  /* Ensure content starts immediately */
  .dambulla-hero-panel {
    margin: 0 !important;
    padding: 0 !important;
    background: #f7f4ef;
  }
  
  /* Hide breadcrumb nav on mobile */
  .dambulla-hero-panel nav {
    display: none !important;
  }
  
  /* Remove Tailwind margin classes that create gap */
  .dambulla-hero-panel .mt-3,
  .dambulla-hero-panel .mt-2,
  .dambulla-hero-panel .mt-5,
  .dambulla-hero-panel .mt-7 {
    margin-top: 0 !important;
  }
  
  /* Remove any top margin from first element */
  .dambulla-hero-panel > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* Remove gap between nav and next div */
  .dambulla-hero-panel nav + div {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* Force remove all spacing - nuclear option */
  .dambulla-hero-panel nav,
  .dambulla-hero-panel nav * {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* Ensure content wrapper has no top spacing */
  .hero-content-wrapper {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* Remove any spacing from the first child of content wrapper */
  .hero-content-wrapper > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  .dambulla-hero-inner > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* Remove gap from section element */
  section.dambulla-hero {
    display: block;
  }
  
  /* Ensure no spacing between header and section */
  header.tour-header {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  
  header.tour-header .header-container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  
  header.tour-header + main,
  header + main {
    margin-top: 0 !important;
    padding-top: 0 !important;
    display: block;
  }
  
  /* Remove any default spacing from main */
  main > section:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* Make sure section has no top spacing and pulls up */
  section.dambulla-hero {
    margin-top: 0 !important;
    padding-top: 0 !important;
    display: block;
  }
  
  /* Pull content wrapper up if needed */
  .hero-content-wrapper {
    position: relative;
    top: 0;
    margin-top: 0 !important;
  }
  
  /* Remove any whitespace gap by making header and main flush */
  header.tour-header {
    display: block;
  }
  
  header.tour-header + main {
    margin-top: 0 !important;
    padding-top: 0 !important;
    display: block;
  }
  
  /* Ensure section starts immediately */
  main > section.dambulla-hero:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none;
  }
  
  /* Force remove any gap - last resort */
  .site-header.tour-header {
    position: relative;
    z-index: 1000;
  }
  
  main.pt-0 {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* Remove any line-height spacing from first text element */
  .dambulla-hero-panel nav,
  .dambulla-hero-panel nav * {
    line-height: 1.2 !important;
    margin: 0 !important;
  }
  
  .dambulla-hero-panel nav {
    padding-top: 0 !important;
    padding-bottom: 0.5rem !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}

@media (min-width: 640px) {
  .dambulla-hero {
    min-height: 38vh;
  }
}

@media (min-width: 768px) {
  .dambulla-hero {
    min-height: 42vh;
  }
}

/* Hero background image - pinned to right edge */
.dambulla-hero .hero-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: 100vw;
  height: 100%;
  min-height: 100%;
  background-image: linear-gradient(
      to bottom,
      rgba(247, 244, 239, 0) 54%,
      rgba(247, 244, 239, 1) 100%
    ),
    url("image/Day Tours/dambulla/Dambulla-Caves.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
  opacity: 1 !important;
  animation: none !important;
  will-change: auto;
}

/* Add fade overlay directly on hero-bg */
.dambulla-hero .hero-bg::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(247, 244, 239, 1) 0%,
    rgba(247, 244, 239, 0.95) 25%,
    rgba(247, 244, 239, 0.8) 50%,
    rgba(247, 244, 239, 0.5) 70%,
    rgba(247, 244, 239, 0.25) 85%,
    rgba(247, 244, 239, 0.1) 95%,
    transparent 100%
  );
  z-index: 1;
  pointer-events: none;
}

@media (min-width: 768px) {
  .dambulla-hero .hero-bg {
    width: 66.666vw;
    right: 0;
  }
  
  .dambulla-hero .hero-bg::after {
    width: 35%;
    background: linear-gradient(
      to right,
      rgba(247, 244, 239, 1) 0%,
      rgba(247, 244, 239, 0.95) 20%,
      rgba(247, 244, 239, 0.85) 40%,
      rgba(247, 244, 239, 0.6) 60%,
      rgba(247, 244, 239, 0.3) 80%,
      transparent 100%
    );
  }
}

/* Left gradient overlay - additional fade for smooth blending */
.hero-gradient-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 50vw;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(247, 244, 239, 1) 0%,
    rgba(247, 244, 239, 0.9) 30%,
    rgba(247, 244, 239, 0.6) 60%,
    rgba(247, 244, 239, 0.3) 80%,
    transparent 100%
  );
  z-index: 2;
  pointer-events: none;
}

@media (min-width: 768px) {
  .hero-gradient-overlay {
    width: 35vw;
    background: linear-gradient(
      to right,
      rgba(247, 244, 239, 1) 0%,
      rgba(247, 244, 239, 0.9) 25%,
      rgba(247, 244, 239, 0.7) 50%,
      rgba(247, 244, 239, 0.4) 70%,
      transparent 100%
    );
  }
}

/* Content container */
.hero-content-wrapper {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 0;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .hero-content-wrapper {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .hero-content-wrapper {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.dambulla-hero-inner {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: auto;
  padding-top: 0;
  padding-bottom: 1rem;
}

@media (min-width: 640px) {
  .dambulla-hero-inner {
    padding-top: 80px;
    padding-bottom: 1.25rem;
  }
}

@media (min-width: 768px) {
  .dambulla-hero-inner {
    padding-top: 90px;
    padding-bottom: 1.5rem;
  }
}

.dambulla-hero-panel {
  width: 100%;
  max-width: 42rem;
}

/* Reduce spacing in hero content */
.dambulla-hero-panel .mt-3 {
  margin-top: 0.75rem !important;
}

.dambulla-hero-panel .mt-2 {
  margin-top: 0.5rem !important;
}

.dambulla-hero-panel .mt-5 {
  margin-top: 1rem !important;
}

.dambulla-hero-panel .mt-7 {
  margin-top: 1.25rem !important;
}

.dambulla-hero-panel h1 {
  margin-top: 0.5rem !important;
}

.dambulla-hero-panel nav {
  margin-bottom: 0.5rem;
}

/* Mobile: tighter, more readable hero */
@media (max-width: 640px) {
  .dambulla-hero {
    min-height: auto !important;
  }

  .dambulla-hero .hero-bg {
    background-image: linear-gradient(
        to bottom,
        rgba(247, 244, 239, 0.78) 0%,
        rgba(247, 244, 239, 0.9) 42%,
        rgba(247, 244, 239, 1) 78%
      ),
      url("image/Day Tours/dambulla/Dambulla-Caves.jpg");
  }

  .dambulla-hero-inner {
    min-height: auto !important;
    justify-content: flex-start !important;
    padding-top: 78px !important;
    padding-bottom: 10px;
  }

  .dambulla-hero-panel {
    background: rgba(247, 244, 239, 0.86);
    border: 1px solid rgba(18, 18, 18, 0.08);
    border-radius: 16px;
    padding: 0.9rem 0.95rem;
    backdrop-filter: blur(10px);
  }

  .dambulla-hero-panel nav {
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .dambulla-hero-panel h1 {
    font-size: 1.85rem;
    line-height: 1.12;
  }

  .dambulla-hero-panel p {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .dambulla-hero-chips span {
    font-size: 0.82rem;
    padding: 0.28rem 0.6rem;
  }

  .dambulla-hero-cta {
    margin-top: 0.9rem !important;
    gap: 0.6rem;
  }

  .dambulla-hero-cta > * {
    padding: 0.65rem 0.95rem !important;
    font-size: 0.95rem;
  }
}

/* Tabs: active state styling via aria-selected */
[data-tabs] [data-tab] {
  background: rgba(247, 244, 239, 0.9) !important;
  color: rgba(18, 18, 18, 0.8) !important;
  border-color: rgba(18, 18, 18, 0.12) !important;
}

[data-tabs] [data-tab][aria-selected="true"] {
  background: #ffffff !important;
  color: rgba(18, 18, 18, 1) !important;
  border-color: rgba(18, 18, 18, 0.18) !important;
  box-shadow: 0 -1px 0 rgba(18, 18, 18, 0.06) inset;
}

[data-tabs] [data-tab]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 61, 54, 0.18);
}

/* Mobile: compact itinerary cards (image left, text right, description always visible) */
@media (max-width: 640px) {
  html {
    font-size: 15px;
  }

  .itinerary-card {
    padding: 0.75rem !important;
    cursor: default;
  }

  .itinerary-card [data-acc-btn] {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .itinerary-card [data-acc-btn] > .rounded-xl {
    flex: 0 0 40%;
    max-width: 40%;
    aspect-ratio: 4 / 3;
  }

  .itinerary-card [data-acc-btn] > .rounded-xl img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .itinerary-card [data-acc-btn] > .mt-3 {
    margin-top: 0 !important;
    flex: 1 1 auto;
  }

  .itinerary-card [data-acc-icon] {
    display: none !important;
  }

  .itinerary-card .itinerary-body {
    max-height: none !important;
    overflow: visible !important;
    transition: none !important;
    margin-top: 0.35rem !important;
    display: block;
  }

  /* Hide booking section on mobile */
  #booking {
    display: none !important;
  }
}

/* Koalendar Modal Overlay */
.koalendar-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.koalendar-modal-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 90vh;
  max-height: 700px;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.koalendar-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.koalendar-modal-close:hover {
  background: white;
  transform: scale(1.1);
}

.koalendar-modal-close svg {
  color: #121212;
}

@media (max-width: 640px) {
  .koalendar-modal-container {
    height: 95vh;
    max-height: none;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }
  
  .koalendar-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
}
