/**
 * Theme 6 homepage — final cascade layer (load after site-brand / mobile-sidebar).
 * Intentionally high specificity (body.theme6-home …) so production never falls back to
 * stale cached base CSS (main.css h1, .search__popup, etc.).
 */

/* ----- Hero: typography + containment ----- */
body.theme6-home .theme6-luxury-hero .theme6-luxury-hero__title {
  margin: 0;
  border-bottom: none;
  display: block;
  max-width: min(100%, 22ch);
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  font-size: clamp(1.9rem, 5.8vw, 3.9rem);
  line-height: 1.1;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.26);
}

@media (min-width: 992px) {
  body.theme6-home .theme6-luxury-hero .theme6-luxury-hero__title {
    max-width: 24ch;
    font-size: clamp(2.4rem, 4.1vw, 4.1rem);
  }
}

body.theme6-home .theme6-luxury-hero .theme6-luxury-hero__subtitle {
  margin-top: clamp(0.65rem, 2vw, 1rem);
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.96);
  font-size: clamp(1rem, 2.8vw, 1.28rem);
  line-height: 1.55;
  max-width: 38rem;
}

body.theme6-home .theme6-luxury-hero__content-area.tg-hero-content-area {
  display: flex;
  align-items: center;
  justify-content: stretch;
  box-sizing: border-box;
}

@media (max-width: 991.98px) {
  body.theme6-home .theme6-luxury-hero__content-area.tg-hero-content-area {
    align-items: center;
    padding-top: clamp(3.25rem, 11vw, 5rem);
    padding-bottom: clamp(2rem, 7vh, 3.5rem);
  }
}

body.theme6-home .theme6-luxury-hero__inner {
  width: 100%;
  max-width: 720px;
  box-sizing: border-box;
}

/* ----- Search modal: beat legacy .search__popup padding / base heading rules (all theme6 pages) ----- */
#theme6SearchModal.search__popup.theme6-search-modal {
  padding-top: 0;
  padding-bottom: 0;
  background: transparent;
}

#theme6SearchModal .theme6-search-modal__title,
#theme6SearchModal h2.theme6-search-modal__title {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(1.15rem, 4vw, 1.65rem);
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0 0 0.35rem;
}

#theme6SearchModal h3.theme6-search-modal__section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0 0 0.65rem;
}

#theme6SearchModal .theme6-search-modal__subtitle {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #64748b;
}

#theme6SearchModal .theme6-search-modal__panel {
  max-width: min(640px, 100%);
}

@media (max-width: 575.98px) {
  #theme6SearchModal .theme6-search-modal__inner {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  #theme6SearchModal .theme6-search-modal__close {
    top: max(0.75rem, env(safe-area-inset-top, 0px));
  }

  #theme6SearchModal .theme6-search-modal__field {
    flex-wrap: nowrap;
  }
}

/* ----- Mobile slide-out menu: safe area (theme6 uses this panel markup) ----- */
.tgmobile__menu .site-mobile-panel__scroll {
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
}

.tgmobile__menu .site-mobile-panel__footer {
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom, 0px));
}

/* ----- CTA / app download strip: Arabic + RTL (legacy main.css uses capitalize + asymmetric margins) ----- */
body.theme6-home .theme6-app-cta-section {
  padding-top: clamp(0.75rem, 2vw, 1.5rem);
  padding-bottom: clamp(2.25rem, 4.5vw, 3.75rem);
}

body.theme6-home .theme6-app-cta-shell.tg-cta-4-spacing {
  border-radius: clamp(26px, 5vw, 44px);
  overflow: hidden;
  box-shadow: 0 16px 44px rgba(16, 24, 40, 0.2);
  animation: theme6-app-cta-fade-in 0.7s ease both;
}

body.theme6-home .theme6-app-cta__row {
  min-height: clamp(330px, 40vw, 430px);
}

body.theme6-home .theme6-app-cta__title,
body.theme6-home .tg-cta-4-content p.theme6-app-cta__text {
  text-transform: none;
}

