/* Mobile UX enhancements:
   - min-tap-target 44px for primary CTA on small screens
   - sticky floating section quick-nav (auto-built by script-cg-mobile.js)
   Loaded last so it can override earlier rules. */

/* ── Tap target sizing ── */
@media (max-width: 880px) {
  .cg-theme .primary-button,
  .cg-theme .secondary-button,
  .cg-theme .login-button,
  .cg-theme .language-button,
  .cg-theme .menu-button,
  .cg-theme .back-to-top,
  .cg-theme .video-trigger,
  .cg-theme .share-btn,
  .cg-theme .carousel-arrow {
    min-height: 44px;
    min-width: 44px;
  }

  .cg-theme .primary-button,
  .cg-theme .secondary-button {
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 15px;
  }

  .cg-theme .carousel-arrow {
    width: 44px;
    height: 44px;
  }

  .cg-theme .header-actions {
    gap: 8px;
  }
}

/* ── Sticky section quick-nav (mobile only) ── */
.cg-theme .mobile-section-nav {
  position: fixed;
  right: 16px;
  bottom: 84px;
  z-index: 60;
  display: none;
}

@media (max-width: 880px) {
  .cg-theme .mobile-section-nav {
    display: block;
  }
}

.cg-theme .msn-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(22, 74, 136, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.cg-theme .msn-toggle:hover {
  transform: scale(1.06);
}

.cg-theme .msn-toggle[aria-expanded="true"] {
  transform: rotate(45deg);
}

.cg-theme .msn-list {
  position: absolute;
  right: 0;
  bottom: 52px;
  width: 200px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(22, 74, 136, 0.22);
  max-height: 60vh;
  overflow-y: auto;
}

.cg-theme .msn-list[hidden] {
  display: none;
}

.cg-theme .msn-list li {
  margin: 0;
}

.cg-theme .msn-list a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s;
}

.cg-theme .msn-list a:hover,
.cg-theme .msn-list a:focus {
  background: rgba(28, 115, 255, 0.1);
  color: var(--blue-dark);
}

/* Dark theme */
.cg-theme.dark .msn-list {
  background: rgba(19, 30, 56, 0.96);
  border-color: rgba(120, 150, 200, 0.28);
}

.cg-theme.dark .msn-list a {
  color: #d7e8ff;
}

.cg-theme.dark .msn-list a:hover,
.cg-theme.dark .msn-list a:focus {
  background: rgba(28, 115, 255, 0.18);
  color: #fff;
}

/* Make sure back-to-top sits above the section-nav toggle when overlapping */
.cg-theme .back-to-top {
  z-index: 61;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cg-theme .msn-toggle {
    transition: none;
  }

  .cg-theme .msn-toggle:hover {
    transform: none;
  }

  .cg-theme .msn-toggle[aria-expanded="true"] {
    transform: none;
  }
}
