/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    font-size: 22px;
    color: #2C3E50;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.mobile-menu-toggle:active {
    transform: scale(0.98);
}

/* Mobile Navigation Overlay */
.mobile-nav-strip {
    display: none;
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
}

/* Mobile Navigation Menu */
.mobile-nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.mobile-nav-menu.active {
    left: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #ffd000 0%, #ffdb33 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mobile-nav-close {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #2C3E50;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.mobile-nav-close:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

.mobile-nav-items {
    list-style: none;
    padding: 12px 0;
    margin: 0;
}

.mobile-nav-items li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mobile-nav-items a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    color: #2C3E50;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-nav-items a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.mobile-nav-items a:hover,
.mobile-nav-items a.active {
    background: linear-gradient(90deg, rgba(255, 208, 0, 0.08) 0%, transparent 100%);
    color: var(--primary-color);
    padding-left: 24px;
}

.mobile-nav-items a:hover::before,
.mobile-nav-items a.active::before {
    transform: scaleY(1);
}

.mobile-nav-items a i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--primary-color);
}

.mobile-nav-items button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 16px 20px;
    color: #e74c3c;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    transition: all 0.2s ease;
}

.mobile-nav-items button:hover {
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.08) 0%, transparent 100%);
    padding-left: 24px;
}

.mobile-nav-items button i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* ========================================
   TABLET RESPONSIVE (768px - 1024px)
   ======================================== */

@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    /* Header Adjustments */
    .header-top {
        gap: 15px;
    }

    .search-bar {
        min-width: 200px;
    }

    .header-actions {
        gap: 15px;
    }

    .action-link {
        font-size: 18px;
    }

    /* Navigation */
    .nav-menu {
        gap: 20px;
        margin-left: 20px;
    }

    /* Hero Slider */
    .hero-slider {
        height: 400px;
    }

    .slide-content {
        padding: 30px 40px;
    }

    .slide-content h2 {
        font-size: 36px;
    }

    .slide-content p {
        font-size: 18px;
    }

    /* Products Grid */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }

    /* Categories Grid */
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
    }
}

/* ========================================
   MOBILE RESPONSIVE (max-width: 768px)
   ======================================== */

