﻿/* Mobile-first hardening pass for all pages */
@media (max-width: 991.98px) {
  html,
  body {
    overflow-x: clip;
  }

  .container,
  .container-sm,
  .container-md,
  .container-lg,
  .container-xl,
  .container-xxl {
    padding-inline: 0.85rem !important;
  }

  .brand-logo {
    width: min(140px, 42vw);
    height: auto;
    max-height: 48px;
  }

  .mobile-actions {
    gap: 0.45rem !important;
  }

  .mobile-actions .cta-btn {
    max-width: 66vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .navbar-collapse {
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
  }

  main > section:not(.hero-section) {
    margin-inline: 0.5rem;
    border-radius: 16px;
  }

  .section-padding {
    padding-top: 3.6rem !important;
    padding-bottom: 3.6rem !important;
  }

  .hero-content {
    width: min(100%, 96vw);
  }

  .hero-actions .hero-btn {
    width: 100%;
    min-width: 0;
  }

  .home-calc-result .result-grid {
    grid-template-columns: 1fr;
  }

  .site-footer .footer-grid,
  .modern-footer .footer-grid {
    row-gap: 1.2rem !important;
  }

  .site-footer .footer-contact-list div,
  .modern-footer .footer-contact-list div {
    align-items: flex-start;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 767.98px) {
  h1 {
    line-height: 1.22;
  }

  .hero-section {
    min-height: calc(74svh - var(--nav-height, 76px)) !important;
  }

  body.home-page .hero-section {
    min-height: 74svh !important;
  }

  .hero-content {
    padding: 0.9rem 0.85rem !important;
    border-radius: 14px !important;
  }

  .hero-title {
    font-size: clamp(1.65rem, 8.3vw, 2.45rem) !important;
  }

  .hero-subtitle {
    font-size: 0.97rem !important;
    margin-bottom: 1rem !important;
  }

  /* Services orbit: convert to list grid on phones */
  .circle-layout {
    min-height: auto !important;
    display: block !important;
    padding: 0.35rem !important;
  }

  .circle-ring {
    display: none !important;
  }

  .center-content {
    width: 100% !important;
    height: auto !important;
    border-radius: 16px !important;
    padding: 1rem 0.9rem !important;
    margin-bottom: 0.65rem;
  }

  .center-content p {
    max-width: none;
    font-size: 1rem;
  }

  .orbit-track {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    animation: none !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .service-bubble {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    min-height: 64px;
    border-radius: 14px !important;
    display: block;
    padding: 0.5rem;
    align-items: center !important;
  }

  .bubble-content {
    animation: none !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 0.45rem !important;
  }

  .bubble-content i {
    font-size: 1.1rem !important;
  }

  .bubble-content span {
    font-size: 0.9rem !important;
  }

  /* Unified circle: force stacked layout and kill absolute nodes */
  .unified-panel .unified-circle-wrap {
    min-height: auto !important;
    padding: 0.8rem !important;
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    overflow: visible !important;
  }

  .unified-panel .circle-core {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    margin-bottom: 0.5rem;
  }

  .unified-panel .circle-core h4 {
    font-size: clamp(1.3rem, 5.6vw, 1.75rem) !important;
  }

  .unified-panel .circle-core p {
    font-size: 0.95rem !important;
    line-height: 1.75 !important;
  }

  .unified-panel .circle-ring-dotted {
    display: none !important;
  }

  .unified-panel .circle-node {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 14px !important;
    margin-top: 0.58rem;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 0.52rem;
    padding: 0.8rem 0.92rem !important;
    text-align: start !important;
    min-height: 68px;
  }

  .unified-panel .circle-node i {
    font-size: 1.2rem !important;
  }

  .unified-panel .circle-node span {
    margin-top: 0 !important;
    font-size: 0.9rem !important;
  }

  .unified-panel .circle-node:hover,
  .unified-panel .circle-node.active {
    transform: none !important;
  }

  .news-hero-actions .btn,
  .news-toolbar-controls .btn,
  .subscribe-form .cta-btn {
    width: 100%;
  }

  .floating-whatsapp {
    padding: 0.5rem 0.8rem !important;
    font-size: 0.88rem !important;
    bottom: 14px !important;
    left: 12px !important;
  }

  .floating-top {
    bottom: 14px !important;
    right: 12px !important;
  }

  .global-quote-fab {
    right: 10px !important;
    left: 10px !important;
    bottom: 64px !important;
    min-height: 44px !important;
    text-align: center;
    justify-content: center;
    font-size: 0.82rem !important;
    display: flex !important;
    align-items: center !important;
  }
}

@media (max-width: 430px) {
  .orbit-track {
    grid-template-columns: 1fr !important;
  }

  .mobile-actions .cta-btn {
    max-width: 60vw;
    font-size: 0.8rem !important;
  }

  .hero-title {
    font-size: clamp(1.5rem, 9.2vw, 2.1rem) !important;
  }

  .unified-panel .unified-circle-wrap {
    padding: 0.6rem !important;
  }

  .unified-panel .circle-node {
    padding: 0.72rem 0.78rem !important;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .container-xxl {
    padding-inline: 1rem !important;
  }

  .takaful-navbar .nav-link {
    font-size: 0.93rem;
    padding-inline: 0.45rem !important;
  }

  .takaful-navbar .nav-actions {
    gap: 0.55rem !important;
  }

  .takaful-navbar .cta-btn {
    font-size: 0.88rem;
    padding-inline: 0.85rem !important;
  }
}

@media (min-width: 1200px) {
  .container-xxl {
    padding-inline: 1.25rem !important;
  }

  .hero-content,
  .news-fluid {
    max-width: 1400px;
    margin-inline: auto;
  }
}

