/* =========================================================
   Canadian Wellness Centre — Shared Styles
   Tailwind-first; only non-utility / reusable rules live here.
========================================================= */

/* ===== Base typography ===== */
body { font-family: var(--body-font, 'Inter', sans-serif); overflow-x: hidden; }
h1, h2, h3, h4 { font-family: var(--heading-font, 'Playfair Display', serif); }

/* ===== Header state (Customizer toggles) ===== */
.cwc-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: var(--top-bar-bg-color, #0a2426);
  color: var(--top-bar-text-color, #ffffff);
}
body.cwc-has-topbar #navbar { top: 2.25rem; }
body.cwc-has-topbar { padding-top: 2.25rem; }
body.cwc-no-sticky #navbar { position: absolute; }
body.cwc-transparent-header #navbar {
  background: transparent; border-color: transparent; backdrop-filter: none;
}
body.cwc-transparent-header #navbar.shadow-md {
  background: var(--header-bg-color, rgba(255,255,255,0.95)); backdrop-filter: blur(4px);
}

/* ===== Global scroll offset for fixed navbar ===== */
html { scroll-padding-top: 80px; overflow-x: hidden; }
section[id] { scroll-margin-top: 80px; }

/* ===== Navbar ===== */
#navbar { transition: all 0.3s ease; }
.nav-link { position: relative; }
.nav-link::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 2px; background: var(--primary-color, #05666c); transition: width 0.3s;
}
.nav-link:hover::after { width: 100%; }

/* ===== Dropdown sub-menus ===== */
.sub-menu { list-style: none; margin: 0; padding: 0; }
.cwc-caret { transition: transform 0.2s ease; margin-left: 2px; }

/* Desktop: hover dropdown (menu lives inside <nav>) */
@media (min-width: 1024px) {
  #navbar nav .menu-item-has-children { position: relative; }
  #navbar nav .sub-menu {
    position: absolute; top: 100%; left: 0; min-width: 240px;
    background: #fff; border: 1px solid #f0f0f0; border-radius: 0.75rem;
    box-shadow: 0 14px 36px rgba(0,0,0,0.12);
    padding: 0.5rem; margin-top: 0.5rem; z-index: 60;
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }
  /* invisible bridge so the cursor can travel into the dropdown */
  #navbar nav .menu-item-has-children::after {
    content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 0.6rem;
  }
  #navbar nav .menu-item-has-children:hover > .sub-menu,
  #navbar nav .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
  #navbar nav .menu-item-has-children:hover > a .cwc-caret { transform: rotate(180deg); }
}

