/* ============================================
   MAJESTIC HEALTH - CRITICAL OVERRIDES
   This file MUST be loaded LAST
   All rules use maximum specificity
   ============================================ */

/* ===== TOP BAR ===== */
html body .top-bar {
    position: relative !important;
    z-index: 1000 !important;
    background: #fff !important;
}

/* ===== MAIN HEADER ===== */
html body .header {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    background: #fff !important;
}

/* ===== STICKY SECTION NAV ===== */
html body .section-nav {
    display: block !important;
    position: fixed !important;
    top: -100px !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9990 !important;
    background: rgba(255,255,255,0.98) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08) !important;
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: auto !important;
}

html body .section-nav.is-visible {
    top: 70px !important;
}

html body .section-nav__inner {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 16px 0 !important;
}

html body .section-nav__links {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px 40px !important;
    background:
        linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 5%),
        linear-gradient(to left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 5%),
        linear-gradient(to right, rgba(212,72,142,0.15) 0%, rgba(212,72,142,0) 3%),
        linear-gradient(to left, rgba(212,72,142,0.15) 0%, rgba(212,72,142,0) 3%) !important;
    background-position: left center, right center, left center, right center !important;
    background-repeat: no-repeat !important;
    background-size: 50px 100%, 50px 100%, 30px 100%, 30px 100% !important;
    background-attachment: local, local, scroll, scroll !important;
}

html body .section-nav__links::-webkit-scrollbar {
    display: none !important;
}

