/* ==========================================================================
   FAST PRINTS Mobile Responsive Stylesheet
   Desktop: unchanged above 768px. Mobile: all max-width queries.
   ========================================================================== */

/* 0. Global base */
html, body { width: 100%; max-width: 100%; overflow-x: clip; }
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; }

/* A. Desktop class definitions for inline-style replacements in home.php */
.fp-trust-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 540px;
    margin-top: 10px;
}
.fp-express-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}
.fp-express-cta { white-space: nowrap; flex-shrink: 0; }
.fp-studio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.fp-steps-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 44px;
}

/* B. Hero hover transform fix - touch devices keep hover state permanently */
@media (hover: none) {
    .hero-service-btn:hover { transform: none !important; }
}
@media (max-width: 768px) {
    .hero-service-btn:hover { transform: none; }
    .hero-glow-orb { animation: none; }
}

/* 1. Container */
@media (max-width: 600px) { .container { padding: 0 14px; } }

/* 2. Top bar */
@media (max-width: 768px) {
    .top-bar .container { flex-direction: column; align-items: flex-start; gap: 4px; }
    .express-banner-text { font-size: 0.72rem; white-space: normal; min-width: 0; }
    .top-nav-links { display: none; }
}

/* 3. Header */
@media (max-width: 768px) {
    .header-row { flex-wrap: wrap; gap: 8px; padding: 10px 0; align-items: center; }
    .brand-logo { flex: 1 1 auto; min-width: 0; overflow: hidden; gap: 7px; }
    .brand-logo .fp-shield { width: 32px; height: 36px; flex-shrink: 0; }
    .brand-logo .fp-main { font-size: 1.0rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .brand-logo .fp-tag { display: none; }
    .search-box-container { order: 3; flex: 0 0 100%; max-width: 100%; min-width: 0; }
    .search-input { width: 100%; min-width: 0; font-size: 0.88rem; }
    .header-actions { flex-shrink: 0; gap: 10px; min-width: 0; }
    .header-row > * { min-width: 0; }
}
@media (max-width: 480px) { .header-actions { gap: 8px; } }

/* 4. Navigation */
@media (max-width: 768px) {
    .nav-menu-bar { overflow: hidden; }
    .nav-menu-bar .container { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .nav-menu-bar .container::-webkit-scrollbar { display: none; }
    .nav-links-list { flex-wrap: nowrap; width: max-content; padding: 0 12px; }
    .nav-link { padding: 11px 12px; font-size: 0.78rem; white-space: nowrap; }
    .mega-menu { display: none !important; }
}

/* 5. Hero */
@media (max-width: 768px) {
    .hero-section { padding: 36px 0 28px; overflow: hidden; min-height: auto; }
    .hero-text-block { max-width: 100%; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 0.95rem; margin-bottom: 20px; max-width: 100%; }
    .fp-trust-stats { max-width: 100%; }
    .hero-video-controls { right: 8px; bottom: 8px; padding: 0.2rem 0.35rem; gap: 0.25rem; max-width: calc(100vw - 16px); flex-wrap: wrap; }
    .hero-scene-btn, .hero-video-toggle { padding: 0.2rem 0.5rem; font-size: 0.64rem; }
}
@media (max-width: 600px) {
    .hero-title { font-size: 1.95rem; }
    .hero-subtitle { font-size: 0.90rem; }
    .hero-actions { flex-direction: column; gap: 10px; margin-bottom: 24px; }
    .hero-actions .btn-primary,
    .hero-actions .btn-secondary,
    .hero-actions .btn-yellow,
    .hero-actions .btn-dark { width: 100%; justify-content: center; }
    .section-title { font-size: 1.5rem; }
    .section-subtitle { font-size: 0.90rem; margin-bottom: 24px; }
}
@media (max-width: 480px) {
    .hero-title { font-size: 1.7rem; }
    .section-title { font-size: 1.35rem; }
}

/* 6. Trust stats */
@media (max-width: 480px) {
    .fp-trust-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
}

/* 7. Marquee / services ticker */
@media (max-width: 768px) {
    .services-showcase-section { padding: 32px 0 40px; }
    .services-showcase-header { max-width: 100%; margin-bottom: 24px; }
    .header-services-ticker { overflow: hidden; }
    .services-marquee-viewport { overflow: hidden; }
}

/* 8. Express banner */
@media (max-width: 768px) {
    .fp-express-row { flex-direction: column; align-items: flex-start; }
    .fp-express-cta { white-space: normal; flex-shrink: 1; width: 100%; justify-content: center; text-align: center; }
}

/* 9. Design Studio */
@media (max-width: 768px) {
    .fp-studio-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* 10. How It Works steps */
@media (max-width: 900px) { .fp-steps-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; } }
@media (max-width: 600px) { .fp-steps-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; } }

/* 11. Categories & Category Page */
@media (max-width: 900px) {
    .categories-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
    .fp-category-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
    .fp-category-banner { padding: 18px 16px !important; margin-bottom: 20px !important; }
    .fp-category-banner h1 { font-size: 1.65rem !important; }
    .fp-category-banner p { font-size: 0.90rem !important; }
    /* Mobile Filter Drawer Overlay & Sidebar (Hidden by default, slides from left when opened) */
    #filterForm,
    .filter-sidebar { 
        position: fixed !important; 
        top: 0 !important; 
        left: 0 !important; 
        bottom: 0 !important; 
        width: 320px !important; 
        max-width: 86vw !important; 
        height: 100% !important; 
        height: 100dvh !important; 
        max-height: 100dvh !important; 
        background: #ffffff !important; 
        z-index: 99999 !important; 
        display: flex !important; 
        flex-direction: column !important; 
        padding: 0 !important; 
        border: none !important; 
        border-right: 1px solid #e2e8f0 !important; 
        border-radius: 0 16px 16px 0 !important; 
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28) !important; 
        transform: translateX(-100%) !important; 
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important; 
        margin: 0 !important; 
        overflow: hidden !important; 
    }

    #filterForm.is-open,
    .filter-sidebar.is-open { 
        transform: translateX(0) !important; 
    }

    /* Backdrop overlay when filter drawer is open */
    .fp-mobile-filter-overlay {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(2px) !important;
        -webkit-backdrop-filter: blur(2px) !important;
        z-index: 99998 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.25s ease !important;
    }

    .fp-mobile-filter-overlay.active {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Mobile Filter Toggle Button at Top-Left */
    .fp-mobile-filter-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 58px !important;
        min-width: 58px !important;
        height: 58px !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        cursor: pointer !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
        transition: all 0.2s ease !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
        user-select: none !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .fp-mobile-filter-btn:hover {
        background: #f8fafc !important;
        border-color: #cbd5e1 !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    }

    .fp-mobile-filter-btn:active {
        background: #f1f5f9 !important;
        border-color: #94a3b8 !important;
        transform: scale(0.96) !important;
    }

    .fp-mobile-filter-btn svg {
        display: block !important;
        stroke: #111827 !important;
    }

    /* Drawer Header */
    .fp-filter-drawer-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 16px 20px !important;
        border-bottom: 1px solid #e2e8f0 !important;
        background: #ffffff !important;
        flex-shrink: 0 !important;
        margin-bottom: 0 !important;
    }

    .fp-filter-drawer-close {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 36px !important;
        height: 36px !important;
        border-radius: 8px !important;
        border: 1px solid #e2e8f0 !important;
        background: #f8fafc !important;
        color: #111827 !important;
        cursor: pointer !important;
        transition: all 0.15s ease !important;
        padding: 0 !important;
    }

    .fp-filter-drawer-close:hover,
    .fp-filter-drawer-close:active {
        background: #fee2e2 !important;
        border-color: #fca5a5 !important;
        color: #ef4444 !important;
    }

    /* Drawer Scrollable Body */
    .fp-filter-drawer-body {
        flex: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 20px !important;
    }

    /* Drawer Footer Action */
    .fp-filter-drawer-footer {
        display: block !important;
        padding: 14px 20px !important;
        border-top: 1px solid #e2e8f0 !important;
        background: #ffffff !important;
        flex-shrink: 0 !important;
    }

    .fp-filter-apply-btn {
        width: 100% !important;
        padding: 12px !important;
        font-size: 0.92rem !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
        text-align: center !important;
        background: #111111 !important;
        color: #ffffff !important;
        border: none !important;
        cursor: pointer !important;
        transition: background 0.2s ease !important;
    }

    .fp-filter-apply-btn:hover {
        background: #ffc107 !important;
        color: #111111 !important;
    }

    /* Prevent body background scroll while filter drawer is open */
    body.fp-filter-open {
        overflow: hidden !important;
    }

    #productsGrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
}
@media (max-width: 480px) {
    .categories-grid { gap: 8px; }
    .category-card { padding: 12px 10px; }
    .category-card img { height: 100px; }
    .category-card h3 { font-size: 0.82rem; }
    .category-card p { font-size: 0.70rem; }
    #productsGrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
    .product-thumb-wrap { height: 155px !important; display: flex !important; align-items: center !important; justify-content: center !important; overflow: hidden !important; }
    .product-thumb-wrap img { width: 100% !important; height: 100% !important; object-fit: contain !important; object-position: center !important; display: block !important; transform: none !important; }
}

/* 12. Products grid */
@media (max-width: 1024px) { .products-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 480px) { .products-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; } }
@media (max-width: 360px) { .products-grid { grid-template-columns: minmax(0,1fr); } }

