/* ===================================
   RESPONSIVE STYLES - MOBILE ONLY
   =================================== */

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Wrapper */
.mobile-menu-wrapper {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    z-index: 9999;
    transition: right 0.4s ease;
}

.mobile-menu-wrapper.active {
    right: 0;
}

/* Mobile Menu Container */
.mobile-menu {
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
}

/* Mobile Menu Header */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.mobile-menu-logo img {
    height: 35px;
    width: auto;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.mobile-menu-close:hover {
    color: #ff6b6b;
}

/* Mobile Menu Content */
.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Mobile Search */
.mobile-search {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.mobile-search-form {
    display: flex;
    gap: 10px;
}

.mobile-search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.mobile-search-btn {
    padding: 10px 15px;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Mobile Navigation */
.mobile-nav {
    flex: 1;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #f5f5f5;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

.mobile-nav-link:hover {
    background: #f8f9fa;
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
    color: #666;
}

.mobile-nav-link.sale-link {
    color: #dc3545;
}

.mobile-nav-link.sale-link i {
    color: #dc3545;
}

/* Mobile Submenu */
.mobile-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f9f9f9;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-submenu.active {
    max-height: 500px;
}

.mobile-submenu li {
    border-top: 1px solid #eee;
}

.mobile-submenu a {
    display: block;
    padding: 12px 20px 12px 50px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.mobile-submenu a:hover {
    color: #333;
    background: #f0f0f0;
    padding-left: 55px;
}

/* Mobile Menu Footer */
.mobile-menu-footer {
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.mobile-account-links {
    padding: 20px;
}

.mobile-account-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.mobile-account-link:last-child {
    border-bottom: none;
}

.mobile-account-link i {
    width: 20px;
    text-align: center;
    color: #666;
}

.mobile-help {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #eee;
}

.mobile-help-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

/* Mobile Toggle Button (initially hidden) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 15px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 1px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Sale Link Styling */
.sale-link {
    color: #dc3545 !important;
    font-weight: 600;
}

/* ===================================
   TABLET & MOBILE MEDIA QUERIES
   =================================== */

/* Tablet Styles (768px and below) */
@media (max-width: 768px) {
    /* Container adjustments */
    .container {
        padding: 0 20px;
    }

    /* Navigation adjustments */
    .nav-scroll-container {
        margin: 0 20px;
    }

    .nav-scroll-left { 
        left: -35px; 
    }
    
    .nav-scroll-right { 
        right: -35px; 
    }

    /* Hide top bar on mobile */
    .top-bar { 
        display: none !important; 
    }

    /* Header layout */
    .header-content { 
        gap: 15px; 
    }

    /* Mobile search positioning - hide desktop search */
    .search-container {
        display: none !important;
    }

    /* Logo size reduction */
    .logo img {
        width: 120px !important;
        height: auto !important;
    }
    
    /* Header actions spacing */
    .header-actions { 
        gap: 15px; 
    }

    /* =================== */
    /* MOBILE MENU SETUP */
    /* =================== */
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Hide main navigation */
    .main-nav {
        display: none !important;
    }

    /* Product grid adjustments */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    /* Shop layout */
    .shop-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .filter-sidebar {
        position: static;
        order: 2;
    }

    /* Shop header */
    .shop-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .sort-controls { 
        justify-content: space-between; 
    }

    /* Footer adjustments */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .footer-bottom-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .payment-methods { 
        justify-content: center; 
    }

    /* Mega menu adjustments */
    .mega-menu {
        position: fixed !important;
        top: 140px !important;
        left: 0 !important;
        width: 100vw !important;
        max-height: calc(100vh - 140px) !important;
        overflow-y: auto !important;
    }

    .mega-menu.all-categories-mega .mega-menu-content {
        flex-direction: column !important;
        min-height: auto !important;
        max-height: 80vh !important;
    }
    
    .mega-menu-categories-section {
        flex: 1 !important;
        width: 100% !important;
        padding: 25px 20px !important;
    }
    
    .mega-menu-promo-section {
        flex: 0 0 120px !important;
        width: 100% !important;
    }
    
    .mega-menu-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 25px !important;
    }

    /* Hide ALL categories mega menu promotional section on small screens */
    .mega-menu-promo-section {
        display: none !important;
    }
}

/* Mobile Styles (480px and below) */
@media (max-width: 480px) {
    .container { 
        padding: 0 15px; 
    }
    
    .nav-scroll-container { 
        margin: 0; 
    }
    
    .nav-scroll-btn { 
        display: none !important; 
    }

    /* Header */
    .main-header { 
        padding: 10px 0; 
    }
    
    .header-content { 
        gap: 10px; 
    }
    
    .logo img {
        width: 100px !important;
        height: auto !important;
    }
    
    .header-actions { 
        gap: 10px; 
    }
    
    .header-action { 
        font-size: 18px; 
        padding: 6px; 
    }

    /* Product Grid */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card { 
        border-radius: 6px; 
    }
    
    .product-info { 
        padding: 10px; 
    }
    
    .product-name { 
        font-size: 13px; 
        height: 35px; 
    }
    
    .current-price { 
        font-size: 14px; 
    }
    
    .add-to-cart-btn { 
        padding: 8px; 
        font-size: 12px; 
    }

    /* Filter Sidebar */
    .filter-sidebar { 
        padding: 15px; 
    }
    
    .filter-title { 
        font-size: 14px; 
    }
    
    .filter-label { 
        font-size: 13px; 
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }

    .footer-main { 
        padding: 30px 0 20px; 
    }
    
    .social-links { 
        justify-content: center; 
    }

    .newsletter-input-group { 
        flex-direction: column; 
    }
    
    .newsletter-input {
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .newsletter-btn { 
        border-radius: 4px; 
    }

    .footer-bottom-links {
        flex-direction: column;
        gap: 10px;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .modal-header { 
        padding: 15px; 
    }
    
    .modal-body { 
        padding: 15px; 
    }

    /* Pagination */
    .pagination {
        gap: 5px;
        flex-wrap: wrap;
    }

    .pagination-btn {
        padding: 6px 10px;
        font-size: 13px;
    }

    /* Mega menu - single column */
    .mega-menu-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .mega-menu-categories-section {
        padding: 20px 15px !important;
    }

    .mega-menu-header h3 {
        font-size: 24px !important;
    }

    .mega-menu-header {
        flex-direction: column !important;
        gap: 15px !important;
        align-items: stretch !important;
    }

    .view-all-btn {
        text-align: center !important;
    }
}

/* Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
    .product-grid { 
        grid-template-columns: 1fr; 
    }
    
    .header-actions { 
        gap: 8px; 
    }
    
    .action-count {
        font-size: 9px;
        padding: 1px 4px;
        min-width: 14px;
    }

    .product-info { 
        padding: 8px; 
    }
    
    .add-to-cart-btn {
        font-size: 11px;
        padding: 6px;
    }
}

/* Hover Effects for Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .product-card:hover {
        transform: none;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .product-card:hover .product-image { 
        transform: none; 
    }

    .product-actions {
        opacity: 1;
        position: relative;
        top: auto;
        right: auto;
        flex-direction: row;
        justify-content: center;
        margin-top: 10px;
    }

    .nav-link:hover { 
        color: #000; 
    }
    
    .nav-item:active .nav-link { 
        color: var(--sheaker-orange); 
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .product-card:hover { 
        transform: none; 
    }
    
    .dropdown-menu { 
        transition: none; 
    }
    
    .mobile-menu-toggle span { 
        transition: none; 
    }
    
    .mobile-menu-wrapper {
        transition: none !important;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .filter-sidebar,
    .product-actions,
    .mobile-menu-toggle,
    .mobile-menu-wrapper,
    .mobile-menu-overlay,
    .modal {
        display: none !important;
    }

    .main-content { 
        margin: 0; 
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Search Toggle Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-container.active {
    animation: slideDown 0.3s ease;
}