/* ============================================================
   HostMeerkat — Components CSS
   Navbar fixed behaviour, theme toggle, support widget, etc.
   Loads after theme.css.
   ============================================================ */

/* ── NAVBAR — FIXED BEHAVIOUR ────────────────────────────── */
/* Lock navbar container to the global width so per-page CSS overrides don't shift the nav */
#fixedR .container-custom {
  max-width: 1300px !important;
}

/* Align the brand mark with the homepage hero copy. */
@media (min-width: 992px) {
  #fixedR .navbar-brand {
    transform: translateX(-32px);
  }
}

#fixedR.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  transition: background 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

#fixedR.navbar.navbar-scrolled-fixed {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  background: var(--nav-bg-blur) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Ensure dropdown z-index sits above page content */
.navbar .dropdown-menu {
  z-index: 1050;
}

/* All nav links same weight so switching active item never shifts layout */
.navbar-dark .navbar-nav .nav-link {
  font-weight: 600;
}

/* Active nav-link accent */
.navbar-dark .navbar-nav .nav-link.active {
  color: #fff;
}

/* ── MOBILE OFFCANVAS BACKGROUND ────────────────────────── */
.offcanvas.offcanvas-start {
    --bs-offcanvas-bg: #0d1b30;
    /* background-color: #0d1b30 !important; */
}
body.light-mode .offcanvas.offcanvas-start {
    --bs-offcanvas-bg: var(--bg-card);
    background-color: var(--bg-card) !important;
}

/* Dark mode: nav links inside drawer should be white */
body:not(.light-mode) .offcanvas.offcanvas-start .nav-link {
    color: #fff !important;
}
/* Light mode: active nav link inside drawer should be black */
body.light-mode .offcanvas.offcanvas-start .nav-link.active {
    color: #0f172a !important;
}

/* Close button — visible on both drawer backgrounds */
body.light-mode .offcanvas-header .btn-close {
    filter: none !important;
    opacity: 0.75;
}

body:not(.light-mode) .offcanvas-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.light-mode .offcanvas-header .hmk-drawer-brand {
    color: #0f172a;
}

/* ── MOBILE OFFCANVAS FIXES ──────────────────────────────── */
@media (max-width: 991.98px) {
  .offcanvas.offcanvas-start {
    top: 0;
    width: 260px !important;
    border-right: 1px solid var(--border-color);
  }

  /* Desktop-only theme toggle hidden on mobile (separate one shown in mobile bar) */
  .navbar-dark .navbar-nav .d-none.d-lg-block { display: none !important; }

  /* Mobile action bar (theme toggle + hamburger) */
  .hmk-nav-actions { gap: 12px !important; }

  /* Drop offcanvas nav links to single column */
  .offcanvas-body .navbar-nav { flex-direction: column !important; gap: 4px; }
  .offcanvas-body .navbar-nav .nav-link { padding: 10px 16px !important; border-radius: 8px; }
  .offcanvas-body .navbar-nav .nav-link:hover { background: var(--bg-secondary); color: var(--text-primary); }
  .offcanvas-body .dropdown-menu { position: static !important; box-shadow: none; border: none; background: transparent; padding-left: 16px; }
  .offcanvas-body .dropdown-menu .dropdown-item { padding: 8px 12px; border-radius: 6px; }

  /* Login button full-width inside drawer */
  .offcanvas-body .button .btn { width: 100%; text-align: center; margin-top: 8px; }
}

/* ── LOGO DISPLAY ON MOBILE ──────────────────────────────── */
/* Show full logo on desktop, icon-only on very small screens */
@media (max-width: 400px) {
  .navbar-brand h2 { display: none !important; }
}

/* ── THEME TOGGLE BUTTON (pill slider) ───────────────────── */
.theme-toggle-btn {
  position: relative;
  width: 54px;
  height: 28px;
  border-radius: 999px;
  border: none;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  background: rgba(255,255,255,0.15);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.2);
  transition: background 0.35s ease, box-shadow 0.35s ease;
  display: inline-flex;
  align-items: center;
}

