/* Shared layout integrity — positioning, sizing, overflow only.
   Applies to homepage, inner pages, and WooCommerce screens. */

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

button {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
}

img {
  max-width: 100%;
  height: auto;
}

img[src=""],
img:not([src]) {
  display: none;
}

#main-content,
.sw-page,
.sw-woo-page,
.sw-build-page,
#main-content > section,
.sw-theme-banner {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#main-content > section {
  display: block;
}

#main-content .max-w-7xl,
#main-content .max-w-5xl,
#main-content .max-w-4xl,
#main-content .max-w-3xl,
#main-content .max-w-2xl,
.sw-page .max-w-7xl,
.sw-woo-page .max-w-7xl,
.sw-build-page .max-w-7xl,
footer .max-w-7xl,
#site-header .max-w-7xl {
  width: 100%;
  max-width: min(80rem, 100%);
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
}

#main-content h1,
#main-content h2,
#main-content h3,
#main-content h4,
#main-content p,
#main-content li,
.sw-page h1,
.sw-woo-page h1,
.sw-build-page h1 {
  overflow-wrap: break-word;
  word-break: normal;
  max-width: 100%;
}

.sw-reveal {
  max-width: 100%;
  min-width: 0;
}

/* —— Hero: never become a two-column flex row —— */
#hero {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100%;
  max-width: 100%;
}

#hero .sw-hero-media {
  position: absolute !important;
  inset: 0 !important;
  width: 100%;
  max-width: 100%;
  pointer-events: none;
}

#hero .sw-hero-inner {
  position: relative;
  z-index: 10;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100%;
  max-width: min(64rem, 100%);
  margin-inline: auto;
  text-align: center;
}

#hero .sw-hero-inner > * {
/*   width: 100%; */
  max-width: 100%;
}

#hero .sw-hero-rotator {
  display: inline-grid;
  vertical-align: baseline;
  text-align: left;
  max-width: 100%;
}

#hero .sw-hero-rotator > * {
  grid-column: 1;
  grid-row: 1;
}

#hero .sw-hero-rotator-live {
  position: relative;
  display: inline-block;
  overflow: hidden;
  height: 1.35em;
  width: 100%;
  max-width: 100%;
}

#hero #hero-concept {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 100%;
  white-space: normal;
}

#hero .sw-hero-actions,
#hero .sw-hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

#hero .sw-hero-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  #hero .sw-hero-actions {
    flex-direction: row;
    align-items: center;
  }

  #hero .sw-hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #hero #hero-concept {
    white-space: nowrap;
  }
}

/* —— Shared two-column / card grids ——
   Must be a 12-column track when children use col-span-5/7.
   A 2-track grid + col-span-5 wraps every child onto its own row
   (the stacked About / Services / Contact bug). */
.sw-split,
.sw-booking-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  gap: 2.5rem;
}

.sw-booking-grid {
  gap: 0;
}

.sw-split > *,
.sw-booking-grid > * {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 768px) {
  #about .sw-split,
  #services .sw-split,
  #contact .sw-split,
  #why .sw-split,
  #reviews .sw-split,
  .sw-booking-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: center;
  }

  #book-shop .sw-split,
  #faq .sw-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  #about .sw-split > :first-child,
  #contact .sw-split > :first-child,
  .sw-booking-grid > :first-child {
    grid-column: 1 / span 5;
  }

  #about .sw-split > :last-child,
  #contact .sw-split > :last-child,
  .sw-booking-grid > :last-child {
    grid-column: 6 / span 7;
  }

  #services .sw-split > :first-child {
    grid-column: 1 / span 7;
  }

  #services .sw-split > :last-child {
    grid-column: 8 / span 5;
  }

  #why .sw-split > :first-child,
  #why .sw-split > :last-child {
    grid-column: span 6;
  }

  #reviews .sw-split > :first-child {
    grid-column: 1 / span 8;
  }

  #reviews .sw-split > :last-child {
    grid-column: 9 / span 4;
  }

  #contact .sw-split,
  .sw-booking-grid {
    align-items: start;
  }
}

.sw-check-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

