/* Brainwave logo - force white text, dark purple icon */
.footer-brainwave-logo path[fill="#FFF"],
.footer-brainwave-logo polygon[fill="#FFF"] {
  fill: #FFFFFF !important;
}

.footer-brainwave-logo polygon[fill="#6B46C1"] {
  fill: #6B46C1 !important;
}

/* Header logo styling - separate "cloud" block to the right */
@media screen and (min-width: 861px) {
  .layout-header--sticky-flex > div:first-child {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    flex-shrink: 0 !important;
  }
  
  .layout-header-tagline {
    display: block !important;
    width: 230px !important;
    height: 100px !important;
    padding: 40px 0 !important;
    background-image: url("../images/cover/logo.svg") !important;
    background-position: 50% 50% !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    text-align: center !important;
    flex-shrink: 0 !important;
  }
  
  .header-logo-wrapper {
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 1 !important;
  }
  
  /* Hide mobile menu logo on desktop */
  .mobile-header-logo-wrapper {
    display: none !important;
  }
}

.header-logo-wrapper {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, rgb(210 140 175 / 95%) 0%, rgba(123, 31, 162, 1) 50%, rgb(22 13 173 / 95%) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(138, 43, 226, 0.5);
  flex-shrink: 0;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.header-logo-wrapper:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(138, 43, 226, 0.6);
}

.header-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media screen and (max-width: 860px) {
  .header-logo-wrapper {
    width: 48px;
    height: 48px;
    padding: 5px;
    margin-left: -5px;
  }
  
  /* Mobile menu logo - fixed centered position */
  .mobile-header-logo-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgb(210 140 175 / 95%) 0%, rgba(123, 31, 162, 1) 50%, rgb(22 13 173 / 95%) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: 0 4px 16px rgba(138, 43, 226, 0.5);
    margin: 0 auto 30px auto;
    text-decoration: none;
    transition: transform 0.3s ease;
    position: relative;
    left: 0;
    right: 0;
  }
  
  .mobile-header-logo-wrapper:hover {
    transform: scale(1.05);
  }
  
  .mobile-header-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
  
  .layout-header-navigation .mobile-header-logo-wrapper {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.6s, opacity 0.6s;
  }
  
  .layout-header-navigation.open .mobile-header-logo-wrapper {
    visibility: visible;
    opacity: 1;
  }
}

/* Sticky header for mobile - EXACT same behavior as desktop */
@media screen and (max-width: 860px) {
  /* Initial state - absolute positioning like desktop */
  .layout-header--sticky {
    position: absolute;
    left: 50%;
    z-index: 10;
    transform: translate(-50%, 0);
    width: 100%;
  }
  
  /* Fixed header when scrolled past 950px - EXACT like desktop */
  /* Desktop: top: -180px (hidden above), padding: 40px 0, background gradient */
  .layout-header.fixed {
    position: fixed !important;
    top: -180px !important;
    left: 50% !important;
    width: 100%;
    padding: 40px 0 !important;
    background-image: linear-gradient(180deg, rgba(98,117,255,.6) 30%, transparent 100%) !important;
    transform: translate(-50%, 0) !important;
    transition: transform 0.15s ease !important;
  }
  
  /* Hide header when scrolling down - EXACT like desktop: translate DOWN by 180px */
  /* Desktop: transform: translate(-50%, 180px) - moves header DOWN into view */
  .layout-header.fixed.hide {
    transform: translate(-50%, 180px) !important;
  }
}

/* Fix header positioning on policy and terms pages - same style as homepage but fixed to top */
body:not(.bg-cover) .layout-header--sticky {
  position: fixed !important;
  top: 0 !important;
  left: 50% !important;
  transform: translate(-50%, 0) !important;
  width: 100%;
  z-index: 10;
  background-color: transparent !important;
  padding-top: 40px !important;
}

/* Add padding to page title to account for fixed header */
body:not(.bg-cover) .layout-page-title {
  margin-top: 180px !important;
}

/* Center Brainwave logo and text block on mobile */
@media screen and (max-width: 860px) {
  .layout-footer-block .footer-brainwave-logo {
    margin: 0 auto 20px auto !important;
    display: block !important;
  }
  
  .layout-footer-block > div.h-mtop-15 {
    text-align: center !important;
  }
  
  .layout-footer-block > div.h-mtop-15 > a {
    justify-content: center !important;
    margin: 0 auto 20px auto !important;
  }
  
  /* Fix header on policy/terms pages for mobile - same as homepage */
  body:not(.bg-cover) .layout-header--sticky {
    padding-top: 30px !important;
  }
  
  body:not(.bg-cover) .layout-page-title {
    margin-top: 140px !important;
  }
}

/* Facilities items - two columns on mobile */
@media screen and (max-width: 860px) {
  .layout-facilities {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }
  
  .layout-facilities-item {
    width: calc(50% - 5px) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* For the last 3 items (5th, 6th, 7th) - distribute evenly */
  .layout-facilities-item:nth-child(n+5) {
    width: calc(50% - 5px) !important;
  }
  
  /* Optional: center the last odd item if needed */
  .layout-facilities-item:nth-child(7) {
    margin: 0 auto !important;
    width: calc(50% - 5px) !important;
  }
}