/* 13. Product card */
@media (max-width: 600px) {
    .product-thumb-wrap { height: 155px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
    .product-thumb-wrap img { width: 100%; height: 100%; object-fit: contain !important; object-position: center !important; display: block; transform: none !important; }
    .product-info { padding: 10px; }
    .product-title { font-size: 0.84rem; }
    .product-price-row { flex-wrap: wrap; gap: 7px; }
}

/* 14. PDP */
@media (max-width: 900px) {
    .product-detail-layout, .pdp-two-column { grid-template-columns: 1fr !important; gap: 20px !important; padding: 10px 0; }
    .preview-gallery, .pdp-sticky-gallery { position: static; top: auto; width: 100% !important; }
    .main-preview-img { height: 260px; }
    .pdp-main-image-card { min-height: 260px; width: 100% !important; }
}
@media (max-width: 600px) {
    .configurator-panel { padding: 16px 12px; }
    .price-total-row { font-size: 1.15rem; }
    .option-pill { padding: 7px 12px; font-size: 0.78rem; }
    .btn-primary-gradient, .btn-secondary-outline { width: 100%; justify-content: center; }
    .qty-slabs-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
    .trust-badges-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
    .pdp-tab-content { padding: 14px; }
}

/* 15. Checkout & Bulk Order Grids */
@media (max-width: 900px) {
    .fp-checkout-grid, .fp-bulk-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
}

/* 15. Cart */
@media (max-width: 768px) {
    .cart-layout { grid-template-columns: 1fr !important; gap: 20px; padding: 20px 0; }
    .cart-table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .cart-table { min-width: 480px; }
}
@media (max-width: 600px) { .cart-table th, .cart-table td { padding: 9px 10px; font-size: 0.78rem; } }

/* 16. Tracking */
@media (max-width: 600px) {
    .tracking-pipeline { flex-direction: column; align-items: flex-start; gap: 16px; margin: 20px 0 10px; }
    .tracking-pipeline::before { top: 24px; bottom: 24px; left: 24px; right: auto; width: 3px; height: auto; }
    .tracker-step { display: flex; align-items: center; gap: 12px; text-align: left; flex: none; }
    .tracker-icon { margin: 0; flex-shrink: 0; }
}

/* 17. Footer */
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; gap: 20px; } .main-footer { padding: 36px 0 18px; } }

