/* CCA Emirates — shared styles */

:root {
  --navy: #14284b;
  --navy-dark: #0d1c37;
  --yellow: #f9db0f;
  --white: #ffffff;
  --off-white: #f5f6f8;
  --text: #1c1c1c;
  --max-width: 1200px;
  --font: "Poppins", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Accessibility: skip link + focus visibility */
.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 4px;
  z-index: 10000;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

a { text-decoration: none; color: inherit; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 { color: var(--navy); font-weight: 700; margin: 0 0 16px; }
h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 16px; }

.btn {
  display: inline-block;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: opacity .2s ease;
}
.btn:hover { opacity: .85; }

.btn-outline {
  display: inline-block;
  border: 2px solid var(--navy);
  color: var(--navy);
  font-weight: 700;
  padding: 10px 26px;
  border-radius: 4px;
}
.btn-outline:hover { background: var(--navy); color: var(--white); }

/* Header */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow .25s ease;
}
.site-header.is-scrolled { box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.site-header.is-scrolled .header-inner { padding-top: 6px; padding-bottom: 6px; }
.site-header.is-scrolled .logo img { height: 46px; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.logo img { height: 60px; transition: height .25s ease; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.main-nav > ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--white);
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--yellow); }
.main-nav a.active { color: var(--yellow); }

.has-dropdown { position: relative; }
.dropdown {
  display: none;
  list-style: none;
  margin: 0;
  position: absolute;
  top: 100%;
  left: 0;
  width: 320px;
  background: var(--white);
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
  border-radius: 0 0 4px 4px;
  padding: 8px 0;
}
.has-dropdown.open .dropdown { display: block; }
.dropdown li a {
  color: var(--navy);
  display: block;
  padding: 10px 20px;
  font-weight: 500;
  white-space: normal;
}
.dropdown li a:hover { background: var(--off-white); color: var(--navy); }

.header-icons {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-icons a { color: var(--white); display: flex; align-items: center; }
.header-icons a:hover { color: var(--yellow); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.6rem;
  cursor: pointer;
}

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: min(320px, 85vw);
    background: var(--navy);
    flex-direction: column;
    align-items: flex-start;
    padding: 90px 24px 24px;
    gap: 20px;
    transform: translateX(100%);
    transition: transform .3s ease;
    overflow-y: auto;
    z-index: 300;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; gap: 16px; width: 100%; }
  .header-icons { flex-wrap: wrap; }
  .dropdown { position: static; box-shadow: none; background: var(--navy-dark); display: none; border-radius: 4px; }
  .has-dropdown.open .dropdown { display: block; }
  .dropdown li a { color: var(--white); }

  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    /* Must stay below .site-header's own z-index (100) — .main-nav's
       z-index:300 only applies within .site-header's stacking context
       (since .site-header is itself a positioned, z-indexed element), so
       comparing against elements outside that header uses the header's
       z-index, not the drawer's. A higher value here silently sits on
       top of the whole open drawer and swallows every click. */
    z-index: 90;
  }
  .nav-backdrop.open { display: block; }
}

/* Cover banner */
.cover-banner {
  background: var(--navy);
  line-height: 0;
}
.cover-banner img { width: 100%; height: auto; display: block; }

/* Section */
.section { padding: 70px 0; }
.section-alt { background: var(--off-white); }
.section-navy { background: var(--navy); color: var(--white); }
.section-navy h1, .section-navy h2, .section-navy h3 { color: var(--white); }
.section-header { text-align: center; max-width: 720px; margin: 0 auto 40px; }

/* Two-column layout used across intro / coaching / coaches / rhino / newsletter */
.two-col {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
.two-col.reverse { flex-direction: row-reverse; }
.two-col .col-main { flex: 1 1 0; min-width: 0; }
.two-col .col-side { flex: 1 1 0; min-width: 0; }
.two-col .col-side img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  border-radius: 8px;
}
.subtitle { font-weight: 600; color: var(--navy); }
.eyebrow { text-transform: uppercase; font-weight: 700; letter-spacing: .04em; font-size: .85rem; color: var(--navy); margin-bottom: 4px; }

@media (max-width: 860px) {
  .two-col, .two-col.reverse { flex-direction: column; }
  .two-col .col-side img { min-height: 220px; }
}

