/**
 * Responsive Styles
 * Mobile-first responsive design
 */

/* ==========================================
   EXTRA SMALL DEVICES (phones, less than 576px)
   ========================================== */
@media (max-width: 575.98px) {
    /* Typography */
    h1 {font-size: 32px;}
    h2 {font-size: 26px;}
    h3 {font-size: 22px;}
    h4 {font-size: 18px;}
    
    /* Top Bar */
    .top-bar {
        font-size: 12px;
        padding: 8px 0;
    }
    
    .top-bar-left {
        display: none;
    }
    
    .promo-text {
        font-size: 11px;
        margin-right: 10px;
    }
    
    .social-links {
        gap: 5px;
    }
    
    .social-link {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    /* Header */
    .main-header {
        padding: 12px 0;
    }
    
    .main-header .row {
        align-items: center;
    }
    
    .logo a {
        font-size: 18px;
    }
    
    .logo-image {
        height: 35px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .logo-icon {
        font-size: 24px;
    }
    
    .header-actions {
        gap: 6px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: nowrap;
        width: 100%;
    }
    
    .header-action-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        flex-shrink: 0;
        padding: 0;
        border-radius: 50%;
    }
    
    .header-action-btn i {
        font-size: 16px;
    }
    
    /* Hide search on very small screens */
    .search-toggle {
        display: none !important;
    }
    
    /* User dropdown simpler on mobile */
    .user-dropdown-wrapper .dropdown-toggle-icon {
        display: none;
    }
    
    /* Search Bar */
    .search-input {
        padding: 12px 100px 12px 15px;
        font-size: 14px;
    }
    
    /* Search Suggestions */
    .search-suggestions {
        max-height: 400px;
    }
    
    .suggestion-item {
        padding: 10px 15px;
        gap: 10px;
    }
    
    .suggestion-image {
        width: 50px;
        height: 50px;
    }
    
    .suggestion-name {
        font-size: 13px;
    }
    
    .suggestion-category {
        font-size: 11px;
    }
    
    .suggestion-price {
        font-size: 14px;
    }
    
    .view-all-results {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    /* Product Grid */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 10px;
    }
    
    .product-card {
        max-width: 100%;
        border-radius: 12px;
    }
    
    .product-title {
        font-size: 13px;
        line-height: 1.3;
    }
    
    .product-price {
        font-size: 14px;
        font-weight: 700;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .btn-lg {
        padding: 12px 30px;
        font-size: 15px;
    }
    
    /* Section */
    :root {
        --section-padding: 40px;
    }
    
    .section-title {
        font-size: 26px;
        margin-bottom: 30px;
    }
    
    /* Footer */
    .newsletter-section {
        padding: 30px 0;
    }
    
    .newsletter-title {
        font-size: 22px;
    }
    
    .newsletter-form .input-group {
        flex-direction: column;
    }
    
    .newsletter-form .btn {
        width: 100%;
        margin-top: 10px;
    }
    
    .footer-widget {
        margin-bottom: 30px;
    }
    
    .trust-badges {
        padding: 30px 0;
    }
    
    .trust-badge {
        margin-bottom: 20px;
    }
    
    .footer-bottom {
        text-align: center;
    }
    
    .payment-methods {
        margin-top: 15px;
    }
}

/* ==========================================
   SMALL DEVICES (landscape phones, 576px and up)
   ========================================== */
@media (min-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    /* Navigation */
    .main-navigation {
        display: none;
    }
    
    /* Mobile Menu */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Search Suggestions */
    .suggestion-item {
        padding: 10px 15px;
    }
    
    .suggestion-image {
        width: 55px;
        height: 55px;
    }
    
    /* Product Cards */
    .product-actions {
        opacity: 1;
        transform: translateX(0);
    }
    
    .product-action-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    /* Glass Effects */
    .glass-filter-sidebar {
        position: static;
        margin-bottom: 30px;
    }
}

/* ==========================================
   MEDIUM DEVICES (tablets, 768px and up)
   ========================================== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mobile-menu-toggle {
        display: flex !important;
    }
}

@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    /* Header */
    .main-navigation {
        display: none;
    }
    
    /* Top Bar */
    .top-bar-right {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }
    
    .promo-text {
        margin-right: 0;
        font-size: 12px;
    }
    
    /* Footer */
    .footer-widget-title {
        font-size: 18px;
    }
}

/* ==========================================
   LARGE DEVICES (desktops, 992px and up)
   ========================================== */
@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .mobile-nav,
    .mobile-nav-overlay {
        display: none !important;
    }
}

/* ==========================================
   EXTRA LARGE DEVICES (large desktops, 1200px and up)
   ========================================== */
@media (min-width: 1200px) {
    .container {
        max-width: 1320px;
    }
}

/* ==========================================
   XXL DEVICES (larger desktops, 1400px and up)
   ========================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
}

/* ==========================================
   CUSTOM BREAKPOINTS
   ========================================== */

/* Hero Section Responsive */
@media (max-width: 991.98px) {
    .hero-content {
        text-align: center;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
}

/* Filter Sidebar Responsive */
@media (max-width: 991.98px) {
    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 300px;
        height: 100vh;
        background: white;
        z-index: 9999;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 20px;
    }
    
    .filter-sidebar.active {
        left: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .filter-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .filter-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* Product Detail Responsive */
@media (max-width: 767.98px) {
    .product-detail-gallery {
        margin-bottom: 30px;
    }
    
    .product-detail-info {
        padding: 20px;
    }
    
    .product-price-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .quantity-selector {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .product-actions-group {
        flex-direction: column;
    }
    
    .product-actions-group .btn {
        width: 100%;
    }
}

/* Cart Responsive */
@media (max-width: 991.98px) {
    .cart-table-wrapper {
        overflow-x: auto;
    }
    
    .cart-summary {
        margin-top: 30px;
    }
}

@media (max-width: 575.98px) {
    .cart-item {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-item-image {
        margin: 0 auto 15px;
    }
    
    .cart-item-details {
        width: 100%;
    }
    
    .cart-item-actions {
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }
}

/* Checkout Responsive */
@media (max-width: 991.98px) {
    .checkout-form {
        margin-bottom: 30px;
    }
    
    .order-summary {
        position: static;
    }
}

/* Account Dashboard Responsive */
@media (max-width: 767.98px) {
    .account-sidebar {
        margin-bottom: 30px;
    }
    
    .account-nav {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .account-nav-item {
        white-space: nowrap;
    }
}

/* Modal Responsive */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        border-radius: 12px;
    }
}

/* Table Responsive */
@media (max-width: 991.98px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Form Responsive */
@media (max-width: 575.98px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100% !important;
    }
}

/* Glass Effects Responsive */
@media (max-width: 767.98px) {
    .glass-card,
    .glass-product-card {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .glass-card,
    .glass-dropdown,
    .glass-button {
        border: 2px solid currentColor;
    }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* Print styles */
@media print {
    .main-header,
    .main-footer,
    .back-to-top,
    .filter-sidebar,
    .product-actions {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .glass-card {
        background: white;
        border: 1px solid #ddd;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .product-actions {
        opacity: 1;
        transform: translateX(0);
    }
    
    .hover-lift:hover,
    .hover-scale:hover {
        transform: none;
    }
    
    /* Make touch targets larger */
    .header-action-btn,
    .product-action-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Landscape orientation */
@media (max-width: 991.98px) and (orientation: landscape) {
    .mobile-nav {
        width: 250px;
    }
    
    .hero-section {
        min-height: auto;
        padding: 60px 0;
    }
}
