/*=============================================
=            RESPONSIVE / MEDIA QUERIES       =
=============================================*/

@media (max-width: 992px) {
    .container {
        padding: 0 30px;
    }

    .hero {
        padding: 120px 30px 80px;
        text-align: center;
        min-height: auto;
    }

    /* Switch from 2-column grid to 1-column stacked */
    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Content first, then image below */
    .hero-content {
        order: 1;
    }

    .hero-image {
        order: 2;
        opacity: 1 !important;
        /* Prevent GSAP from hiding it on mobile */
        max-width: 500px;
        margin: 0 auto;
        width: 100%;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        max-width: 100%;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* POS section: switch from 2-col grid to single column */
    .pos-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    /* Text content first */
    .pos-content {
        order: 1;
        opacity: 1 !important;
        /* Prevent GSAP from hiding on mobile */
    }

    /* Image below text */
    .pos-image {
        order: 2;
        opacity: 1 !important;
        max-width: 420px;
        margin: 0 auto;
        width: 100%;
    }

    .pos-features {
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }

    .cta-box {
        padding: 60px 40px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .cta-form {
        flex-direction: column;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
    }

    .social-fab-container {
        bottom: 20px;
        right: 15px;
    }

    .ai-assistant-container {
        bottom: 20px;
        right: 15px;
    }

    .ai-chat-window {
        width: calc(100vw - 30px);
        height: 60vh;
        bottom: 75px;
    }

    .ai-chat-open .social-fab-container {
        bottom: calc(60vh + 110px);
    }

    /* Hero mockup: disable 3D tilt for cleaner layout */
    .mockup-card {
        transform: none !important;
        height: auto;
    }

    .hero-image:hover .mockup-card {
        transform: none !important;
    }

    /* Keep badges inside the card, not overflowing outside */
    .badge-1 {
        top: -10px;
        right: 0px;
        font-size: 0.8rem;
        padding: 8px 14px;
    }

    .badge-2 {
        bottom: 10px;
        left: 0px;
        font-size: 0.8rem;
        padding: 8px 14px;
    }

    /* Give hero-image overflow: visible so badges don't get clipped */
    .hero-image {
        overflow: visible;
        padding: 20px 10px;
    }
}

@media (max-width: 768px) {
    .nav-actions-mobile {
        display: flex;
    }

    .desktop-theme-wrapper {
        display: none;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: var(--nav-bg);
        backdrop-filter: blur(25px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition-smooth);
        z-index: 11000;
        transform: translateX(100%);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links li {
        margin: 15px 0;
    }

    .mobile-menu-btn {
        z-index: 12000;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .pos-features {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .brand-col .footer-desc {
        margin: 20px auto;
    }

    .social-links {
        justify-content: center;
    }

    .flex-between {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    /* Smaller font for mockup title on very small screens */
    .mockup-title {
        font-size: 1rem;
    }

    /* Reduce hero image padding for tighter screens */
    .hero-image {
        padding: 15px 5px;
    }

    /* Services grid: single column on mobile */
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/*=============================================
=          MOBILE BOTTOM TAB BAR              =
=============================================*/
.mobile-nav-bar {
    display: none;
}

@media (max-width: 768px) {

    /* Hide floating triggers on mobile */
    #ai-assistant .ai-trigger,
    .social-fab-container .social-fab-main {
        display: none !important;
    }

    /* ========================================
       MOBILE NAV BAR — Full Glassmorphism
    ======================================== */
    .mobile-nav-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 80px;
        /* Same glass recipe as .glass-card */
        background: var(--gradient-glass);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-top: var(--border-glass);
        box-shadow: 0 -8px 32px 0 rgba(0, 0, 0, 0.25);
        z-index: 10001;
        justify-content: space-evenly;
        align-items: center;
        gap: 0;
        padding: 0 20px env(safe-area-inset-bottom);
    }

    /* Light mode override for glass bar */
    body.light-mode .mobile-nav-bar {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0.55) 100%);
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 -8px 32px 0 rgba(0, 0, 0, 0.06);
    }

    /* ========================================
       UNIFIED NAV ITEM — Both look the same
    ======================================== */
    .mobile-nav-item {
        flex: 0 0 40%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        transition: color 0.2s ease;
    }

    body:not(.light-mode) .mobile-nav-item {
        color: #98989D;
    }

    .mobile-nav-item i {
        font-size: 1.5rem;
    }

    .mobile-nav-item span {
        font-size: 0.65rem;
        letter-spacing: 0.2px;
    }

    .mobile-nav-item.active,
    .mobile-nav-item:active {
        color: var(--clr-primary);
    }

    /* Center AI Button (elevated above the bar) */
    .mobile-ai-toggle {
        margin-top: -32px;
        flex: 1.2;
    }

    .mobile-ai-icon-wrapper {
        width: 58px;
        height: 58px;
        background: var(--gradient-primary);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 2rem;
        box-shadow: 0 8px 30px rgba(0, 188, 166, 0.5);
        border: 4px solid #FFFFFF;
        transition: transform 0.2s ease;
    }

    body:not(.light-mode) .mobile-ai-icon-wrapper {
        border-color: #0A0F14;
    }

    .mobile-ai-toggle:active .mobile-ai-icon-wrapper {
        transform: scale(0.92);
    }

    /* Chat window pinned just above nav bar */
    .ai-chat-window {
        bottom: 85px !important;
        right: 10px !important;
        width: calc(100vw - 20px) !important;
        height: 65vh !important;
        z-index: 10002;
    }

    /* Social fan also pinned above nav bar */
    .social-fab-fan {
        position: fixed !important;
        bottom: 90px !important;
        right: 10px !important;
        z-index: 10002;
        background: rgba(255, 255, 255, 0.92);
        padding: 15px 12px;
        border-radius: 30px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
        flex-direction: column;
        gap: 12px;
    }

    body:not(.light-mode) .social-fab-fan {
        background: rgba(15, 20, 25, 0.96);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* Give footer extra space so it's not hidden under the bar */
    footer {
        padding-bottom: 100px !important;
    }

    /* 2-item layout: side by side, centered */
    .mobile-nav-bar {
        justify-content: space-evenly;
        gap: 0;
    }

    .mobile-nav-item {
        flex: 0 0 40%;
        font-size: 0.75rem;
    }

    /* Bigger icon for the Contacto button */
    #mobile-social-toggle i {
        font-size: 1.9rem;
    }

    #mobile-social-toggle span {
        font-size: 0.7rem;
    }
}