/**
 * Responsive Styles
 * Nutfields E-commerce Platform
 */

/* ============================================
   DESKTOP SMALL (992px and below)
   ============================================ */

@media (max-width: 992px) {
    /* Product Detail */
    .product-detail-container {
        flex-direction: column;
        gap: 40px;
    }
    
    .product-images,
    .product-info {
        min-width: 100%;
        max-width: 100%;
    }
    
    .product-images .main-image img {
        height: 450px;
    }
}

/* ============================================
   TABLET (768px and below)
   ============================================ */

@media (max-width: 768px) {
    /* Typography */
    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .section-title {
        font-size: 28px;
    }

    /* Header */
    .top-bar {
        display: none; /* Hide top bar on mobile to save space */
    }

    .top-bar-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }

    .header-search {
        order: 3;
        width: 100%;
        max-width: 100%;
    }

    .mobile-menu-toggle {
        display: block;
    }

    /* Keep header sticky on tablet */
    .main-header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    /* Keep logos and cart visible */
    .logo,
    .knc-logo,
    .header-actions {
        display: flex !important;
    }

    .knc-logo img {
        height: 45px;
    }

    /* Price formatting on tablet */
    .product-price,
    .price,
    .price-sale,
    .current-price,
    .sale-price {
        word-break: keep-all;
        white-space: nowrap;
        font-size: 1.2rem !important;
    }

    .summary-row span,
    .item-price {
        font-size: 1rem;
        white-space: nowrap;
    }

    /* Ensure prices stay on one line */
    .product-price,
    .cart-item-price,
    .summary-row {
        display: flex;
        flex-wrap: nowrap;
        gap: 5px;
    }


    /* Navigation */
    .main-nav {
        display: none;
    }
    
    /* Hero */
    .hero-section {
        height: auto;
        min-height: 600px;
    }
    
    .hero-slide {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        padding: 0 20px;
        gap: 20px;
    }
    
    .hero-content {
        padding: 40px 20px;
        align-items: center;
        text-align: center;
        height: auto;
        order: 1;
        max-width: 100%;
    }
    
    .hero-image {
        height: 500px;
        order: 2;
        padding: 0;
    }
    
    .hero-image img {
        height: 100%;
        object-fit: contain;
    }
    
    .hero-title {
        font-size: 38px;
    }
    
    .hero-subtitle {
        max-width: 100%;
    }
    
    .hero-badge {
        font-size: 13px;
        padding: 6px 16px;
    }
    
    .hero-nav {
        padding: 10px 15px;
        font-size: 18px;
    }
    
    .hero-prev {
        left: 10px;
    }
    
    .hero-next {
        right: 10px;
    }
    
    /* Grids */
    .categories-grid,
    .products-grid,
    .features-grid,
    .events-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    /* Product Detail */
    .product-detail-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .product-images,
    .product-info {
        min-width: 100%;
        max-width: 100%;
    }
    
    .product-images .main-image img {
        height: 400px;
    }
    
    .thumbnail-images {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .product-title {
        font-size: 1.5rem;
    }
    
    .product-price .sale-price,
    .product-price .current-price {
        font-size: 1.5rem;
    }
    
    /* Sections */
    section {
        padding: 50px 0;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* ============================================
   MOBILE (480px and below)
   ============================================ */

@media (max-width: 480px) {
    /* Typography */
    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .section-title {
        font-size: 24px;
    }

    /* Container */
    .container {
        padding: 0 15px;
    }

    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .btn-lg {
        padding: 12px 25px;
        font-size: 16px;
    }

    /* Header - Simplified for mobile */
    .main-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        padding: 10px 0;
        background: var(--white);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .header-content {
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        flex-shrink: 0;
    }

    .logo img {
        height: 40px;
    }

    /* Hide header cart on mobile - use floating cart instead */
    .header-actions {
        display: none !important;
    }

    /* Keep mobile menu toggle */
    .mobile-menu-toggle {
        display: flex !important;
        order: 3;
    }

    /* Show KNC logo on mobile */
    .knc-logo {
        display: flex !important;
        margin-left: auto;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .knc-logo img {
        height: 35px !important;
    }

    /* Better price formatting */
    .product-price,
    .price,
    .price-sale,
    .current-price,
    .sale-price,
    .item-price {
        font-size: 1.1rem !important;
        white-space: nowrap;
        display: inline-block;
    }

    /* Cart page price formatting */
    .cart-item-price,
    .cart-subtotal,
    .cart-total {
        font-size: 1rem !important;
        white-space: nowrap;
    }

    /* Order summary improvements */
    .summary-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .summary-row span {
        font-size: 0.95rem;
        white-space: nowrap;
    }

    .summary-total span {
        font-size: 1.1rem !important;
        font-weight: bold;
    }
    
    /* Hero */
    .hero-section {
        height: auto;
        min-height: 500px;
    }
    
    .hero-slide {
        padding: 0 15px;
    }
    
    .hero-content {
        padding: 30px 15px;
    }
    
    .hero-image {
        height: 400px;
        padding: 0;
    }
    
    .hero-image img {
        height: 100%;
        object-fit: contain;
    }
    
    .hero-badge {
        font-size: 12px;
        padding: 5px 14px;
    }
    
    /* Grids */
    .categories-grid,
    .products-grid,
    .features-grid,
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    /* Product Detail */
    .product-detail-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .product-images,
    .product-info {
        min-width: 100%;
        max-width: 100%;
    }
    
    .product-images .main-image img {
        height: 300px;
    }
    
    .thumbnail-images {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .thumbnail {
        height: 80px;
    }
    
    .product-title {
        font-size: 1.3rem;
    }
    
    .product-price .sale-price,
    .product-price .current-price {
        font-size: 1.3rem;
    }
    
    .product-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .product-share {
        flex-wrap: wrap;
    }
    
    /* Newsletter */
    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form button {
        width: 100%;
    }

    /* Hide shopping cart link in footer on mobile since we have floating cart */
    .hide-mobile {
        display: none !important;
    }

    /* Floating buttons adjustments for mobile */
    .scroll-to-top {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-float {
        width: 55px;
        height: 55px;
        bottom: 90px;
        right: 20px;
        font-size: 28px;
    }

    .floating-cart {
        width: 55px;
        height: 55px;
        bottom: 155px;
        right: 20px;
        font-size: 24px;
    }

    /* Adjust cart position on mobile when WhatsApp is not present */
    .floating-cart.no-whatsapp {
        bottom: 85px;
    }

    .floating-cart-count {
        width: 20px;
        height: 20px;
        font-size: 11px;
        top: 3px;
        right: 3px;
    }
}