/* ==========================================================================
   VIION Mobile Overrides (mobile.css)
   Loaded AFTER style.css — all rules here override desktop styles.
   Covers: ALL pages (Home, About, Services, Contact, Why VIION, Gallery, Products, Product Detail)
   ========================================================================== */

/* ==========================================================================
   TABLET: max-width 1024px
   ========================================================================== */
@media (max-width: 1024px) {

    /* -- Global Typography Shrink -- */
    .display-title-md {
        font-size: 2.5rem;
    }
    .tech-overline {
        font-size: 0.65rem;
        letter-spacing: 3px;
    }
    .section-subtitle,
    .inner-p {
        font-size: 1rem;
    }

    /* -- Hero -- */
    .hero-cinematic-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    .hero-cinematic-content {
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .hero-cinematic-desc {
        text-align: center;
    }
    .hero-cinematic-visual {
        height: 55vh;
        min-height: 350px;
    }

    /* -- Stats Glass Bar -- */
    .stats-glass-bar {
        flex-direction: column;
        gap: 2rem;
        border-radius: var(--border-rad-xl);
        padding: 3rem 2rem;
    }
    .stat-divider {
        width: 100%;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    }

    /* -- Inner Page Grids -- */
    .split-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .split-grid.reverse {
        direction: ltr;
    }
    .split-visual {
        height: 350px;
    }
    .vm-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .profile-grid,
    .rd-grid,
    .approach-grid,
    .dept-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .values-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* -- Timeline -- */
    .timeline-line {
        left: 30px;
    }
    .timeline-item,
    .timeline-item.right {
        width: calc(100% - 60px);
        margin-left: 60px;
    }
    .timeline-item .timeline-dot,
    .timeline-item.right .timeline-dot {
        left: -38px;
        right: auto;
        transform: none;
    }

    /* -- Testimonials -- */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    .testimonial-card:nth-child(even) {
        margin-top: 0;
    }

    /* -- Footer -- */
    .footer-top {
        flex-direction: column;
        gap: 4rem;
    }

    /* -- Products page -- */
    .products-layout {
        grid-template-columns: 1fr;
    }
    .products-sidebar {
        position: static;
        display: flex;
        gap: 2rem;
        flex-wrap: wrap;
        padding-bottom: 2rem;
        border-bottom: 1px solid var(--border-light);
        margin-bottom: 2rem;
    }
    .filter-section {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        min-width: 180px;
    }

    /* -- Product Detail -- */
    .pd-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* -- Gallery -- */
    .masonry-gallery {
        columns: 2;
    }

    /* -- About visual -- */
    .about-grid {
        grid-template-columns: 1fr;
    }
    .about-visual {
        height: 350px;
    }
}


/* ==========================================================================
   MOBILE: max-width 768px — THE BIG ONE
   ========================================================================== */
@media (max-width: 768px) {

    /* ============================
       NAVBAR — Functional Mobile Menu
       ============================ */
    .nav-container {
        padding: 0.75rem 0;
        position: relative;
    }
    .nav-links {
        display: none !important;
    }
    .nav-links.mobile-open {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(3, 3, 5, 0.98);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2.5rem;
        z-index: 99999;
    }
    .nav-links.mobile-open .nav-link {
        font-size: 1.5rem;
        font-family: var(--font-display);
        font-weight: 700;
        opacity: 1;
    }
    .nav-actions {
        display: none !important;
    }

    /* Hamburger Button */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border-light);
        border-radius: 10px;
        width: 42px;
        height: 42px;
        cursor: pointer;
        color: var(--text-primary);
        font-size: 1.3rem;
        position: relative;
        z-index: 100000; /* Above the overlay */
        transition: all 0.2s;
        margin-left: auto;
    }
    .mobile-menu-toggle:hover {
        border-color: var(--brand-primary);
    }

    /* ============================
       GLOBAL TYPOGRAPHY (Much Smaller)
       ============================ */
    .display-title-md,
    .display-title {
        font-size: 1.5rem !important;
        line-height: 1.15;
    }
    .tech-overline {
        font-size: 0.55rem !important;
        letter-spacing: 2px;
        margin-bottom: 0.5rem;
    }
    .section-subtitle,
    .inner-p,
    .about-p {
        font-size: 0.85rem !important;
        line-height: 1.55;
    }
    p {
        font-size: 0.82rem;
    }
    h3 {
        font-size: 1.05rem !important;
    }
    h4 {
        font-size: 0.92rem !important;
    }
    .section-header {
        margin-bottom: 1.5rem;
    }

    /* ============================
       HOME: HERO
       ============================ */
    .hero-container,
    .hero-cinematic {
        padding-top: 80px;
    }
    .hero-massive {
        font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
        line-height: 1.08;
        letter-spacing: -1px;
    }
    .hero-cinematic-desc {
        font-size: 0.82rem !important;
        line-height: 1.5;
    }
    .hero-cinematic-visual {
        height: 40vh;
        min-height: 250px;
    }
    .hero-cinematic-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    .hero-cinematic-actions button,
    .hero-cinematic-actions a {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 0.8rem 1.5rem;
        font-size: 0.8rem;
    }

    /* ============================
       HORIZONTAL SCROLL MIXIN (shared pattern)
       Hide scrollbars completely — NO vertical scrollbar
       ============================ */
    .stats-cards,
    .bento-grid,
    .testimonials-grid,
    .product-gallery,
    .profile-grid,
    .values-grid,
    .product-bento-grid,
    .rd-grid,
    .approach-grid,
    .dept-grid,
    .strengths-grid,
    .app-grid,
    .benefits-grid,
    .related-products-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding-bottom: 0.75rem;
        /* Kill ALL scrollbars */
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    .stats-cards::-webkit-scrollbar,
    .bento-grid::-webkit-scrollbar,
    .testimonials-grid::-webkit-scrollbar,
    .product-gallery::-webkit-scrollbar,
    .profile-grid::-webkit-scrollbar,
    .values-grid::-webkit-scrollbar,
    .product-bento-grid::-webkit-scrollbar,
    .rd-grid::-webkit-scrollbar,
    .approach-grid::-webkit-scrollbar,
    .dept-grid::-webkit-scrollbar,
    .strengths-grid::-webkit-scrollbar,
    .app-grid::-webkit-scrollbar,
    .benefits-grid::-webkit-scrollbar,
    .related-products-grid::-webkit-scrollbar {
        display: none !important;
        height: 0 !important;
        width: 0 !important;
    }

    /* Card sizing for horizontal scroll */
    .stats-card {
        flex: 0 0 72vw;
        max-width: 280px;
        min-width: 240px;
        scroll-snap-align: center;
    }
    .bento-large,
    .bento-wide,
    .bento-square {
        flex: 0 0 80vw;
        max-width: 300px;
        min-width: 260px;
        scroll-snap-align: center;
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        min-height: 280px;
    }
    .testimonial-card {
        flex: 0 0 80vw;
        max-width: 300px;
        min-width: 260px;
        scroll-snap-align: center;
        padding: 1.75rem 1.25rem;
        min-height: auto;
    }
    .testimonial-card:nth-child(even) {
        margin-top: 0 !important;
    }
    .testimonial-content {
        font-size: 0.9rem !important;
    }
    .premium-product-card {
        flex: 0 0 78vw;
        max-width: 280px;
        min-width: 240px;
        scroll-snap-align: center;
    }
    .profile-card {
        flex: 0 0 65vw;
        max-width: 240px;
        min-width: 200px;
        scroll-snap-align: center;
        padding: 1.25rem;
    }
    .value-card {
        flex: 0 0 60vw;
        max-width: 220px;
        min-width: 180px;
        scroll-snap-align: center;
        padding: 1.25rem;
    }
    .value-letter {
        font-size: 2rem;
    }
    .product-bento-card {
        flex: 0 0 80vw;
        max-width: 300px;
        min-width: 260px;
        scroll-snap-align: center;
        padding: 1.5rem 1.25rem;
    }
    .product-bento-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    .rd-card {
        flex: 0 0 72vw;
        max-width: 280px;
        min-width: 240px;
        scroll-snap-align: center;
        padding: 1.5rem 1.25rem;
    }
    .rd-number {
        font-size: 1.8rem;
    }
    .approach-card {
        flex: 0 0 72vw;
        max-width: 280px;
        min-width: 240px;
        scroll-snap-align: center;
    }
    .dept-card {
        flex: 0 0 68vw;
        max-width: 260px;
        min-width: 220px;
        scroll-snap-align: center;
    }
    .strength-card {
        flex: 0 0 72vw;
        max-width: 280px;
        min-width: 240px;
        scroll-snap-align: center;
    }
    .app-card {
        flex: 0 0 62vw;
        max-width: 240px;
        min-width: 200px;
        scroll-snap-align: center;
    }
    .benefit-card {
        flex: 0 0 72vw;
        max-width: 270px;
        min-width: 230px;
        scroll-snap-align: center;
        padding: 1.25rem;
    }
    .related-products-grid .product-card {
        flex: 0 0 72vw;
        max-width: 260px;
        min-width: 220px;
        scroll-snap-align: center;
    }

    /* Bento internals */
    .bento-layout-row {
        flex-direction: column;
        gap: 1rem;
    }
    .bento-layout-row .bento-content {
        max-width: 100%;
    }
    .bento-chart-container {
        width: 100%;
        height: 110px;
    }
    /* Bento card text — force smaller */
    .bento-content h3,
    .bento-large h3,
    .bento-wide h3,
    .bento-square h3 {
        font-size: 1rem !important;
    }
    .bento-content p,
    .bento-large p,
    .bento-wide p,
    .bento-square p {
        font-size: 0.78rem !important;
        line-height: 1.5;
    }

    /* ============================
       HOME: ABOUT SECTION  
       ============================ */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .about-visual {
        height: 250px;
        order: -1;
    }
    .about-stats {
        flex-direction: column;
        gap: 1rem;
    }

    /* ============================
       HOME: HIDE HEAVY DECORATIONS
       ============================ */
    .scanner-sweep,
    .hero-data-stream,
    .mesh-bg .blob.color-3 {
        display: none !important;
    }
    .mesh-bg .blob {
        opacity: 0.3;
    }

    /* ============================
       HOME: GALLERY MARQUEE
       ============================ */
    .gallery-item {
        width: 260px;
        height: 180px;
    }

    /* ============================
       HOME: CTA & FOOTER
       ============================ */
    .cta-btn-group {
        flex-direction: column;
        width: 100%;
    }
    .cta-btn-group a {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .cta-epic-content h2 {
        font-size: 1.4rem !important;
    }
    .footer-top {
        flex-direction: column;
        gap: 2rem;
    }
    .footer-nav {
        flex-direction: column;
        gap: 1.75rem;
    }
    .f-col h4 {
        margin-bottom: 0.5rem;
        font-size: 0.85rem !important;
    }
    .f-col a {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        font-size: 0.75rem;
    }

    /* ============================
       INNER PAGES: PAGE HERO
       ============================ */
    .page-hero {
        min-height: 40vh;
        padding: 110px 0 2.5rem;
    }
    .page-hero-title {
        font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
    }
    .page-hero-desc {
        font-size: 0.82rem !important;
    }
    .breadcrumb {
        font-size: 0.7rem;
        margin-bottom: 1rem;
    }

    /* ============================
       ABOUT PAGE
       ============================ */
    .split-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .split-visual {
        height: 220px;
        order: -1;
    }
    .inner-stats {
        flex-direction: column;
        gap: 0.75rem;
    }
    .vm-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .vm-card {
        padding: 1.5rem 1.25rem;
    }
    .vm-card h3 {
        font-size: 1.15rem !important;
    }
    .vm-statement {
        font-size: 0.88rem !important;
    }
    .md-message {
        padding: 1.5rem 1.25rem;
    }
    .md-signature {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .md-text {
        font-size: 0.85rem !important;
    }

    /* Timeline */
    .timeline-line {
        left: 15px;
    }
    .timeline-item,
    .timeline-item.right {
        width: calc(100% - 40px);
        margin-left: 40px;
    }
    .timeline-item .timeline-dot,
    .timeline-item.right .timeline-dot {
        left: -26px;
        right: auto;
        transform: none;
    }
    .timeline-card {
        padding: 1.25rem;
    }
    .timeline-year {
        font-size: 1.1rem;
    }
    .timeline-card h4 {
        font-size: 0.95rem !important;
    }

    /* ============================
       SERVICES PAGE: Carbon section
       ============================ */
    .carbon-visual {
        height: 220px;
    }

    /* ============================
       CONTACT PAGE
       ============================ */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* ============================
       WHY VIION PAGE
       ============================ */
    .reasons-grid {
        grid-template-columns: 1fr;
    }
    .diff-item {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.25rem;
        text-align: center;
    }
    .partner-grid {
        grid-template-columns: 1fr;
    }

    /* ============================
       GALLERY PAGE
       ============================ */
    .masonry-gallery {
        columns: 1;
    }
    .gallery-filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .gallery-filter-bar::-webkit-scrollbar { display: none; }
    .gallery-filter-btn {
        flex-shrink: 0;
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
    }
    .lightbox-img-wrap {
        height: 220px;
    }
    .lightbox-nav {
        display: none;
    }
    .lightbox-content {
        width: 95%;
    }

    /* ============================
       PRODUCTS PAGE — VERTICAL STACK (not side-scroll)
       ============================ */
    .products-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .products-search-wrap {
        max-width: none;
    }
    .view-toggle {
        display: none; /* Hide grid/list toggle on mobile */
    }

    /* Products Grid — Vertical Stack */
    .products-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem;
        overflow: visible !important;
    }
    .product-card {
        flex: none;
        max-width: none;
        min-width: 0;
    }
    .products-grid.list-view .product-card {
        flex-direction: column;
    }
    .products-grid.list-view .product-card-img {
        width: 100%;
    }
    .product-placeholder {
        height: 160px;
    }
    .product-card-body {
        padding: 1rem;
    }
    .product-card-body h3 {
        font-size: 1rem !important;
    }
    .product-card-body > p {
        font-size: 0.78rem !important;
    }

    /* Sidebar Filters — Collapsible style */
    .products-sidebar {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border-light);
        border-radius: 16px;
        margin-bottom: 1.5rem;
        overflow: visible !important;
    }
    .filter-section {
        flex: none;
        min-width: 0;
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }
    .filter-section h4 {
        font-size: 0.75rem !important;
        margin-bottom: 0.5rem;
    }
    .filter-check {
        margin-bottom: 0.35rem;
    }
    .filter-check label {
        font-size: 0.78rem;
    }
    .filter-reset-btn {
        grid-column: 1 / -1;
        padding: 0.6rem 1rem;
        font-size: 0.78rem;
    }

    /* ============================
       PRODUCT DETAIL PAGE
       ============================ */
    .pd-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .product-placeholder-lg {
        height: 260px;
    }
    .pd-title {
        font-size: 1.6rem !important;
    }
    .pd-subtitle {
        font-size: 0.9rem !important;
    }
    .pd-description {
        font-size: 0.82rem !important;
    }
    .pd-specs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .pd-tabs {
        gap: 0;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .pd-tabs::-webkit-scrollbar { display: none; }
    .pd-tab {
        padding: 0.5rem 0.9rem;
        font-size: 0.75rem;
        flex-shrink: 0;
    }
    .specs-table th,
    .specs-table td {
        padding: 0.6rem 0.75rem;
        font-size: 0.75rem;
    }
}


