/* ============================================
   Zam Zam Lahan - Responsive Styles
   Mobile-First Adaptive Layouts
   ============================================ */

/* ============ Mobile (< 576px) ============ */
@media (max-width: 575.98px) {
    .hero-section {
        padding: 50px 0 40px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin: 0 auto;
    }
    
    .hero-stats {
        justify-content: center;
        gap: 1.5rem;
    }
    
    .hero-stat-number {
        font-size: 1.4rem;
    }
    
    .section {
        padding: 30px 0;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .product-card {
        border-radius: 14px;
    }
    
    .product-card-body {
        padding: 1rem;
    }
    
    .price-current {
        font-size: 1.1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .auth-card .auth-title {
        font-size: 1.3rem;
    }
    
    .content-card {
        padding: 1rem;
        border-radius: 14px;
    }
    
    .cart-item {
        gap: 0.75rem;
    }
    
    .cart-item-img {
        width: 60px;
        height: 45px;
    }
    
    .cart-item-title {
        font-size: 0.85rem;
    }
    
    .invoice-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .mobile-full-btn {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
        border-radius: 12px;
    }
    
    /* pcard grid is handled by home-product-grid CSS */
}

/* ============ Small Tablets (576px - 767px) ============ */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .product-grid .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ============ Tablets (768px - 991px) ============ */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .product-grid .col-md-4 {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }
    
    /* Tablet still uses mobile nav */
    .main-content {
        padding-top: 56px;
        padding-bottom: 70px;
    }
}

/* ============ Desktop (992px+) ============ */
@media (min-width: 992px) {
    .hero-section {
        padding: 100px 0;
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .section {
        padding: 70px 0;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .product-grid .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    
    .auth-container {
        min-height: calc(100vh - 200px);
    }
}

/* ============ Large Desktop (1200px+) ============ */
@media (min-width: 1200px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .container {
        max-width: 1200px;
    }
}

/* ============ Touch-friendly Mobile Adjustments ============ */
@media (max-width: 991.98px) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .form-control, .form-select {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Smooth scrolling for filter chips */
    .filter-chips {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .filter-chips::-webkit-scrollbar {
        display: none;
    }
    
    /* Full-width buttons on mobile */
    .btn-mobile-full {
        width: 100%;
    }
    
    /* Mobile card spacing */
    .mobile-card-spacing > * {
        margin-bottom: 12px;
    }
    
    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }
    
    /* Mobile product detail */
    .product-detail-container {
        padding: 0;
    }
    
    .product-detail-img {
        border-radius: 0;
        margin: -16px -16px 16px;
    }
}

/* ============ Desktop-only Adjustments ============ */
@media (min-width: 992px) {
    .mobile-only {
        display: none !important;
    }
    
    /* Desktop hover effects */
    .product-card {
        cursor: pointer;
    }
    
    /* Sidebar layout for dashboard */
    .dashboard-layout {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 2rem;
        min-height: calc(100vh - 120px);
    }
    
    .dashboard-sidebar {
        background: var(--bg-card);
        border-radius: 16px;
        border: 1px solid var(--border-color);
        padding: 1.5rem;
        height: fit-content;
        position: sticky;
        top: 80px;
    }
    
    .dashboard-content {
        min-width: 0;
    }
}

/* ============ Dark mode specific responsive ============ */
@media (max-width: 991.98px) {
    [data-theme="dark"] .mobile-appbar {
        background: #0a0a15;
    }
    
    [data-theme="dark"] .mobile-bottom-nav {
        background: #0a0a15;
        border-top-color: #1a1a2e;
    }
    
    [data-theme="dark"] .mobile-slide-menu {
        background: #0f0f1a;
    }
}

/* ============ Print Styles ============ */
@media print {
    .mobile-appbar,
    .mobile-bottom-nav,
    .desktop-nav,
    .site-footer,
    .mobile-slide-menu,
    .mobile-menu-overlay {
        display: none !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
    }
}

/* ============ Safe area for notched phones ============ */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(60px + env(safe-area-inset-bottom));
    }
    
    .main-content {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
    
    .mobile-appbar {
        padding-top: env(safe-area-inset-top);
    }
}

/* ============ Landscape Mobile ============ */
@media (max-width: 991.98px) and (orientation: landscape) {
    .hero-section {
        padding: 30px 0;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .mobile-bottom-nav {
        height: 50px;
    }
    
    .bottom-nav-item span {
        display: none;
    }
    
    .bottom-nav-item i {
        font-size: 1.3rem;
    }
}
