/**
 * Rexian Industries — Dedicated Responsive Stylesheet
 * Ensures pixel-perfect presentation on Large Desktops, Laptops, Tablets, and Mobile devices.
 */

/* ─────────────────────────────────────────────────────────────────────────────
   1. TABLETS & MEDIUM SCREENS (max-width: 1024px)
───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Grids */
    .products-grid,
    .categories-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    .features-grid,
    .highlights-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .contact-layout,
    .quote-layout {
        grid-template-columns: 1fr !important;
        gap: 36px !important;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 36px !important;
    }

    .hero-title {
        font-size: 2.8rem !important;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   2. MOBILE NAVIGATION BREAKPOINT (max-width: 992px)
───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 992px) {
    .top-bar {
        display: none !important; /* Hide cluttered top info bar on mobile */
    }

    .main-nav {
        padding: 12px 0;
        background: #111827 !important; /* Always solid on mobile for readability */
    }

    .hamburger {
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        width: 32px;
        height: 26px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10001;
    }

    .hamburger-line {
        width: 100%;
        height: 3px;
        background: #FFFFFF;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .hamburger.active .hamburger-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .hamburger-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Mobile Menu Drawer */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 82%;
        max-width: 380px;
        height: 100vh;
        background: #111827;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
        flex-direction: column;
        align-items: flex-start;
        padding: 85px 24px 30px;
        gap: 0 !important;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 10000;
        overflow-y: auto;
        margin: 0;
    }

    .nav-menu.active,
    .nav-menu.open {
        right: 0 !important;
    }

    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .nav-menu > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 0;
        font-size: 1.05rem;
        color: #F3F4F6 !important;
        width: 100%;
    }

    .nav-menu > li.active > a {
        color: #F59E0B !important;
        font-weight: 700;
    }

    /* Mobile Dropdown Submenu */
    .has-dropdown .dropdown {
        position: static !important;
        box-shadow: none !important;
        background: rgba(255, 255, 255, 0.04) !important;
        border-radius: 6px;
        padding: 6px 16px !important;
        display: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    .has-dropdown.dropdown-open .dropdown {
        display: block !important;
    }

    .has-dropdown .dropdown li a {
        padding: 10px 0;
        font-size: 0.95rem;
        color: #CBD5E1 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    .has-dropdown.dropdown-open .dropdown-arrow {
        transform: rotate(180deg);
    }

    .nav-cta {
        margin-top: 20px;
        width: 100%;
    }

    .nav-cta .btn-quote {
        display: block !important;
        width: 100%;
        text-align: center;
        padding: 14px 20px !important;
        background: #F59E0B !important;
        color: #111827 !important;
        font-weight: 700 !important;
        border-radius: 8px;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   3. MOBILE PHONES (max-width: 768px)
───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* FLOATING WHATSAPP BUTTON (STRICTLY ON LEFT) */
    .whatsapp-float {
        left: 16px !important;
        right: auto !important;
        bottom: 16px !important;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 1.5rem !important;
    }

    .whatsapp-tooltip {
        display: none !important; /* Hide hover tooltip on touch devices */
    }

    /* Back to top offset from right */
    .back-to-top {
        right: 16px !important;
        bottom: 16px !important;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        width: 44px !important;
        height: 44px !important;
    }

    /* Typography */
    .hero-title {
        font-size: 2.1rem !important;
        line-height: 1.25 !important;
    }

    .hero-subtitle {
        font-size: 0.98rem !important;
    }

    .inner-hero {
        padding: 70px 0 45px !important;
        min-height: auto !important;
    }

    .inner-hero h1 {
        font-size: 2rem !important;
    }

    .section-padding {
        padding: 48px 0 !important;
    }

    /* Single column grids */
    .products-grid,
    .categories-grid,
    .gallery-grid,
    .features-grid,
    .highlights-grid,
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .contact-form-card,
    .quote-form-card {
        padding: 24px 18px !important;
    }

    /* Form two-column to single-column */
    .contact-form-card form > div[style*="grid-template-columns"],
    .quote-form-card form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .gallery-filters {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
    }

    .gallery-filters .filter-btn {
        flex-shrink: 0;
        font-size: 0.85rem !important;
        padding: 8px 16px !important;
    }

    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }

    .footer-bottom-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .footer-legal {
        justify-content: center !important;
        flex-wrap: wrap;
    }

    /* Buttons touch targets */
    .btn,
    .btn-primary,
    .btn-whatsapp,
    .btn-secondary {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100% !important; /* Stack action buttons full width on small screens */
        margin-bottom: 8px;
    }

    .product-actions {
        flex-direction: column !important;
    }

    .product-actions .btn {
        width: 100% !important;
    }

    /* Lightbox controls touch */
    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   4. ULTRA-SMALL SCREENS (max-width: 480px)
───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .logo-text {
        font-size: 1.15rem !important;
    }

    .hero-title {
        font-size: 1.85rem !important;
    }

    .category-highlights {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .highlight-item {
        padding: 12px 8px !important;
        font-size: 0.82rem !important;
    }
}