body.theme6-home .tg-cta-4-spacing .tg-cta-4-content.theme6-app-cta__content {
  overflow: visible;
  max-width: 100%;
  box-sizing: border-box;
  padding-inline: clamp(0.75rem, 2.5vw, 1.75rem);
  text-align: start;
}

body.theme6-home .theme6-app-cta__title,
body.theme6-home .theme6-app-cta__text {
  text-align: start;
  max-width: min(100%, 40rem);
}

body.theme6-home .theme6-app-cta__title {
  font-size: clamp(1.5rem, 2.9vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 700;
}

body.theme6-home .theme6-app-cta__text {
  font-size: clamp(0.9rem, 1.6vw, 1.03rem);
  line-height: 1.55;
  max-width: 30rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
}

body.theme6-home .theme6-app-cta__stores {
  gap: 0.875rem 1.25rem;
  row-gap: 0.75rem;
}

body.theme6-home .theme6-app-cta__stores .theme6-app-cta__store-link {
  margin: 0 !important;
  flex: 0 0 auto;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 144px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 12px;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

body.theme6-home .theme6-app-cta__stores .theme6-app-cta__store-link img {
  display: block;
  height: auto;
  max-height: 36px;
  width: auto;
}

body.theme6-home .theme6-app-cta__stores .theme6-app-cta__store-link:hover {
  transform: translateY(-3px) scale(1.02);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

body.theme6-home .theme6-app-cta__visual {
  margin-right: 0 !important;
  padding-top: clamp(1rem, 3vw, 2.25rem) !important;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

body.theme6-home .theme6-app-cta__image {
  width: min(92%, 510px) !important;
  max-width: 100%;
  animation: theme6-app-cta-float 5.6s ease-in-out infinite;
}

@media (min-width: 992px) {
  body.theme6-home .tg-cta-4-spacing .tg-cta-4-content.theme6-app-cta__content {
    margin-left: 0;
    margin-right: clamp(0px, 2.4vw, 30px);
    padding-inline: clamp(0.25rem, 1.2vw, 1.25rem);
  }

  body.theme6-home .theme6-app-cta__visual {
    justify-content: flex-start;
    padding-inline-start: clamp(0.25rem, 2vw, 1.4rem);
  }
}

html[dir="rtl"] body.theme6-home .tg-cta-4-spacing .tg-cta-4-content.theme6-app-cta__content {
  margin-left: clamp(0px, 2.4vw, 30px);
  margin-right: 0;
}

html[dir="rtl"] body.theme6-home .tg-cta-4-spacing .tg-cta-4-thumb {
  margin-left: 0;
  margin-right: 0;
}

html[dir="rtl"] body.theme6-home .theme6-app-cta__visual {
  justify-content: flex-end;
  padding-inline-end: clamp(0.25rem, 2vw, 1.4rem);
  padding-inline-start: 0;
}

@media (max-width: 991.98px) {
  body.theme6-home .theme6-app-cta-shell.tg-cta-4-spacing {
    border-radius: 28px;
  }

  body.theme6-home .theme6-app-cta__row {
    min-height: auto;
  }

  body.theme6-home .theme6-app-cta__visual {
    justify-content: center;
    padding-top: 1rem !important;
  }

  body.theme6-home .tg-cta-4-spacing .tg-cta-4-content.theme6-app-cta__content {
    padding-inline: clamp(1rem, 4vw, 1.4rem);
    padding-bottom: clamp(1rem, 4vw, 1.4rem);
    text-align: center;
  }

  body.theme6-home .theme6-app-cta__title,
  body.theme6-home .theme6-app-cta__text {
    text-align: center;
    margin-inline: auto;
  }

  body.theme6-home .theme6-app-cta__stores {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.theme6-home .theme6-app-cta-shell.tg-cta-4-spacing,
  body.theme6-home .theme6-app-cta__image,
  body.theme6-home .theme6-app-cta__stores .theme6-app-cta__store-link {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes theme6-app-cta-fade-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes theme6-app-cta-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ----- CTA refinement: compact + premium balance ----- */
body.theme6-home .theme6-app-cta-section {
  padding-top: clamp(0.35rem, 1.2vw, 0.9rem);
  padding-bottom: clamp(1.75rem, 3.2vw, 2.8rem);
}

body.theme6-home .theme6-app-cta-shell.tg-cta-4-spacing {
  max-width: min(1180px, 100%);
  margin-inline: auto;
  border-radius: clamp(20px, 3.4vw, 32px);
  background: linear-gradient(135deg, #2a8489 0%, #256f73 100%);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

body.theme6-home .theme6-app-cta__row {
  min-height: clamp(240px, 28vw, 320px);
}

body.theme6-home .theme6-app-cta__visual {
  padding-top: 0 !important;
  margin-right: 0 !important;
}

body.theme6-home .theme6-app-cta__media {
  width: min(100%, 420px);
  min-height: clamp(170px, 22vw, 250px);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

body.theme6-home .theme6-app-cta__image {
  width: 100% !important;
  max-width: 100%;
  object-fit: contain;
  animation: theme6-app-cta-float 6.8s ease-in-out infinite;
}

body.theme6-home .theme6-app-cta__media-fallback {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.9);
}

body.theme6-home .theme6-app-cta__media.is-fallback .theme6-app-cta__media-fallback {
  display: inline-flex;
}

body.theme6-home .theme6-app-cta__media-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  font-size: 24px;
}

body.theme6-home .theme6-app-cta__media-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body.theme6-home .tg-cta-4-spacing .tg-cta-4-content.theme6-app-cta__content {
  margin: 0 !important;
  padding-inline: clamp(0.25rem, 1.2vw, 1rem);
  padding-block: clamp(1rem, 2vw, 1.6rem);
}

body.theme6-home .theme6-app-cta__title {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.26;
  margin-bottom: 0.6rem !important;
  max-width: 19ch;
}

body.theme6-home .theme6-app-cta__text {
  font-size: clamp(0.86rem, 1.35vw, 0.98rem);
  line-height: 1.6;
  max-width: 52ch;
}

body.theme6-home .theme6-app-cta__stores {
  padding-top: 0.65rem !important;
  gap: 0.7rem;
}

body.theme6-home .theme6-app-cta__stores .theme6-app-cta__store-link {
  min-width: 136px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 11px;
}

body.theme6-home .theme6-app-cta__stores .theme6-app-cta__store-link img {
  max-height: 31px;
}

@media (max-width: 991.98px) {
  body.theme6-home .theme6-app-cta-shell.tg-cta-4-spacing {
    border-radius: 22px;
  }

  body.theme6-home .theme6-app-cta__row {
    min-height: auto;
  }

  body.theme6-home .theme6-app-cta__visual {
    margin-bottom: 0.5rem;
  }

  body.theme6-home .theme6-app-cta__media {
    width: min(100%, 330px);
    min-height: 170px;
  }
}

/* ----- Homepage section spacing: unified rhythm ----- */
body.theme6-home {
  --theme6-section-space-sm: clamp(1.15rem, 3.4vw, 1.85rem);
  --theme6-section-space-md: clamp(1.65rem, 4.1vw, 2.55rem);
  --theme6-section-space-lg: clamp(2rem, 4.9vw, 3.1rem);
}

/* Search block below hero */
body.theme6-home #book.tg-booking-form-area {
  margin-top: var(--theme6-section-space-sm) !important;
}

/* Trips + products sections */
body.theme6-home .theme6-tour-listing.tg-listing-area,
body.theme6-home .theme6-product-listing.tg-listing-area {
  padding-top: var(--theme6-section-space-lg) !important;
  padding-bottom: var(--theme6-section-space-lg) !important;
}

/* Popular destinations */
body.theme6-home .theme6-destination.tg-location-area {
  padding-top: var(--theme6-section-space-lg) !important;
  padding-bottom: var(--theme6-section-space-md) !important;
}

/* App banner */
body.theme6-home .theme6-app-cta-section {
  padding-top: var(--theme6-section-space-sm) !important;
  padding-bottom: var(--theme6-section-space-md) !important;
}

/* Galleries */
body.theme6-home .theme6-gallery--has-images,
body.theme6-home .theme6-gallery--empty {
  padding-top: var(--theme6-section-space-md);
  padding-bottom: var(--theme6-section-space-lg);
}

/* Keep section headers tight and consistent */
body.theme6-home .theme6-tour-listing .tg-location-section-title.mb-40,
body.theme6-home .theme6-tour-listing .tg-location-3-btn.mb-40,
body.theme6-home .theme6-product-listing .tg-location-section-title.mb-40,
body.theme6-home .theme6-product-listing .tg-location-3-btn.mb-40,
body.theme6-home .theme6-destination .tg-location-section-title.mb-40,
body.theme6-home .theme6-destination .tg-location-3-btn.mb-40 {
  margin-bottom: clamp(1rem, 2.2vw, 1.5rem) !important;
}

@media (max-width: 575.98px) {
  body.theme6-home {
    --theme6-section-space-sm: clamp(0.9rem, 4.8vw, 1.25rem);
    --theme6-section-space-md: clamp(1.2rem, 5.5vw, 1.65rem);
    --theme6-section-space-lg: clamp(1.45rem, 6.2vw, 2rem);
  }
}

/* ----- Hero caption: Arabic/RTL polish + mobile image sizing ----- */
html[dir="rtl"] body.theme6-home .theme6-luxury-hero__inner {
  text-align: right !important;
  margin-inline-start: auto;
  margin-inline-end: 0;
}

html[dir="rtl"] body.theme6-home .theme6-luxury-hero .theme6-luxury-hero__subtitle {
  margin-inline-start: auto;
  margin-inline-end: 0;
}

html[dir="rtl"] body.theme6-home .theme6-luxury-hero__actions {
  justify-content: flex-end !important;
}

@media (min-width: 576px) {
  html[dir="rtl"] body.theme6-home .theme6-luxury-hero__actions {
    flex-direction: row-reverse !important;
  }
}

@media (max-width: 767.98px) {
  body.theme6-home .theme6-luxury-hero .tg-hero-slider-active,
  body.theme6-home .theme6-luxury-hero__slider-wrap,
  body.theme6-home .theme6-luxury-hero .swiper-slide {
    min-height: clamp(400px, 68vh, 560px) !important;
    height: clamp(400px, 68vh, 560px) !important;
  }

  body.theme6-home .theme6-luxury-hero .tg-hero-thumb {
    background-position: center 32% !important;
    background-size: cover !important;
  }
}

@media (max-width: 575.98px) {
  body.theme6-home .theme6-luxury-hero__inner {
    padding-left: clamp(0.9rem, 3.8vw, 1.1rem) !important;
    padding-right: clamp(0.9rem, 3.8vw, 1.1rem) !important;
    padding-top: clamp(0.25rem, 2vw, 0.6rem) !important;
    padding-bottom: clamp(1rem, 3.5vw, 1.35rem) !important;
  }

  body.theme6-home .theme6-luxury-hero .theme6-luxury-hero__title {
    font-size: clamp(1.55rem, 7vw, 2.05rem) !important;
    line-height: 1.22;
    max-width: 17ch;
    margin-inline: auto;
  }

  body.theme6-home .theme6-luxury-hero .theme6-luxury-hero__subtitle {
    font-size: clamp(0.95rem, 3.9vw, 1.05rem) !important;
    line-height: 1.48;
    max-width: 24ch;
    margin-inline: auto;
  }

  body.theme6-home .theme6-luxury-hero__actions {
    width: 100%;
    max-width: 300px;
    gap: 0.6rem !important;
    margin-top: 1.1rem !important;
    margin-inline: auto;
  }

  body.theme6-home .theme6-luxury-hero__btn {
    min-height: 44px;
    font-size: 0.95rem;
  }

  html[dir="rtl"] body.theme6-home .theme6-luxury-hero__actions {
    align-items: stretch !important;
  }
}