/* ==========================================================================
   SMALL MOBILE: max-width 480px
   ========================================================================== */
@media (max-width: 480px) {

    .custom-container {
        padding: 0 4vw;
    }
    .hero-massive {
        font-size: 1.4rem !important;
    }
    .display-title-md {
        font-size: 1.25rem !important;
    }
    .page-hero-title {
        font-size: 1.5rem !important;
    }
    .page-hero {
        padding: 95px 0 2rem;
        min-height: 35vh;
    }

    /* All horizontal scroll cards shrink */
    .stats-card,
    .bento-large, .bento-wide, .bento-square,
    .testimonial-card,
    .premium-product-card,
    .profile-card,
    .value-card,
    .product-bento-card,
    .rd-card,
    .approach-card,
    .dept-card,
    .strength-card,
    .app-card,
    .benefit-card {
        flex: 0 0 85vw;
        min-width: 220px;
    }
    .pd-specs-grid {
        grid-template-columns: 1fr;
    }
    .vm-card {
        padding: 1.25rem 1rem;
    }
    .timeline-item,
    .timeline-item.right {
        width: calc(100% - 28px);
        margin-left: 28px;
    }
    .timeline-card {
        padding: 1rem;
    }
    .md-message {
        padding: 1.25rem 1rem;
    }
    .cta-epic-content h2 {
        font-size: 1.15rem !important;
    }

    /* Products page — compact cards */
    .products-sidebar {
        grid-template-columns: 1fr;
    }
    .product-placeholder {
        height: 130px;
    }
}


/* ==========================================================================
   UTILITY: Hide desktop-only hamburger pseudo from style.css
   The real hamburger is now a <button> in HTML handled by JS
   ========================================================================== */
@media (max-width: 768px) {
    .navbar::after {
        display: none !important; /* Remove CSS pseudo hamburger, we use a real button now */
    }
}