.cwc-subnav-link {
  display: block; padding: 0.55rem 0.85rem; border-radius: 0.5rem;
  font-size: 0.875rem; color: #374151; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.cwc-subnav-link:hover,
.cwc-subnav-link.is-active { background: var(--surface-color, #F7F9F9); color: var(--primary-color, #05666c); }

/* Mobile: show sub-menu items indented within the slide-down menu */
#nav-menu .sub-menu { padding-left: 0.75rem; border-left: 2px solid #eee; margin: 0.25rem 0 0.25rem 0.75rem; }
#nav-menu .cwc-caret { display: none; }

/* Logo sizing (replaces inline clamp widths) */
.logo-nav    { width: clamp(130px, 35vw, 320px); }
.logo-footer { width: clamp(200px, 60vw, 350px); }

/* Phone / WhatsApp pills in the navbar */
.nav-pill-wa { background: #25D366; width: 40px; padding: 0 10px; }
.nav-pill-wa-text {
  max-width: 0; opacity: 0; margin-left: 0;
  transition: max-width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease, margin 0.45s ease;
}

/* ===== Hero (home) ===== */
/* Use small-viewport-height so the hero doesn't resize/reflow when the mobile
   address bar collapses on the first scroll (prevents first-scroll jank). */
#hero { position: relative; overflow: hidden; background: #0a2426; min-height: 100vh; min-height: 100svh; }
#hero .hero-overlay {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to right, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.55) 55%, rgba(0,0,0,0.18) 100%);
}
.hero-swiper { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.hero-swiper .swiper-slide img { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: center center; }
.hero-swiper,
.hero-swiper .swiper-wrapper,
.hero-swiper .swiper-slide { height: 100%; }

#hero .hero-title { line-height: 1.2; }
.hero-text  { line-height: 1.9; }

/* Ken Burns slide motion */
@keyframes kenburns-1 { 0% { transform: scale(1) translate(0,0); } 100% { transform: scale(1.14) translate(-2%,-2%); } }
@keyframes kenburns-2 { 0% { transform: scale(1) translate(0,0); } 100% { transform: scale(1.14) translate(2%,1%); } }
.hero-swiper .swiper-slide-active:nth-child(odd)  img { animation: kenburns-1 7s ease-in-out forwards; }
.hero-swiper .swiper-slide-active:nth-child(even) img { animation: kenburns-2 7s ease-in-out forwards; }

/* Hero content entrance (CSS fallback, runs without GSAP) */
@keyframes heroFadeUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
.hero-content > * { animation: heroFadeUp 0.9s ease forwards; }
.hero-content > *:nth-child(1) { animation-delay: 0.2s; }
.hero-content > *:nth-child(2) { animation-delay: 0.4s; }
.hero-content > *:nth-child(3) { animation-delay: 0.6s; }

/* Decorative logo shadow */
.logo-star { filter: drop-shadow(0 4px 24px rgba(0,0,0,0.18)); }

/* ===== Page hero (inner pages) ===== */
.page-hero { position: relative; background-image: url('../../images/banner.png'); background-size: cover; background-position: center; }
.page-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(10,36,38,0.92) 0%, rgba(10,36,38,0.78) 100%); }

/* ===== Treatment cards + carousel ===== */
.treatment-card { overflow: hidden; border-radius: 1.25rem; background: #fff; box-shadow: 0 4px 24px rgba(0,0,0,0.10); }
.treatment-card .card-img { overflow: hidden; }
.treatment-card .card-img img { transition: transform 0.5s ease; display: block; }
.treatment-card:hover .card-img img { transform: scale(1.05); }
.treatment-card .card-footer { background: #fff; padding: 1.1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* No side padding on the swiper itself → no partial peek of adjacent slides.
   The nav buttons live in the gutter created by .treatment-wrap padding. */
.treatmentSwiper { padding: 0; }
.treatment-wrap { position: relative; padding: 0 64px; }
@media (max-width: 639px) { .treatment-wrap { padding: 0; } .treatment-nav-btn { display: none; } }
.treatment-nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary-color, #05666c); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: background 0.2s; box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.treatment-nav-btn:hover { background: var(--primary-dark, #044d52); }
.treatment-nav-prev { left: 0; }
.treatment-nav-next { right: 0; }

/* ===== Team cards ===== */
.team-card img { transition: transform 0.4s ease; }
.team-card:hover img { transform: scale(1.04); }

/* ===== Conditions (image bg + light overlay) ===== */
.conditions-section { position: relative; background-image: url('../../images/banner.png'); background-size: cover; background-position: center; }
.conditions-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgb(255 255 255 / 78%) 0%, rgb(217 217 217 / 97%) 55%, rgb(196 196 196 / 65%) 100%); }

/* ===== Gallery (pattern bg + dark overlay) ===== */
.gallery-section { position: relative; background-color: #0a2426; background-image: url('../../images/pt.png'); background-repeat: repeat; background-size: 80px 80px; }
.gallery-overlay { position: absolute; inset: 0; background-color: rgba(13,43,43,0.92); pointer-events: none; z-index: 0; }

/* ===== Swiper theming ===== */
.swiper-button-next, .swiper-button-prev { color: var(--primary-color, #05666c) !important; }
.swiper-pagination-bullet-active { background: var(--primary-color, #05666c) !important; }
.photo-swiper .swiper-slide img { height: 560px; object-fit: cover; border-radius: 0.75rem; }
.photo-nav-arrow { color: var(--accent-color, #C8A96E); }

/* ===== Reviews ===== */
.star { color: #FBBC04; }
.google-logo { font-family: 'Product Sans', Arial, sans-serif; }

/* ===== Map ===== */
.map-frame { border: 0; }
.map-placeholder { background: #e5e7eb; border-radius: 0.75rem; }

/* ===== Floating action buttons (phone / WhatsApp) ===== */
.fab     { width: 52px; height: 52px; }
.fab-wa  { width: 52px; height: 52px; background: #25D366; }

/* ===== Service archive grid cards (services.html) ===== */
.svc-card { overflow: hidden; border-radius: 1rem; background: #fff; box-shadow: 0 4px 24px rgba(0,0,0,0.08); transition: transform 0.3s, box-shadow 0.3s; }
.svc-card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(0,0,0,0.14); }
.svc-card .img-wrap { overflow: hidden; height: 220px; }
.svc-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.svc-card:hover .img-wrap img { transform: scale(1.08); }

/* ===== Service sidebar (single service pages) ===== */
.service-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid #e5e7eb; border-radius: 10px; transition: all 0.2s; }
.service-link:hover, .service-link.active { border-color: var(--primary-color, #05666c); background: #f0fafa; }
.service-link .svc-icon { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.service-link .svc-icon img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Contact form ===== */
.form-input { width: 100%; border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 0.75rem 1rem; font-size: 0.9rem; transition: border-color 0.2s; }
.form-input:focus { outline: none; border-color: var(--primary-color, #05666c); box-shadow: 0 0 0 3px rgba(5,102,108,0.1); }

/* Contact Form 7 theming */
.cwc-cf7 .wpcf7-form p { margin: 0 0 1rem; }
.cwc-cf7 .wpcf7-form .grid p { margin: 0; }
.cwc-cf7 .cwc-submit { width: 100%; background: var(--primary-color, #05666c); color: #fff; font-weight: 600; padding: 0.85rem 1rem; border: none; border-radius: 9999px; cursor: pointer; transition: background 0.2s; }
.cwc-cf7 .cwc-submit:hover { background: var(--primary-dark, #044d52); }
.cwc-cf7 .wpcf7-spinner { margin: 0 auto; display: block; }
.cwc-cf7 .wpcf7-not-valid-tip { font-size: 0.75rem; }

/* ===== Rich text content (WYSIWYG / the_content) ===== */
.cwc-content p { margin: 0 0 1rem; }
.cwc-content h2 { font-size: 1.5rem; font-weight: 700; color: var(--heading-color, #0a2426); margin: 1.75rem 0 0.75rem; }
.cwc-content h3 { font-size: 1.2rem; font-weight: 600; color: var(--heading-color, #0a2426); margin: 1.5rem 0 0.5rem; }
.cwc-content ul { list-style: disc; padding-left: 1.25rem; margin: 0 0 1rem; }
.cwc-content ol { list-style: decimal; padding-left: 1.25rem; margin: 0 0 1rem; }
.cwc-content li { margin-bottom: 0.4rem; }
.cwc-content a { color: var(--primary-color, #05666c); text-decoration: underline; }
.cwc-content strong { color: var(--heading-color, #0a2426); }
.cwc-content blockquote { border-left: 4px solid var(--primary-color, #05666c); padding-left: 1rem; font-style: italic; color: #4b5563; margin: 0 0 1rem; }

/* ===== FAQ accordion ===== */
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.faq-item.open .faq-answer { max-height: 400px; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