.theme-toggle-btn::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(0,0,0,0.3);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  z-index: 1;
}

.theme-toggle-btn .icon-dark,
.theme-toggle-btn .icon-light {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 1;
  transition: opacity 0.2s ease;
  z-index: 0;
  pointer-events: none;
}

/* Dark mode (default): moon visible on right */
.theme-toggle-btn .icon-dark  { right: 6px; color: rgba(255,255,255,0.75); opacity: 1; }
.theme-toggle-btn .icon-light { left: 6px;  color: #f59e0b;               opacity: 0; }

/* Light mode: sun visible, slider moved right */
body.light-mode .theme-toggle-btn {
  background: #2f86ff;
  box-shadow: inset 0 0 0 1.5px rgba(47,134,255,0.5), 0 3px 10px rgba(47,134,255,0.3);
}
body.light-mode .theme-toggle-btn::before { transform: translateX(26px); }
body.light-mode .theme-toggle-btn .icon-dark  { opacity: 0; }
body.light-mode .theme-toggle-btn .icon-light { opacity: 1; }

/* Toggler border */
.navbar-toggler {
  padding: 4px 8px !important;
  border-color: rgba(255,255,255,0.2) !important;
}
body.light-mode .navbar-toggler {
  border-color: rgba(0,0,0,0.2) !important;
}
body.light-mode .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%230f172a' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* ── SUPPORT WIDGET ──────────────────────────────────────── */
.support-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  font-family: 'Poppins', sans-serif;
}

.support-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1873d3, #3b82f6);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(24,115,211,0.4);
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  z-index: 2;
}

.support-button:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(24,115,211,0.5);
}

.support-button.active { transform: scale(0.95); }

.support-open-icon,
.support-close-icon {
  position: absolute;
  font-size: 1.5rem;
  transition: opacity 0.25s ease, transform 0.25s ease;
  line-height: 1;
}

.support-open-icon  { opacity: 1; transform: scale(1); }
.support-close-icon { opacity: 0; transform: scale(0.5); color: #fff; font-weight: 700; font-size: 1.6rem; }

.support-button.active .support-open-icon  { opacity: 0; transform: scale(0.5); }
.support-button.active .support-close-icon { opacity: 1; transform: scale(1); }

/* Notification dot */
.support-button::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  animation: pulse-dot 2s ease-in-out infinite;
}
.support-button.active::before { display: none; }