html body .section-nav__link {
    padding: 10px 18px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #555 !important;
    text-decoration: none !important;
    border-radius: 25px !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

html body .section-nav__link:hover {
    color: #d4488e !important;
    background: rgba(212, 72, 142, 0.08) !important;
}

html body .section-nav__link.active {
    color: #fff !important;
    background: linear-gradient(135deg, #d4488e 0%, #b03a78 100%) !important;
}

/* ===== CONSULTATION FEATURES ===== */
html body .consultation__features {
    list-style: none !important;
    padding: 0 !important;
    margin: 24px 0 !important;
}

html body .consultation__features li {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
    font-size: 15px !important;
    color: #555 !important;
}

html body .consultation__features li svg {
    flex-shrink: 0 !important;
    color: #d4488e !important;
}

/* ===== CONSULTATION FORM - Compact ===== */
html body .consultation__form {
    padding: 28px 32px !important;
    max-width: 480px !important;
}

html body .consultation__form h3 {
    font-size: 1.5rem !important;
    margin-bottom: 20px !important;
}

html body .form-group {
    margin-bottom: 14px !important;
}

html body .form-label {
    font-size: 13px !important;
    margin-bottom: 4px !important;
}

html body .form-input,
html body .form-select {
    padding: 10px 14px !important;
    font-size: 14px !important;
}

html body .form-upload {
    padding: 20px !important;
    min-height: auto !important;
    border: 2px dashed #ddd !important;
    border-radius: 12px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

html body .form-upload:hover {
    border-color: #d4488e !important;
    background: rgba(212, 72, 142, 0.02) !important;
}

/* Upload Section Variants */
html body .form-upload__title {
    font-size: 14px !important;
    color: #333 !important;
    margin-bottom: 12px !important;
}

html body .form-upload__angles {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
}

html body .form-upload__angles--3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

html body .form-upload__angles--2 {
    grid-template-columns: repeat(2, 1fr) !important;
    max-width: 200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

html body .form-upload__angle {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 10px 4px !important;
    background: #f8f8f8 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

html body .form-upload__angle:hover {
    background: #f0e8f0 !important;
}

html body .form-upload__angle-icon {
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    border-radius: 50% !important;
    color: #d4488e !important;
}

html body .form-upload__angle span {
    font-size: 10px !important;
    color: #666 !important;
    font-weight: 500 !important;
}

html body .form-upload__hint {
    font-size: 11px !important;
    color: #888 !important;
    margin: 0 !important;
}

html body .consultation__form .btn-lg {
    padding: 14px 24px !important;
    font-size: 15px !important;
}

/* ===== WHATSAPP FLOATER - ALWAYS ON TOP ===== */
html body .whatsapp-float,
html body .whatsapp-button,
html body [class*="whatsapp"],
html body a[href*="wa.me"] {
    z-index: 99999 !important;
}

/* Common WhatsApp float button class */
html body .whatsapp-float {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 99999 !important;
}

/* ===== DESKTOP (1025px and above) ===== */
@media screen and (min-width: 1025px) {
    html body .top-bar {
        display: block !important;
    }

    html body #menuToggle,
    html body .header__menu-toggle {
        display: none !important;
    }

    html body #mobileCallBtn,
    html body #mobileCtaBtn,
    html body .header__mobile-call,
    html body .header__mobile-cta {
        display: none !important;
    }

    html body .mobile-nav,
    html body .mobile-nav__overlay {
        display: none !important;
    }

    html body .section-nav.is-visible {
        top: 70px !important;
    }
}

/* ===== TABLET/MOBILE (1024px and below) ===== */
@media screen and (max-width: 1024px) {
    /* Hide top bar */
    html body .top-bar {
        display: none !important;
    }

    /* Header sticky */
    html body .header {
        position: sticky !important;
        top: 0 !important;
        background: #fff !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    }

    html body .header__inner {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 0 !important;
    }

    /* Logo */
    html body .header__logo-img {
        height: 36px !important;
    }

    /* Hide desktop nav */
    html body nav.nav,
    html body .nav,
    html body .nav__links,
    html body .nav__mega-menu {
        display: none !important;
    }

    /* HEADER ACTIONS - MUST BE VISIBLE */
    html body #headerActions,
    html body .header__actions {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        margin-left: auto !important;
    }

    /* MOBILE CALL BUTTON */
    html body #mobileCallBtn,
    html body a.header__mobile-call,
    html body .header__mobile-call {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        color: #d4488e !important;
        background: transparent !important;
        border: none !important;
    }

    html body .header__mobile-call svg {
        width: 22px !important;
        height: 22px !important;
    }

    /* MOBILE CTA BUTTON */
    html body #mobileCtaBtn,
    html body a.header__mobile-cta,
    html body .header__mobile-cta {
        display: inline-flex !important;
        padding: 10px 16px !important;
        background: linear-gradient(135deg, #d4488e 0%, #b03a78 100%) !important;
        color: #fff !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        white-space: nowrap !important;
    }

    /* LANGUAGE SWITCHER */
    html body #langSwitcher,
    html body .lang-switcher {
        display: flex !important;
        align-items: center !important;
    }

    html body .lang-switcher__toggle {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        background: none !important;
        border: none !important;
        cursor: pointer !important;
        padding: 6px !important;
    }

    html body .lang-switcher__toggle span {
        display: none !important;
    }

    html body .lang-switcher__flag {
        width: 28px !important;
        height: 20px !important;
        border-radius: 3px !important;
        object-fit: cover !important;
    }

    /* ===== BURGER MENU - NUCLEAR FIX ===== */
    html body #menuToggle,
    html body button#menuToggle,
    html body .header #menuToggle,
    html body .header__inner #menuToggle,
    html body .header__menu-toggle,
    html body button.header__menu-toggle,
    html body .header .header__menu-toggle,
    html body .header__inner .header__menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 5px !important;
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        max-width: 48px !important;
        max-height: 48px !important;
        background-color: #f5f5f5 !important;
        border: none !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        padding: 12px !important;
        margin-left: 8px !important;
        position: relative !important;
        z-index: 10000 !important;
        overflow: visible !important;
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
    }

    html body #menuToggle:hover,
    html body .header__menu-toggle:hover {
        background-color: #e8e8e8 !important;
    }

    html body #menuToggle span,
    html body button#menuToggle span,
    html body .header__menu-toggle span,
    html body button.header__menu-toggle span {
        display: block !important;
        visibility: visible !important;
        width: 22px !important;
        height: 2px !important;
        min-height: 2px !important;
        max-height: 2px !important;
        background-color: #333333 !important;
        border-radius: 2px !important;
        transition: all 0.3s ease !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Burger animation when active */
    html body .header__menu-toggle.is-active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px) !important;
    }

    html body .header__menu-toggle.is-active span:nth-child(2) {
        opacity: 0 !important;
    }

    html body .header__menu-toggle.is-active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px) !important;
    }

    /* Section nav tablet position */
    html body .section-nav {
        display: block !important;
    }

    html body .section-nav.is-visible {
        top: 56px !important;
    }

    html body .section-nav__inner {
        padding: 14px 0 !important;
    }

    html body .section-nav__links {
        padding: 4px 30px !important;
        gap: 4px !important;
    }

    html body .section-nav__link {
        padding: 8px 14px !important;
        font-size: 12px !important;
    }

    /* Form responsive */
    html body .consultation__form {
        padding: 24px !important;
    }

    /* CENTER ALIGN CONSULTATION FEATURES - PROPER FIX */
    html body .consultation__content {
        text-align: center !important;
    }

    html body .consultation__content h2 {
        text-align: center !important;
    }

    html body .consultation__content p {
        text-align: center !important;
    }

    html body .consultation__features {
        display: inline-flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    html body .consultation__features li {
        justify-content: flex-start !important;
    }

    html body .consultation .section-badge {
        display: inline-block !important;
    }

    /* Upload angles responsive */
    html body .form-upload__angles {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }

    html body .form-upload__angle {
        padding: 8px 2px !important;
    }

    html body .form-upload__angle-icon {
        width: 32px !important;
        height: 32px !important;
    }

    html body .form-upload__angle span {
        font-size: 9px !important;
    }
}

/* ===== MOBILE PHONE (480px and below) ===== */
@media screen and (max-width: 480px) {
    html body .header__logo-img {
        height: 30px !important;
    }

    html body #mobileCtaBtn,
    html body .header__mobile-cta {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }

    html body .header__mobile-call svg {
        width: 20px !important;
        height: 20px !important;
    }

    html body .lang-switcher__flag {
        width: 24px !important;
        height: 16px !important;
    }

    /* BURGER MENU - MOBILE SIZE */
    html body #menuToggle,
    html body .header__menu-toggle {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        max-width: 44px !important;
        max-height: 44px !important;
        padding: 10px !important;
        margin-left: 6px !important;
    }

    html body #menuToggle span,
    html body .header__menu-toggle span {
        width: 20px !important;
    }

    html body .section-nav.is-visible {
        top: 50px !important;
    }

    html body .section-nav__link {
        padding: 6px 12px !important;
        font-size: 11px !important;
    }

    html body .consultation__form {
        padding: 20px 16px !important;
    }

    html body .consultation__form h3 {
        font-size: 1.25rem !important;
    }

    /* Upload angles on small screens - centered */
    html body .form-upload__angles {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        justify-content: center !important;
        justify-items: center !important;
        max-width: 280px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    html body .form-upload__angles--3 {
        grid-template-columns: repeat(3, 1fr) !important;
        max-width: 320px !important;
    }

    html body .form-upload__angles--2 {
        grid-template-columns: repeat(2, 1fr) !important;
        max-width: 220px !important;
    }

    html body .form-upload__angle {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
}

/* ===== MOBILE NAV PANEL ===== */
html body .mobile-nav {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 300px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #fff !important;
    z-index: 100001 !important;
    padding: 80px 24px 24px !important;
    transition: right 0.3s ease !important;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1) !important;
    overflow-y: auto !important;
}

html body .mobile-nav.is-open {
    right: 0 !important;
}

html body .mobile-nav__overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0,0,0,0.5) !important;
    z-index: 100000 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s !important;
}

html body .mobile-nav__overlay.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
}

html body .mobile-nav__close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 40px !important;
    height: 40px !important;
    background: #f5f5f5 !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

html body .mobile-nav__cta {
    display: block !important;
    margin-top: 20px !important;
    text-align: center !important;
    padding: 14px !important;
    background: linear-gradient(135deg, #d4488e 0%, #b03a78 100%) !important;
    color: #fff !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

/* Hide mobile nav on desktop */
@media screen and (min-width: 1025px) {
    html body .mobile-nav,
    html body .mobile-nav__overlay {
        display: none !important;
    }
}

/* ===== CRITICAL: Body scroll lock fix ===== */
html body.menu-open {
    overflow: hidden !important;
}

html body:not(.menu-open) {
    overflow-x: hidden !important;
}

/* ===== FOOTER Z-INDEX ===== */
html body .footer {
    position: relative !important;
    z-index: 100 !important;
}

/* ===== CTA SECTION Z-INDEX ===== */
html body .cta-section {
    position: relative !important;
    z-index: 100 !important;
}

/* ===== main content ===== */
html body main {
    position: relative !important;
    z-index: 1 !important;
}

/* ===== SITE FOOTER GRID - RESPONSIVE (769px - 1024px): 4 columns ===== */
@media screen and (max-width: 1024px) and (min-width: 769px) {
    html body .site-footer__grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 24px !important;
    }
    html body .site-footer__grid > *:nth-child(1) {
        grid-column: 1 / 5 !important;
        grid-row: 1 !important;
        max-width: 100% !important;
        text-align: center !important;
    }
    html body .site-footer__grid > *:nth-child(2) {
        grid-column: 1 !important;
        grid-row: 2 !important;
        text-align: left !important;
    }
    html body .site-footer__grid > *:nth-child(3) {
        grid-column: 2 !important;
        grid-row: 2 !important;
        text-align: left !important;
    }
    html body .site-footer__grid > *:nth-child(4) {
        grid-column: 3 !important;
        grid-row: 2 !important;
        text-align: left !important;
    }
    html body .site-footer__grid > *:nth-child(5) {
        grid-column: 4 !important;
        grid-row: 2 !important;
        text-align: left !important;
    }
    html body .site-footer__social {
        justify-content: center !important;
    }
}

/* ===== SITE FOOTER GRID - MOBILE (768px and below): 2x2 grid ===== */
@media screen and (max-width: 768px) {
    html body .site-footer__grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px 16px !important;
    }
    html body .site-footer__grid > *:nth-child(1) {
        grid-column: 1 / 3 !important;
        grid-row: 1 !important;
        text-align: center !important;
        max-width: 100% !important;
    }
    html body .site-footer__grid > *:nth-child(2) {
        grid-column: 1 !important;
        grid-row: 2 !important;
        text-align: left !important;
    }
    html body .site-footer__grid > *:nth-child(3) {
        grid-column: 2 !important;
        grid-row: 2 !important;
        text-align: left !important;
    }
    html body .site-footer__grid > *:nth-child(4) {
        grid-column: 1 !important;
        grid-row: 3 !important;
        text-align: left !important;
    }
    html body .site-footer__grid > *:nth-child(5) {
        grid-column: 2 !important;
        grid-row: 3 !important;
        text-align: left !important;
    }
    html body .site-footer__social {
        justify-content: center !important;
    }
}

/* ===== MOBILE HERO FIXES ===== */
@media screen and (max-width: 768px) {
    /* Hide "Independent advisory..." text on mobile */
    html body .hero-v2__subtitle {
        display: none !important;
    }
}

/* ===== UPLOAD ICONS CENTERING FIX ===== */
html body .form-upload__angles,
html body .form-upload__angles--3,
html body .form-upload__angles--2,
html body .form-upload__angles--4 {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 auto !important;
}

html body .form-upload__angle {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
}

/* ===== MOBILE FOOTER BRAND CENTERING FIX ===== */
@media screen and (max-width: 768px) {
    /* Target the ACTUAL class: site-footer__brand */
    html body .site-footer__brand {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
    }

    html body .site-footer__logo {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }

    html body .site-footer__logo img {
        margin: 0 auto !important;
    }

    html body .site-footer__tagline {
        text-align: center !important;
        width: 100% !important;
    }

    html body .site-footer__social {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }
}

/* ===== MOBILE FOOTER BRAND CENTERING - CORRECT CLASS NAMES ===== */
/* index.php footer uses .footer__* classes (NOT site-footer__*) */
@media screen and (max-width: 768px) {
    /* Brand section - CENTERED */
    html body footer.footer .footer__brand {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px 20px 28px 20px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    html body footer.footer .footer__logo {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
        margin: 0 0 20px 0 !important;
    }

    html body footer.footer .footer__logo img {
        height: 44px !important;
        width: auto !important;
        display: block !important;
        margin: 0 auto !important;
    }

    html body footer.footer .footer__tagline {
        text-align: center !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 10px !important;
        margin: 0 0 24px 0 !important;
    }

    html body footer.footer .footer__social {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
        margin: 0 !important;
    }
}

/* ===== RESULTS CTA BUTTON TEXT VISIBILITY FIX ===== */
/* Ensures button text stays visible on hover/click/active states */
html body .results__cta .btn-primary,
html body .results__cta .btn-primary:hover,
html body .results__cta .btn-primary:focus,
html body .results__cta .btn-primary:active {
    color: #fff !important;
}

html body .btn-primary,
html body .btn-primary:hover,
html body .btn-primary:focus,
html body .btn-primary:active {
    color: #fff !important;
}

/* ===== MOBILE RESULTS CTA BUTTON FIX ===== */
/* Fixes text overflow when translated to longer languages (French, German, etc.) */
@media screen and (max-width: 768px) {
    html body .results__cta {
        padding: 0 16px !important;
    }

    html body .results__cta .btn,
    html body .results__cta .btn-lg,
    html body .results__cta .btn-primary {
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        text-align: center !important;
        line-height: 1.4 !important;
        padding: 14px 20px !important;
        max-width: 100% !important;
        width: 100% !important;
        font-size: 0.95rem !important;
        min-height: 48px !important;
        height: auto !important;
    }
}

@media screen and (max-width: 480px) {
    html body .results__cta .btn,
    html body .results__cta .btn-lg,
    html body .results__cta .btn-primary {
        font-size: 0.9rem !important;
        padding: 12px 16px !important;
    }
}