.sw-about-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .sw-check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sw-about-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.sw-card-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 640px) {
  .sw-card-grid.is-2,
  .sw-card-grid.is-3,
  .sw-card-grid.is-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .sw-card-grid.is-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .sw-card-grid.is-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.sw-card-grid > * {
  min-width: 0;
  max-width: 100%;
}

/* —— Payment / icon rows —— */
.sw-pay-methods {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
}

.sw-pay-methods img {
  display: block;
  height: 2rem;
  width: auto;
  max-width: 4.5rem;
  flex: 0 0 auto;
  object-fit: contain;
}

/* —— Book cover stage: size to the image, no mid-word crop —— */
.sw-book-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.sw-book-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.sw-book-copy {
  min-width: 0;
  max-width: 100%;
}

.sw-book-copy h3,
.sw-book-copy p {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

/* —— Gallery thumbs + captions —— */
.sw-gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.sw-gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.sw-gallery-item .sw-gallery-caption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: calc(100% - 2rem);
}

.sw-gallery-item .sw-gallery-caption h3 {
  display: block;
  white-space: normal;
  overflow: visible;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

/* —— Overlays: hidden until explicitly opened (not an empty white box) —— */
#gallery-lightbox[hidden],
#legal-modal[hidden],
#booking-modal[hidden],
#gallery-lightbox:not(.flex),
#legal-modal:not(.flex),
#booking-modal:not(.flex),
#cart-backdrop.hidden,
#mobile-nav-backdrop.hidden,
#sw-toast.hidden,
#preloader[hidden],
#preloader:not(.is-visible) {
  display: none !important;
}

#gallery-lightbox.flex,
#legal-modal.flex,
#booking-modal.flex {
  display: flex !important;
}

/* —— Inner / Woo pages share the same container rules —— */
.sw-theme-banner,
.sw-single-product__grid,
.sw-checkout-layout,
.sw-build-products .grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.sw-single-product__grid > *,
.sw-checkout-layout > *,
.sw-product-card {
  min-width: 0;
  max-width: 100%;
}

/*
 * Header: desktop nav only from 1320px up (12 links + CTA need that width).
 * display:flex !important on the desktop nav previously overrode Tailwind
 * `hidden`, so links never collapsed and the hamburger sat in the text.
 */
#site-header {
  overflow: visible;
}

.admin-bar #site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar #site-header {
    top: 46px;
  }
}

#site-header .sw-header-bar {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 96rem;
  width: 100%;
  min-width: 0;
}

#site-header .sw-header-nav,
#site-header .sw-header-actions {
  display: none !important;
}

#site-header .sw-header-mobile {
  display: flex !important;
  align-items: center;
  flex-shrink: 0;
  gap: 0.25rem;
}

#mobile-nav-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(100vw, 20rem);
  height: 100dvh;
  min-height: 100vh;
  background: #111318;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.35s;
}

#mobile-nav-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

#mobile-nav-drawer > div {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem;
}

#mobile-nav-drawer,
#mobile-nav-drawer a,
#mobile-nav-drawer button {
  color: #f6f8fb;
}

#mobile-nav-drawer nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 0;
  flex: 1;
}

#mobile-nav-drawer nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 1.125rem;
  font-weight: 500;
  border-radius: 0.375rem;
}

#mobile-nav-drawer .sw-open-booking,
#mobile-nav-drawer .sw-cart-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border-radius: 0.375rem;
}

#mobile-nav-drawer .sw-open-booking {
  background: #005cca;
  border: 0;
  font-weight: 600;
}

#mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.7);
  display: none;
}

#mobile-nav-backdrop.is-open {
  display: block !important;
}

@media (min-width: 1320px) {
  #site-header .sw-header-bar {
    gap: 1.5rem;
  }

  #site-header .sw-header-nav {
    display: flex !important;
    align-items: center;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    flex: 1 1 auto;
    min-width: 0;
    gap: 1.25rem;
    margin-inline: 1rem;
  }

  #site-header .sw-header-nav a {
    white-space: nowrap !important;
    flex: 0 0 auto;
    margin-inline: 0.15rem;
    padding-inline: 0.1rem;
  }

  #site-header .sw-header-actions {
    display: flex !important;
    align-items: center;
    gap: 1.25rem;
    margin-left: 1rem;
  }

  #site-header .sw-header-mobile,
  #mobile-nav-drawer,
  #mobile-nav-backdrop,
  #mobile-nav-backdrop.is-open {
    display: none !important;
  }
}

@media (min-width: 1366px) {
  #site-header .sw-header-nav {
    gap: 1.5rem;
    margin-inline: 1.25rem;
  }

  #site-header .sw-header-actions {
    gap: 1.5rem;
    margin-left: 1.25rem;
  }
}

@media (min-width: 1440px) {
  #site-header .sw-header-nav {
    gap: 1.75rem;
  }

  #site-header .sw-header-actions {
    gap: 1.75rem;
  }
}

@media (min-width: 1920px) {
  #site-header .sw-header-nav {
    gap: 2rem;
  }
}