/* Popup */
.support-popup {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 320px;
  background: #1a1c1e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}

.support-popup.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.support-header {
  background: linear-gradient(135deg, #1873d3, #3b82f6);
  padding: 20px;
  text-align: center;
  color: #fff;
}

.support-head-icon { font-size: 2rem; margin-bottom: 6px; }
.support-header span { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; display: block; }
.support-header h2   { font-size: 1.3rem; font-weight: 800; margin: 4px 0; }
.support-header p    { font-size: 0.82rem; opacity: 0.85; margin: 0; line-height: 1.5; }

.support-options { padding: 12px; display: flex; flex-direction: column; gap: 8px; }

.support-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}

.support-item:hover { transform: translateX(4px); }
.support-item.whatsapp:hover { background: rgba(37,211,102,0.10); border-color: rgba(37,211,102,0.2); }
.support-item.ticket:hover   { background: rgba(24,115,211,0.10); border-color: rgba(24,115,211,0.2); }

.support-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(37,211,102,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}
.support-icon-box img { width: 24px; height: 24px; }
.support-icon-box .fa-whatsapp { font-size: 1.5rem; color: #25d366; }

.ticket-box {
  background: rgba(24,115,211,0.12) !important;
  font-size: 1.1rem !important;
}

.support-text { flex: 1; }
.support-text strong { display: block; font-size: 0.88rem; font-weight: 700; color: #ffffff; }
.support-text small  { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

.support-arrow { color: rgba(255,255,255,0.35); font-size: 1.3rem; font-weight: 700; }

.support-footer {
  padding: 10px 16px;
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  border-top: 1px solid rgba(255,255,255,0.05);
}

@media (max-width: 480px) {
  .support-widget { bottom: 20px; right: 16px; }
  .support-popup  { width: calc(100vw - 32px); right: 0; }
  .support-button { width: 52px; height: 52px; }
}

/* Light mode — support popup */
body.light-mode .support-popup {
  background: #ffffff;
  border-color: rgba(0,0,0,0.10);
}
body.light-mode .support-item {
  border-color: rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.02);
}
body.light-mode .support-text strong { color: #0f172a; }
body.light-mode .support-text small  { color: rgba(0,0,0,0.4); }
body.light-mode .support-arrow       { color: rgba(0,0,0,0.25); }
body.light-mode .support-footer {
  color: rgba(0,0,0,0.35);
  border-top-color: rgba(0,0,0,0.06);
}

/* ── FOOTER (global refined styles) ─────────────────────── */
.footer-wrap {
  background: #030712;
  position: relative;
  padding-top: 5rem;
  overflow: hidden;
}

.footer-horizon {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47,134,255,0.6), rgba(139,92,246,0.6), transparent);
  box-shadow: 0 0 30px 2px rgba(47,134,255,0.4);
}

.footer_links h4 {
  color: #f8fafc;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer_links ul { list-style: none; padding: 0; margin: 0; }
.footer_links ul li { margin-bottom: 1rem; }
.footer_links ul li a {
  color: #64748b;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
}
.footer_links ul li a:hover {
  color: #e2e8f0;
  transform: translateX(4px);
}

.footer_about p {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-top: 1.5rem;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34,208,126,0.1);
  border: 1px solid rgba(34,208,126,0.2);
  padding: 8px 16px;
  border-radius: 50px;
  color: #22d07e;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 1.5rem;
}

.footer-status .pulse {
  background: #22d07e;
  box-shadow: 0 0 10px #22d07e;
}

.footer_bottom {
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 4rem;
  padding: 2rem 0;
  background: rgba(0,0,0,0.2);
}

.footer_bottom p { color: #475569; font-size: 0.9rem; font-weight: 500; }

/* Mobile footer */
@media (max-width: 768px) {
  .footer-wrap .footer_links,
  .footer-wrap .footer_links .row,
  .footer-wrap .footer_links .row > div,
  .footer-wrap .col-lg-8,
  .footer-wrap .col-md-4,
  .footer-wrap .col-sm-6,
  .footer-wrap .col-lg-4,
  .footer-wrap .col-md-12 {
    text-align: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .footer-wrap .footer_links ul {
    padding: 0 !important; margin: 0 !important;
    list-style: none !important; text-align: center !important; width: 100% !important;
  }

  .footer-wrap .footer_links ul li {
    display: block !important; text-align: center !important;
    width: 100% !important; padding: 0 !important; line-height: 2.2 !important;
  }

  .footer-wrap .footer_links ul li a {
    display: block !important; text-align: center !important;
    width: 100% !important; padding: 0 !important; position: static !important;
  }

  .footer-wrap .footer_links ul li a::before,
  .footer-wrap .footer_links ul li a:hover { transform: none !important; }

  .footer-wrap .footer_links h4 { text-align: center !important; }

  .footer-wrap .footer_about {
    text-align: center !important;
    margin-top: 1rem !important;
  }

  .footer-wrap .footer_about .d-flex { justify-content: center !important; }

  .footer-wrap .footer_about p {
    margin: 1rem auto 0 !important;
    max-width: 320px;
    text-align: center !important;
  }

  .footer-wrap .footer-status { margin: 1.2rem auto 0 !important; }

  .footer-wrap .footer_bottom .row {
    text-align: center !important;
    gap: 1rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .stats-row { display: block; }
  .stat-box  { margin-bottom: 15px; display: block; }
}

/* ── OFFCANVAS Z-INDEX FIX ───────────────────────────────── */
@media (max-width: 991px) {
  .offcanvas         { z-index: 2000 !important; }
  .offcanvas-backdrop { z-index: 1999 !important; }
  .header, .web-hero-bg, .object_1, .sale_banner { z-index: auto !important; }
}
