/* =========================================================
   GLOBAL MOBILE STYLES (Max-Width: 991px)
   Site-wide responsive overrides (Navbar, Footer, etc.)
   ========================================================= */

@media only screen and (max-width: 991px) {

    /* --- 1. GLOBAL MOBILE RESET --- */
    html {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: clip !important;
    }

    body {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: clip !important;
        -webkit-overflow-scrolling: touch;
    }

    main {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    section {
        padding: 60px 0 !important;
        /* Uniform section padding for mobile */
    }

    /* --- 2. PREMIUM NAVBAR MOBILE (Balanced Height) --- */
    .agro-navbar {
        height: 85px !important;
        /* Increased for logo + hint breathing room */
        padding: 0 !important;
        background: #111827 !important;
        display: flex !important;
        align-items: center !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 10000 !important;
        border-bottom: 2px solid #22c55e !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    }

    .agro-navbar .container-fluid {
        padding: 0 20px !important;
        border-radius: 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        background: transparent !important;
        border: none !important;
        height: 100% !important;
    }

    .navbar-brand {
        max-width: 65% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    .navbar-brand .logo {
        height: 38px !important;
        width: auto !important;
        object-fit: contain;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    }

    /* Logo Hint for Mobile - Neat & Centered Below Logo */
    .logo-hover-hint {
        display: flex !important;
        position: absolute !important;
        top: 48px !important;
        /* Move lower to clear the logo image */
        left: 50% !important;
        transform: translateX(-50%) scale(0.55) !important;
        opacity: 0.8 !important;
        pointer-events: none !important;
        z-index: 100 !important;
    }

    .hint-text {
        font-family: 'Outfit', sans-serif !important;
        font-size: 0.85rem !important;
        /* Slightly smaller for neatness */
        font-weight: 800 !important;
        color: #fff !important;
        /* White text for clarity */
        background: var(--gradient-primary) !important;
        /* Green background */
        padding: 5px 18px !important;
        border-radius: 20px !important;
        border: none !important;
        white-space: nowrap !important;
        text-transform: uppercase !important;
        letter-spacing: 1.5px !important;
        box-shadow: 0 5px 15px rgba(34, 197, 94, 0.4) !important;
    }

    .hint-arrow-svg {
        display: none !important;
    }

    .navbar-toggler {
        border: 2px solid #22c55e !important;
        padding: 10px 15px !important;
        background: rgba(34, 197, 94, 0.1) !important;
        border-radius: 12px !important;
        position: relative !important;
        z-index: 10001 !important;
        min-width: 55px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .navbar-toggler i {
        font-size: 1.8rem !important;
        color: #22c55e !important;
        line-height: 1 !important;
    }

    .navbar-toggler:active {
        background: rgba(34, 197, 94, 0.3) !important;
        transform: scale(0.95);
    }

    .navbar-collapse {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: #111827 !important;
        padding: 25px 20px !important;
        border-radius: 0 0 25px 25px !important;
        margin: 0 !important;
        border: 2px solid #22c55e !important;
        border-top: none !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8) !important;
        z-index: 9999 !important;
        display: none !important;
        /* Hidden by default */
        max-height: 80vh !important;
        overflow-y: auto !important;
    }

    .navbar-collapse.show {
        display: block !important;
        /* Forced visibility */
        opacity: 1 !important;
        visibility: visible !important;
    }

    .nav-link {
        padding: 14px 18px !important;
        margin: 4px 0 !important;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 10px;
        text-align: left !important;
    }

    .nav-link.active {
        background: rgba(34, 197, 94, 0.15) !important;
        color: #22c55e !important;
    }

    .nav-link.contact-link {
        margin-top: 15px !important;
        text-align: center !important;
        background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
        font-weight: 800 !important;
    }

    /* --- 3. UNIFIED BUTTON STYLING (Fixed stretching) --- */
    .btn,
    .alefox-btn,
    .premium-btn,
    .premium-btn-outline,
    .btn-hero-primary,
    .btn-hero-secondary,
    .unified-btn-v11,
    .cta-main-btn {
        width: 100% !important;
        max-width: 400px !important;
        margin: 10px auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        font-size: 1rem !important;
        padding: 14px 25px !important;
        border-radius: 50px !important;
    }

    /* Exceptions for small inline buttons */
    .nav-btn,
    .tab-lux-btn,
    .filter-btn,
    .award-slider-btn {
        width: auto !important;
        margin: 0 !important;
    }

    .award-slider-btn {
        width: 45px !important;
        height: 45px !important;
        background: rgba(255, 255, 255, 0.9) !important;
        border: 1px solid rgba(34, 197, 94, 0.3) !important;
        color: #16a34a !important;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
    }

    /* --- 4. BENTO GRID & LAYOUTS --- */
    .bento-grid-modern {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        gap: 20px !important;
    }

    .bento-card,
    .bento-card.card-featured,
    .bento-card.card-wide {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        min-height: 320px !important;
        height: auto !important;
    }

    .bento-card.card-wide {
        flex-direction: column !important;
        padding: 30px 20px !important;
        gap: 20px !important;
        text-align: center !important;
        align-items: center !important;
    }

    .bento-card.card-wide .wide-info {
        order: 1;
    }

    .bento-card.card-wide .wide-visual {
        order: 2;
        display: block !important;
        width: 100% !important;
        max-width: 200px !important;
        margin: 15px auto 0 !important;
        text-align: center !important;
    }

    .bento-card.card-wide .wide-visual img {
        width: 100% !important;
        height: auto !important;
        border-radius: 20px !important;
        display: block !important;
    }

    .cert-pill-row {
        justify-content: center !important;
    }

    .card-content {
        padding: 30px !important;
    }

    .stat-value {
        font-size: 3rem !important;
    }

    /* --- 5. PREMIUM FOOTER MOBILE --- */
    .animated-footer {
        padding: 70px 20px 50px !important;
        text-align: center !important;
        background: #000 !important;
        position: relative !important;
        overflow: hidden !important;
    }

    .footer-wave {
        display: none !important;
        /* Hide wave on mobile for a cleaner look */
    }

    .footer-container {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .animated-footer .g-5 {
        --bs-gutter-x: 1rem !important;
        --bs-gutter-y: 2.5rem !important;
    }

    .footer-logo {
        height: 50px !important;
        margin: 0 auto 30px !important;
        filter: none !important;
    }

    .footer-about {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 30px !important;
        color: rgba(255, 255, 255, 0.7) !important;
    }

    .footer-title {
        font-size: 1.2rem !important;
        margin-top: 20px !important;
        margin-bottom: 25px !important;
        color: #22c55e !important;
    }

    .footer-title::after {
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 30px !important;
    }

    .footer-links {
        padding: 0 !important;
        list-style: none !important;
    }

    .footer-links a {
        justify-content: center !important;
        padding: 10px 0 !important;
        font-size: 1rem !important;
        color: rgba(255, 255, 255, 0.6) !important;
    }

    .footer-contact {
        margin-bottom: 25px !important;
    }

    .footer-contact h6 {
        font-size: 0.8rem !important;
        text-align: center !important;
        color: #22c55e !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
    }

    .footer-contact p {
        font-size: 1.05rem !important;
        font-weight: 600 !important;
        margin-bottom: 5px !important;
        color: #fff !important;
        word-break: break-word !important;
    }

    .social-btn {
        width: 50px !important;
        height: 50px !important;
        margin: 0 10px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    .footer-socials {
        justify-content: center !important;
        margin-top: 20px !important;
    }

    .footer-bottom {
        margin-top: 50px !important;
        padding-top: 30px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .footer-bottom p {
        font-size: 0.8rem !important;
        opacity: 0.6 !important;
    }

    .footer-legal-links {
        display: flex !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 15px !important;
        margin-top: 15px !important;
    }

    .footer-legal-links .me-3 {
        margin-right: 0 !important;
    }

    /* --- 6. PREMIUM LUX COMPANY CARD (MOBILE REFINEMENT) --- */
    .lux-company-card {
        top: 95px !important;
        left: 15px !important;
        right: 15px !important;
        width: auto !important;
        z-index: 10002 !important;
    }

    .lux-card-glow {
        display: none !important; /* Save performance on mobile */
    }

    .lux-card-inner {
        flex-direction: column !important;
        border-radius: 28px !important;
        background: rgba(4, 47, 44, 0.98) !important; /* Force the Dark Theme */
        box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6) !important;
        border: 1px solid rgba(16, 185, 129, 0.3) !important;
    }

    .lux-brand-portal {
        display: flex !important;
        padding: 25px 20px !important;
        width: 100% !important;
        min-height: auto !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 15px !important;
        background: #064e3b !important;
    }

    .lux-brand-logo {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 0 !important;
    }

    .lux-brand-name {
        font-size: 1.4rem !important;
        text-align: left !important;
    }

    .lux-brand-tag, .lux-pill-btn {
        display: none !important; /* Hide tagline and map button to keep it compact on mobile */
    }

    .lux-info-portal {
        padding: 0 !important;
    }

    .portal-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 25px !important;
    }

    .portal-title {
        font-size: 1.25rem !important;
        margin-bottom: 0 !important;
    }

    .lux-contact-entries {
        gap: 15px !important;
    }

    .lux-entry {
        gap: 15px !important;
        padding-bottom: 12px !important;
        border-bottom: 1px solid rgba(16, 185, 129, 0.1) !important;
    }

    .lux-entry:last-child {
        border-bottom: none !important;
    }

    .entry-icon {
        width: 45px !important;
        height: 45px !important;
        border-radius: 12px !important;
        font-size: 1.1rem !important;
    }

    .entry-data label {
        font-size: 0.65rem !important;
        margin-bottom: 2px !important;
    }

    .entry-data a, .entry-data p {
        font-size: 0.95rem !important;
    }

    .lux-portal-footer {
        margin-top: 25px !important;
        flex-direction: row !important;
        gap: 10px !important;
    }

    .lux-social-entry {
        width: 50px !important;
        height: 50px !important;
        border-radius: 12px !important;
    }

    .lux-cta-main {
        height: 50px !important;
        border-radius: 12px !important;
        font-size: 0.9rem !important;
    }

    .portal-close {
        background: rgba(255, 255, 255, 0.2) !important;
        color: #fff !important;
        border: none !important;
        width: 35px !important;
        height: 35px !important;
        border-radius: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.1rem !important;
        position: absolute !important;
        top: 15px !important;
        right: 15px !important;
        z-index: 100 !important;
        bottom: auto !important;
    }

    /* --- 6. PAGE SPECIFIC OVERRIDES --- */

    /* About Pages Hero */
    .hero-medium,
    .hero-medium-v12,
    .team-hero-lux,
    .faq-hero-lux {
        min-height: 300px !important;
        padding-top: 120px !important;
        padding-bottom: 50px !important;
        margin-top: 0 !important;
    }

    .hero-title,
    .prof-title {
        font-size: 2.2rem !important;
        line-height: 1.2 !important;
    }

    /* Director Sections (Profile) */
    .director-item,
    .side-item {
        flex-direction: column !important;
        margin-bottom: 40px !important;
    }

    .director-image-box,
    .side-img-box {
        width: 100% !important;
        height: 300px !important;
    }

    .director-content,
    .side-content-box {
        width: 100% !important;
        padding: 30px 20px !important;
        text-align: center !important;
    }

    /* Brochure Sheets */
    .sheet-v12 {
        flex-direction: column !important;
    }

    .p-v12 {
        width: 100% !important;
        border: none !important;
        border-bottom: 2px solid rgba(22, 163, 74, 0.2) !important;
    }

    /* FAQ Tabs */
    .tabs-lux-wrap {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .tab-lux-btn {
        width: 100% !important;
    }

    /* --- 480px SPECIFIC (Mobile Small) --- */
    @media (max-width: 480px) {

        .hero-title,
        .hero-mega-title {
            font-size: 1.8rem !important;
        }

        .stat-value {
            font-size: 2.5rem !important;
        }
    }

    /* --- 7. AGROBOT MOBILE OPTIMIZATION --- */
    #agroBotLauncher {
        width: 60px !important;
        height: 60px !important;
        right: 20px !important;
        bottom: 20px !important;
    }

    .launcher-label {
        display: none !important; /* Hide label on mobile to prevent overlapping content */
    }

    .bot-avatar {
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
    }

    #agroBotLauncher::after {
        width: 25px !important;
        height: 25px !important;
        font-size: 11px !important;
    }

    #agroBot {
        right: 15px !important;
        left: 15px !important;
        width: auto !important;
        max-width: 100vw !important; /* Ensure it never exceeds screen */
        bottom: 95px !important;
        height: 80vh !important;
        border-radius: 25px !important;
        display: none;
        flex-direction: column !important;
        overflow: hidden !important;
        box-shadow: 0 40px 100px rgba(0,0,0,0.6) !important;
    }

    .agro-bot-header {
        padding: 15px 15px 15px 10px !important; /* Added left padding */
        border-radius: 25px 25px 0 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    .bot-header-info {
        gap: 10px !important;
    }

    .bot-avatar {
        background: transparent !important;
        width: 35px !important;
        height: 35px !important;
        padding: 0 !important;
        border: none !important;
        flex-shrink: 0 !important;
    }

    .agro-bot-body {
        padding: 15px !important;
        gap: 12px !important;
        width: 100% !important;
        overflow-x: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        box-sizing: border-box !important;
    }

    .bot-msg {
        max-width: 100% !important; /* Allow it to take full width of body minus padding */
        width: fit-content !important;
        padding: 12px 15px !important;
        font-size: 13px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        box-sizing: border-box !important;
    }

    .agro-bot-footer {
        padding: 12px 15px !important;
        display: flex !important;
        gap: 8px !important;
        align-items: center !important;
    }

    #agroBotInput {
        flex: 1 !important;
        height: 45px !important;
        font-size: 13px !important;
        padding: 0 15px !important;
    }

    #sendAgroBot {
        width: 60px !important;
        height: 45px !important;
        font-size: 12px !important;
        padding: 0 !important;
    }

    /* --- PERFORMANCE: DISABLE HEAVY ANIMATIONS ON MOBILE --- */
    .reveal, .reveal-up, .reveal-left, .reveal-right, .reveal-scale,
    .animate__animated, .wow {
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
        animation: none !important;
        transition: none !important;
    }
}