/* 18. Auth modal & Login Page */
@media (max-width: 600px) {
    #authModal, .auth-modal-overlay {
        padding: 12px !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }
    #authModal > div, .auth-modal-card {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        margin: 0 auto !important;
        padding: 24px 18px !important;
        box-sizing: border-box !important;
        max-height: calc(100vh - 24px) !important;
        overflow-y: auto !important;
        border-radius: 12px !important;
    }
    #authModal form,
    #authModal input,
    #authModal button,
    #authModal select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    #closeAuthModal {
        top: 10px !important;
        right: 10px !important;
        width: 36px !important;
        height: 36px !important;
    }
}
@media (max-width: 768px) {
    .fp-login-page-container {
        padding: 24px 12px !important;
        min-height: auto !important;
    }
    .fp-login-card-grid {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
    }
    .fp-login-card-grid > div {
        padding: 24px 18px !important;
    }
}

/* 19. WhatsApp */
@media (max-width: 480px) {
    .whatsapp-float { bottom: 16px; right: 16px; width: 50px; height: 50px; }
    .whatsapp-tooltip { display: none; }
}

/* 20. Admin */
@media (max-width: 900px) {
    .admin-main { padding: 18px 14px; }
    .metrics-cards-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
    .metric-number { font-size: 1.6rem; }
}

/* 21. Editor */
@media (max-width: 768px) {
    .editor-container { grid-template-columns: 1fr; height: auto; }
    .editor-toolbar, .editor-sidebar { display: none; }
    .editor-canvas-stage { padding: 16px; }
}

/* 22. Forms - iOS zoom fix */
@media (max-width: 768px) {
    input[type="text"], input[type="email"], input[type="password"],
    input[type="tel"], input[type="number"], input[type="search"],
    select, textarea { font-size: 16px; width: 100%; min-width: 0; }
}

/* 23. Tables */
@media (max-width: 768px) {
    .table-responsive, .admin-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* 24. Buttons */
@media (max-width: 600px) {
    .btn-primary, .btn-secondary, .btn-yellow, .btn-dark { max-width: 100%; word-break: break-word; }
}

/* 25. Mobile sticky bar */
@media (max-width: 768px) {
    .mobile-sticky-buy-bar { padding: 10px 14px; gap: 10px; }
    .mobile-sticky-buy-bar .btn-primary-gradient { flex: 1; padding: 11px 12px; font-size: 0.86rem; }
}

/* 26. Checkout */
@media (max-width: 768px) {
    .fp-checkout-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
}
@media (max-width: 640px) {
    .fp-contact-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
}