/* Events */
.events-placeholder {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 30px 20px;
  text-align: center;
  color: #777;
}
.section-navy .events-placeholder,
.col-side .events-placeholder { border-color: rgba(255,255,255,.3); color: #cfd4e0; }

/* Cards (horizontal scroll carousel style) */
.card-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.card-scroll .card {
  scroll-snap-align: start;
  flex: 0 0 300px;
}
.card {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid transparent;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--yellow);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.card img { height: 180px; object-fit: cover; width: 100%; }
.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-body p { flex: 1; color: #444; font-size: .95rem; }
.card-body a.read-more { color: var(--navy); font-weight: 700; }
.card-body a.read-more:hover { color: var(--yellow); }

/* Social banner */
.social-banner {
  background: var(--navy);
  color: var(--white);
  text-align: center;
  padding-top: 50px;
}
.social-banner h2 { color: var(--white); margin-bottom: 30px; }
.social-banner-img { width: 100%; height: auto; display: block; }

/* Forms */
form.site-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}
form.site-form.newsletter { max-width: 700px; }
form.site-form .full { grid-column: 1 / -1; }
form.site-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: .9rem;
}
form.site-form input,
form.site-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: var(--font);
  font-size: 1rem;
}
form.site-form textarea { resize: vertical; min-height: 120px; }
form.site-form .form-note {
  grid-column: 1 / -1;
  font-size: .8rem;
  color: #666;
}
form.site-form .form-status {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 16px;
  border-radius: 4px;
  font-weight: 600;
  font-size: .9rem;
}
form.site-form .form-status.success { background: #e6f7ec; color: #1a7a3d; }
form.site-form .form-status.error { background: #fdecec; color: #b3261e; }
@media (max-width: 640px) {
  form.site-form { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer {
  background: var(--navy-dark);
  color: #cfd4e0;
  padding: 50px 0 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}
.footer-grid h3 { color: var(--white); font-size: 1.05rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a:hover { color: var(--yellow); }
.footer-icons { display: flex; gap: 14px; margin-top: 10px; }
.footer-icons a { color: var(--white); display: flex; align-items: center; }
.footer-icons a:hover { color: var(--yellow); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .85rem;
}
.footer-bottom a:hover { color: var(--yellow); }

/* Floating action buttons — stacked vertically, bottom-right.
   Order (bottom to top): WhatsApp, Chat, Instagram. */
:root {
  --float-size: 56px;
  --float-gap: 14px;
  --float-offset: 24px;
}

.whatsapp-float,
.chat-launcher,
.instagram-float {
  position: fixed;
  right: var(--float-offset);
  width: var(--float-size);
  height: var(--float-size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  z-index: 200;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.whatsapp-float:hover,
.chat-launcher:hover,
.instagram-float:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
}

.whatsapp-float {
  bottom: var(--float-offset);
  background: #25d366;
  color: var(--white);
}

.chat-launcher {
  bottom: calc(var(--float-offset) + 1 * (var(--float-size) + var(--float-gap)));
  background: var(--yellow);
  color: var(--navy);
}
.chat-launcher:hover { background: #e0c50d; }

.instagram-float {
  bottom: calc(var(--float-offset) + 2 * (var(--float-size) + var(--float-gap)));
  background: linear-gradient(45deg, #f9ce34, #ee2a7b 60%, #6228d7);
  color: var(--white);
}

/* Sticky mobile "Book Now" bar */
.mobile-book-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 199;
  background: var(--navy);
  padding: 10px 16px;
  gap: 12px;
  align-items: center;
  box-shadow: 0 -4px 16px rgba(0,0,0,.2);
}
.mobile-book-bar a[href^="tel:"] {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mobile-book-bar .btn { flex: 1; text-align: center; }

@media (max-width: 768px) {
  .mobile-book-bar { display: flex; }
  body { padding-bottom: 68px; }
  :root {
    --float-size: 42px;
    --float-gap: 10px;
    --float-offset: 84px;
  }
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .gallery-grid button { border-radius: 4px; }
}
.gallery-grid button {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: block;
}
.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.gallery-grid button:hover img { transform: scale(1.06); }

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(13,28,55,.92);
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

/* Map embed */
.map-embed {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.map-embed iframe { display: block; }

/* Simple inner page hero for subpages */
.page-hero {
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  color: var(--white);
  padding: 70px 0;
  text-align: center;
}
.page-hero h1 { color: var(--white); margin: 0; }

/* Accordion (FAQ) */
.accordion { margin-top: 8px; border-top: 1px solid #e4e4e4; }
.accordion-item { border-bottom: 1px solid #e4e4e4; }
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: none;
  border: none;
  text-align: left;
  padding: 18px 4px;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
}
.accordion-trigger .chevron {
  flex-shrink: 0;
  font-size: .8rem;
  color: var(--navy);
  transition: transform .25s ease;
}
.accordion-trigger[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.accordion-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s ease;
}
.accordion-panel p { margin: 0; padding: 0 4px 18px; color: #444; }

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .4s ease;
}
.preloader.is-hidden { opacity: 0; pointer-events: none; }
.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.preloader-logo {
  width: 130px;
  height: auto;
  animation: preloaderPulse 1.6s ease-in-out infinite;
}
.preloader-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: var(--yellow);
  animation: preloaderSpin .8s linear infinite;
}
@keyframes preloaderSpin { to { transform: rotate(360deg); } }
@keyframes preloaderPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* Carousel arrows + dots (service cards) */
.carousel-wrap { position: relative; }
.carousel-arrow {
  position: absolute;
  top: 90px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid #ddd;
  box-shadow: 0 4px 10px rgba(0,0,0,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: var(--navy);
  font-size: 1.1rem;
}
.carousel-arrow:hover { background: var(--yellow); border-color: var(--yellow); }
.carousel-arrow.prev { left: -8px; }
.carousel-arrow.next { right: -8px; }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}
.carousel-dots button {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: #d6d6d6;
  cursor: pointer;
  padding: 0;
}
.carousel-dots button.active { background: var(--navy); }
@media (max-width: 700px) {
  .carousel-arrow { display: none; }
}

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Breadcrumbs */
.breadcrumbs {
  background: var(--off-white);
  padding: 14px 0;
  font-size: .85rem;
}
.breadcrumbs a { color: var(--navy); font-weight: 600; }
.breadcrumbs a:hover { color: var(--yellow); }
.breadcrumbs .sep { margin: 0 8px; color: #999; }
.breadcrumbs .current { color: #666; }

/* Chat widget panel (launcher itself is styled with the other floats above) */
.chat-panel {
  position: fixed;
  bottom: calc(var(--float-offset) + 3 * (var(--float-size) + var(--float-gap)));
  right: var(--float-offset);
  width: min(360px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 140px));
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 210;
}
.chat-panel.open { display: flex; }
.chat-header {
  background: var(--navy);
  color: var(--white);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-header h3 { color: var(--white); margin: 0; font-size: 1rem; }
.chat-close { background: none; border: none; color: var(--white); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 4px; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--off-white);
}
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: .9rem; line-height: 1.45; }
.chat-msg.bot { background: var(--white); color: var(--text); align-self: flex-start; border-bottom-left-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.chat-msg.user { background: var(--navy); color: var(--white); align-self: flex-end; border-bottom-right-radius: 2px; }
.chat-msg.typing { font-style: italic; color: #888; background: none; box-shadow: none; }
.chat-translate-btn {
  display: block;
  margin-top: 6px;
  padding: 0;
  border: none;
  background: none;
  color: #888;
  font-size: .75rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.chat-msg.bot .chat-translate-btn:hover { color: var(--navy); }
.chat-translate-btn:disabled { cursor: default; opacity: .6; }
.chat-msg-translation {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,.08);
  color: #555;
  font-size: .85rem;
  font-style: italic;
}
.chat-form { display: flex; border-top: 1px solid #e2e2e2; flex-shrink: 0; }
.chat-form input {
  flex: 1;
  border: none;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: .9rem;
}
.chat-form input:focus { outline: none; }
.chat-form button {
  background: var(--yellow);
  color: var(--navy);
  border: none;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
}
.chat-form button:disabled { opacity: .6; cursor: default; }

/* Mobile: stays a compact floating panel (not a full-screen takeover) —
   just resized to fit smaller screens, with a tighter right inset than
   the icon stack so it reads as its own corner widget. */
@media (max-width: 640px) {
  .chat-panel {
    right: 16px;
    width: min(320px, calc(100vw - 32px));
    /* Cap height by actual available space (viewport minus the icon-stack
       clearance below and the sticky header above) so it can never creep
       under the header on short screens — not a flat vh guess. */
    height: min(420px, calc(100vh - var(--float-offset) - 3 * (var(--float-size) + var(--float-gap)) - 92px));
  }
}