@media (max-width: 768px) {
    /* Show Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 3;
        flex-shrink: 0;
    }

    /* Header Responsive */
    .header {
        padding: 12px 0;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

    .header-top {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .logo {
        order: 1;
        flex: 0 0 auto;
    }

    .logo img {
        height: 36px !important;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    }

    /* Search bar on mobile - between logo and hamburger */
    .search-bar {
        display: flex;
        order: 2;
        flex: 1;
        min-width: 0;
    }

    /* Hide action icons on mobile - they'll be in the menu */
    .header-actions {
        display: none;
    }

    .mobile-menu-toggle {
        order: 3;
    }

    /* Hide Desktop Navigation */
    .navbar .nav-wrapper {
        display: none;
    }

    /* Mobile Nav Strip - horizontal scrollable below header */
    .mobile-nav-strip {
        display: flex;
        overflow-x: auto;
        background: #ffd000;
        border-top: 1px solid rgba(0,0,0,0.08);
        padding: 0 10px;
        gap: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .mobile-nav-strip::-webkit-scrollbar {
        display: none;
    }

    .mobile-nav-strip a {
        flex-shrink: 0;
        padding: 10px 14px;
        font-size: 13px;
        font-weight: 600;
        color: #222;
        text-decoration: none;
        white-space: nowrap;
        border-bottom: 3px solid transparent;
    }

    .mobile-nav-strip a.active,
    .mobile-nav-strip a:hover {
        border-bottom: 3px solid #222;
    }

    /* Hero Slider Mobile */
    .hero-slider {
        height: 320px;
        border-radius: 0 0 20px 20px;
        overflow: hidden;
    }

    .slide-content {
        padding: 24px 28px;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(12px);
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    .slide-content h2 {
        font-size: 26px;
        margin-bottom: 12px;
        font-weight: 700;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .slide-content p {
        font-size: 15px;
        margin-bottom: 18px;
        line-height: 1.5;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    }

    .btn-primary {
        padding: 12px 28px;
        font-size: 14px;
        border-radius: 10px;
        font-weight: 600;
        box-shadow: 0 4px 16px rgba(255, 165, 0, 0.4);
        transition: all 0.3s ease;
    }

    .btn-primary:active {
        transform: scale(0.96);
    }

    .slider-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.9);
        color: var(--primary-color);
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .slider-btn:hover {
        background: white;
    }

    .slider-btn.prev {
        left: 12px;
    }

    .slider-btn.next {
        right: 12px;
    }

    .slider-dots {
        bottom: 18px;
        gap: 8px;
    }

    .dot {
        width: 8px;
        height: 8px;
        background: rgba(255, 255, 255, 0.5);
        backdrop-filter: blur(4px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .dot.active {
        width: 24px;
        border-radius: 4px;
        background: white;
    }

    /* Section Spacing */
    .categories-section,
    .deals-section,
    .vendors-section {
        padding: 45px 0;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 28px;
        padding-bottom: 16px;
        border-bottom: 2px solid rgba(255, 208, 0, 0.2);
    }

    .section-header h2 {
        font-size: 26px;
        font-weight: 700;
        color: var(--dark-color);
        position: relative;
        padding-left: 12px;
    }

    .section-header h2::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 4px;
        height: 70%;
        background: var(--primary-color);
        border-radius: 2px;
    }

    .view-all {
        font-size: 14px;
        font-weight: 600;
        padding: 8px 16px;
        background: rgba(255, 208, 0, 0.1);
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .view-all:active {
        transform: scale(0.96);
        background: rgba(255, 208, 0, 0.2);
    }

    /* Products Grid Mobile */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .product-card {
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
    }

    .product-card:active {
        transform: scale(0.98);
    }

    .product-image {
        height: 180px;
        position: relative;
        overflow: hidden;
    }

    .product-image::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 40px;
        background: linear-gradient(to top, rgba(0,0,0,0.1), transparent);
        pointer-events: none;
    }

    .product-info {
        padding: 12px;
        background: white;
    }

    .product-info h4 {
        font-size: 14px;
        margin-bottom: 8px;
        line-height: 1.4;
        font-weight: 600;
    }

    .rating {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .current-price {
        font-size: 17px;
        font-weight: 700;
    }

    .old-price {
        font-size: 13px;
    }

    .btn-cart {
        padding: 10px;
        font-size: 13px;
        border-radius: 8px;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(255, 165, 0, 0.3);
        transition: all 0.3s ease;
    }

    .btn-cart:active {
        transform: scale(0.96);
    }

    /* Product Actions - Always Visible on Mobile */
    .product-actions {
        opacity: 1;
    }

    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Categories Grid Mobile */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .category-card {
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
    }

    .category-card:active {
        transform: scale(0.96);
    }

    .category-card h3 {
        font-size: 13px;
        padding: 10px;
        font-weight: 600;
    }

    .category-image {
        height: 100px;
        border-radius: 12px 12px 0 0;
    }

    /* Vendors Grid Mobile */
    .vendors-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .vendor-card {
        padding: 20px;
    }

    .vendor-header img {
        width: 60px;
        height: 60px;
    }

    .vendor-info h3 {
        font-size: 16px;
    }

    /* Newsletter Mobile */
    .newsletter-section {
        padding: 45px 0;
        background: linear-gradient(135deg, #FFA500 0%, #FF8C00 100%);
        position: relative;
        overflow: hidden;
    }

    .newsletter-section::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -20%;
        width: 300px;
        height: 300px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        filter: blur(60px);
    }

    .newsletter-content {
        flex-direction: column;
        gap: 28px;
        text-align: center;
        position: relative;
        z-index: 1;
    }

    .newsletter-text h2 {
        font-size: 26px;
        font-weight: 700;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .newsletter-text p {
        font-size: 15px;
        opacity: 0.95;
    }

    .newsletter-form {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        gap: 12px;
    }

    .newsletter-form input {
        padding: 14px 18px;
        border-radius: 12px;
        font-size: 15px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    .newsletter-form input:focus {
        border-color: white;
        outline: none;
    }

    .btn-subscribe {
        padding: 14px 28px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 15px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }

    .btn-subscribe:active {
        transform: scale(0.96);
    }

    /* Footer Mobile */
    .footer {
        padding: 40px 0 20px;
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-section {
        text-align: center;
        padding: 20px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 12px;
    }

    .footer-section h3 {
        font-size: 17px;
        margin-bottom: 16px;
        font-weight: 600;
        position: relative;
        padding-bottom: 10px;
    }

    .footer-section h3::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 3px;
        background: var(--primary-color);
        border-radius: 2px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding-top: 25px;
        font-size: 13px;
    }

    .social-links {
        justify-content: center;
        gap: 12px;
    }

    .social-links a {
        width: 44px;
        height: 44px;
        font-size: 18px;
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(10px);
        transition: all 0.3s ease;
    }

    .social-links a:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
    }

    /* Chatbot Mobile */
    #chatbot-container {
        bottom: 15px !important;
        right: 15px !important;
    }

    .chat-toggle {
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }

    .chat-window {
        width: calc(100vw - 30px) !important;
        height: calc(100vh - 100px) !important;
        bottom: 75px !important;
        right: 0 !important;
        left: 15px !important;
    }
}

/* ========================================
   SMALL MOBILE (max-width: 480px)
   ======================================== */

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

    /* Header Extra Small */
    .header {
        padding: 10px 0;
    }

    .header-top {
        gap: 12px;
    }

    .logo img {
        height: 32px !important;
    }

    .mobile-menu-toggle {
        font-size: 20px;
        width: 40px;
        height: 40px;
    }

    /* Hero Slider Extra Small */
    .hero-slider {
        height: 250px;
    }

    .slide-content {
        padding: 15px 20px;
    }

    .slide-content h2 {
        font-size: 20px;
    }

    .slide-content p {
        font-size: 13px;
    }

    .btn-primary {
        padding: 8px 20px;
        font-size: 13px;
    }

    /* Section Headers */
    .section-header h2 {
        font-size: 20px;
    }

    /* Products Grid - Single Column */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-image {
        height: 150px;
    }

    .product-info {
        padding: 10px;
    }

    .product-info h4 {
        font-size: 13px;
    }

    .current-price {
        font-size: 15px;
    }

    /* Categories Grid - 2 Columns */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .category-image {
        height: 80px;
    }

    .category-card h3 {
        font-size: 12px;
        padding: 8px;
    }

    /* Newsletter Extra Small */
    .newsletter-text h2 {
        font-size: 20px;
    }

    .newsletter-text p {
        font-size: 14px;
    }

    /* Footer Extra Small */
    .footer {
        padding: 30px 0 15px;
    }

    .footer-section {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        font-size: 13px;
    }
}

/* ========================================
   LANDSCAPE MOBILE ORIENTATION
   ======================================== */

@media (max-width: 768px) and (orientation: landscape) {
    .hero-slider {
        height: 350px;
    }

    .slide-content h2 {
        font-size: 28px;
    }

    .slide-content p {
        font-size: 15px;
    }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    .action-link,
    .nav-menu a,
    .btn-primary,
    .btn-cart,
    .action-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .product-card:hover {
        transform: none;
    }

    .category-card:hover {
        transform: none;
    }

    /* Always show product actions on touch devices */
    .product-actions {
        opacity: 1;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-main:focus {
    top: 0;
}

/* Reduced 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;
    }
}
