/* ===================================
   RESPONSIVE DESIGN - MOBILE FIRST
   =================================== */

/* Large Tablets & Small Desktops (max-width: 1200px) */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Tablet (Portrait to Landscape) */
@media (max-width: 1024px) {
    .hero {
        height: auto;
        aspect-ratio: 4/3;
        /* 4:3 or 16:10 */
        min-height: 500px;
    }

    .hero h2 {
        font-size: 3.5rem;
        /* Increased text size for tablet */
    }
}

/* Tablet Styles (max-width: 992px) */
@media (max-width: 992px) {
    .container {
        padding: 0 15px;
    }

    /* Banner */
    .banner-container {
        flex-direction: column;
        /* Stack vertically */
        text-align: center;
        gap: 30px;
        padding: 40px 0;
    }

    .banner-text {
        text-align: center;
        padding: 0 20px;
    }

    .banner-text h2 {
        font-size: 2.5rem;
        text-align: center;
        line-height: 1.2;
    }

    .banner-text p {
        margin: 0 auto 30px;
        /* Center align paragraph */
    }

    .banner-image img {
        width: 100%;
        margin: 0 auto;
    }

    /* Layout Grids */
    .shop-layout,
    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Product Detail */
    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .product-gallery {
        margin-bottom: 30px;
        max-width: 100%;
    }

    .product-info {
        padding: 20px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }

    /* Category & Feature Grids */
    /* Category Grid - Tablet: 2 Columns */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        /* Slightly larger gap for touch targets */
    }

    .category-card {
        height: 600px;
        /* Slightly shorter on tablet */
    }

    .why-choose-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Navigation adjustment */
    .navbar {
        padding: 15px 20px;
    }
}

/* Mobile Styles (max-width: 768px) */
@media (max-width: 768px) {

    /* Typography */
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    /* Navigation */
    .navbar {
        padding: 12px 15px;
    }

    .navbar nav {
        display: none;
    }

    /* Fix: Unhide .nav-icons container so hamburger can be seen */
    .navbar .nav-icons {
        display: flex;
        gap: 12px;
        align-items: center;
    }

    .header-search-form {
        display: none !important;
    }

    /* Optionally hide other icons if you truly want only the hamburger. 
       If you want Cart visible, remove the .cart-icon selector below. */
    .navbar .nav-icons .user-icon {
        display: none;
    }

    .navbar .nav-icons .cart-icon {
        display: flex;
        align-items: center;
        position: relative;
        color: #333;
        font-size: 1.4rem;
    }

    .navbar .hamburger-icon {
        display: block !important;
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 1000;
    }

    .navbar .logo h1 {
        font-size: 1.2rem !important;
        letter-spacing: 0.1em !important;
    }

    .navbar .nav-icons .cart-icon {
        font-size: 1.2rem;
    }

    .navbar .hamburger-icon {
        font-size: 1.2rem;
    }

    /* Mobile Menu - See style.css for .hamburger-menu styles */
    /* .mobile-menu removed as it was dead code */

    /* Hero Section - Base Styles */
    .hero {
        width: 100%;
        position: relative;
        padding: 20px;
        background-position: center center;
        background-size: cover;
        background-repeat: no-repeat;
        display: flex;
        flex-direction: column;
        align-items: center;
        color: white;
    }

    /* Mobile First (Default - 320px to 767px) */
    .hero {
        min-height: 100vh;
        padding-top: 25vh;
        justify-content: flex-start;
        background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5)), url('../images/original4.jpg');
    }

    .hero h2 {
        font-size: 2.5rem;
        line-height: 1.2;
        margin-bottom: 20px;
        text-align: center;
    }

    .hero p {
        margin-bottom: 30px;
        text-align: center;
        padding: 0 15px;
    }

    .hero .cta-button {
        padding: 12px 30px;
        font-size: 1rem;
    }

    /* Mobile - Simple Version */
    @media (max-width: 767px) {
        .hero {
            width: 100%;
            height: 100vh;
            aspect-ratio: unset;
            /* Resolve conflict with height */
            background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5)),
                url('../images/original4.jpg') center center / cover no-repeat;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            padding-top: 25vh;
            position: relative;
        }
    }

    /* Tablet (768px - 1023px) */
    @media (min-width: 768px) and (max-width: 1023px) {
        .hero {
            height: 60vh;
            min-height: 500px;
            aspect-ratio: 16/9;
            padding-top: 0;
            justify-content: center;
            background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5)), url('../images/original.jpg');
        }

        .hero h2 {
            font-size: 3rem;
        }

        .hero p {
            font-size: 1.1rem;
            margin-bottom: 35px;
        }

        .hero .cta-button {
            padding: 14px 40px;
            font-size: 1.1rem;
        }
    }

    /* Desktop (1024px - 1439px) */
    @media (min-width: 1024px) and (max-width: 1439px) {
        .hero {
            height: 70vh;
            min-height: 600px;
            aspect-ratio: 16/9;
            padding-top: 0;
            justify-content: center;
            background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5)), url('../images/heroimage3.jpg');
        }

        .hero h2 {
            font-size: 3.5rem;
            margin-bottom: 25px;
        }

        .hero p {
            font-size: 1.2rem;
            margin-bottom: 40px;
            max-width: 700px;
        }

        .hero .cta-button {
            padding: 16px 50px;
            font-size: 1.2rem;
        }
    }

    /* Large Desktop (1440px and up) */
    @media (min-width: 1440px) {
        .hero {
            height: 75vh;
            min-height: 700px;
            aspect-ratio: 16/9;
            padding-top: 0;
            justify-content: center;
            background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5)), url('../images/original.jpg');
        }

        .hero h2 {
            font-size: 4rem;
            margin-bottom: 25px;
        }

        .hero p {
            font-size: 1.2rem;
            margin-bottom: 40px;
            max-width: 700px;
        }

        .hero .cta-button {
            padding: 16px 50px;
            font-size: 1.2rem;
        }
    }

    /* Product Grid */
    /* Product Grid - Mobile: 2 Columns */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .product-info h3 {
        font-size: 0.9rem;
        /* Smaller text for dense grid */
    }

    .btn-add-to-cart {
        padding: 10px 0;
        font-size: 0.75rem;
    }

    .product-card {
        max-width: 100%;
    }

    /* Feature Grids */
    .why-choose-grid,
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Category Grid - Mobile: 1 Column */
    .category-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .category-card {
        height: 500px;
        /* Optimized height for mobile scrolling */
    }

    .category-content h3 {
        font-size: 1.8rem;
        /* Smaller text on mobile */
    }

    /* Show button always on mobile for better UX? Or keep hover style? 
       Zara often keeps it clean. Let's keep the interactions but make sure text is readable */
    .shop-now-btn {
        opacity: 1;
        /* Always visible on mobile */
        transform: translateY(0);
        padding: 10px 25px;
        margin-top: 10px;
    }

    .category-content {
        transform: translateY(0);
        /* Fixed position */
        bottom: 40px;
    }

    .choose-card,
    .stat-card,
    .category-card {
        padding: 25px;
        text-align: center;
    }

    /* Cart & Tables */
    .cart-container {
        padding: 20px 15px;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        font-size: 14px;
    }

    table thead {
        display: none;
    }

    table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
    }

    table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 10px 0;
        border: none;
        text-align: right;
    }

    table tbody td:before {
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
        flex: 1;
    }

    .cart-summary-box {
        margin-top: 30px;
        width: 100%;
    }

    /* Checkout */
    .checkout-grid {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }

    .checkout-main {
        padding: 20px 0 60px;
    }

    .checkout-section h2 {
        font-size: 1.1rem;
    }

    .checkout-summary-wrapper {
        position: static;
        width: 100%;
        margin-top: 20px;
    }

    .checkout-summary-card {
        padding: 20px;
        background: #fff;
        border: 1px solid #eee;
    }

    .radio-card {
        padding: 12px;
    }

    .method-name {
        font-size: 0.85rem;
    }

    .method-time {
        font-size: 0.75rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

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

    .newsletter-form input[type="email"] {
        width: 100%;
        margin-bottom: 0;
    }

    .newsletter-form button {
        width: 100%;
    }

    /* Auth Forms */
    .auth-container {
        margin: 30px auto;
        padding: 30px 20px;
        width: 95%;
    }

    .auth-box {
        padding: 30px 20px;
    }

    /* Buttons */
    .btn,
    .cta-button {
        padding: 12px 20px;
        font-size: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .btn-group {
        flex-direction: column;
        gap: 10px;
    }

    .btn-group .btn {
        width: 100%;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }

    .footer-col h2,
    .footer-col h4 {
        text-align: center;
        margin-bottom: 15px;
    }

    .footer-col ul {
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .social-icons {
        margin: 0;
        justify-content: center;
    }

    /* Sections */
    section {
        padding: 40px 15px;
    }

    .section-header {
        margin-bottom: 30px;
    }
}

/* Small Mobile Styles (max-width: 576px) */
@media (max-width: 576px) {

    /* Typography */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Hero */


    .hero h2 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    /* Banner */
    .banner-text h2 {
        font-size: 1.75rem;
    }

    .banner-text p {
        font-size: 0.95rem;
    }

    /* Cards */
    .choose-card,
    .stat-card {
        padding: 20px 15px;
    }

    .product-card {
        padding: 10px;
    }

    .product-image {
        height: 200px !important;
    }

    .product-detail-gallery img {
        height: 250px;
        object-fit: cover;
    }

    .product-thumbnails {
        gap: 8px;
    }

    .product-thumbnails img {
        width: 60px;
        height: 60px;
    }

    /* Spacing */
    section {
        padding: 30px 15px;
    }

    .container {
        padding: 0 10px;
    }

    /* Inputs */
    input,
    textarea,
    select {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 12px;
    }

    /* Modal adjustments */
    .modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 20px;
    }
}

/* Extra Small Mobile (max-width: 375px) */
@media (max-width: 375px) {
    .hero h2 {
        font-size: 1.5rem;
    }

    .banner-text h2 {
        font-size: 1.5rem;
    }

    .product-card img {
        height: 180px;
    }

    .btn,
    .cta-button {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* Landscape Mobile Fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: 100vh;
        min-height: auto;
    }

    .mobile-menu {
        padding-top: 60px;
    }
}

/* Print Styles */
@media print {

    .navbar,
    .footer,
    .cta-button,
    .hamburger-icon,
    .hamburger-menu {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: black;
        background: white;
    }
}

/* Contact Page Responsive */
@media (max-width: 992px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .contact-hero {
        padding: 50px 0;
    }

    .contact-hero h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .contact-form-section,
    .contact-info-section {
        padding: 30px 20px;
        text-align: center;
    }

    .contact-form-section h3,
    .contact-info-section h3 {
        font-size: 1.3rem;
        text-align: center;
    }

    .info-item {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-bottom: 35px;
    }

    .info-item i {
        margin: 0 auto;
    }

    .info-text h4 {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .info-text p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .contact-hero h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .contact-layout {
        gap: 20px;
    }
    
    .contact-hero {
        padding: 40px 0;
    }
}

/* Mobile Pagination */
@media (max-width: 576px) {
    .pagination {
        gap: 5px;
        margin-top: 30px;
        flex-wrap: wrap;
        /* allow wrapping if absolutely needed, though we aim to avoid it */
    }

    .pagination a,
    .pagination button {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
        padding: 0;
    }
}

/* =========================================
   STRICT MOBILE PRODUCT LAYOUT (User Request)
   ========================================= */

/* Small Tablet / Large Phone (480px - 767px): 2 Columns */
@media (min-width: 480px) and (max-width: 767px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
        padding: 16px;
    }
}

/* Mobile (Below 480px): 2 Columns */
@media (max-width: 479px) {
    .product-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important;
        /* Force 2 columns */
        gap: 12px;
        /* Reduced gap to fit two columns */
        padding: 12px;
        /* Reduced padding */
    }

    .product-card {
        max-width: 100%;
        margin: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        /* Lighter shadow */
        padding: 0;
        /* Important: Remove card padding if any */
        overflow: hidden;
        /* Ensure content stays in */
    }

    /* Force override of global info padding for mobile */
    .product-info {
        padding: 8px !important;
    }

    /* Large, High-Quality Images */
    .product-image-container {
        aspect-ratio: 1/1;
        width: 100%;
    }

    /* Readable Text - Adjusted for 2 Columns */
    .product-info h3 {
        font-size: 13px !important;
        font-weight: 500;
        margin-bottom: 4px;
        line-height: 1.3;
        height: 2.6em;
        /* Limit to 2 lines */
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .product-info .price {
        font-size: 14px !important;
        font-weight: 700;
        color: var(--primary-color);
        margin-bottom: 8px;
    }

    .btn-add-to-cart,
    .btn-buy-now {
        padding: 8px 0;
        font-size: 11px !important;
        letter-spacing: 0;
        white-space: nowrap;
        width: 100%;
    }

    /* Easy Touch Targets - Scaled down for 2 columns - UPDATED to 28px as requested */
    .quick-view-icon,
    .add-to-wishlist {
        width: 28px !important;
        height: 28px !important;
        font-size: 13px !important;
        line-height: 28px !important;
        /* Center icon vertically */
        opacity: 1 !important;

        transform: translateY(0) !important;
        right: 10px !important;
        top: 10px !important;
    }

    /* Badge Sizing */
    .product-badge {
        font-size: 0.65rem !important;
        /* Smaller text */
        padding: 2px 6px !important;
        /* Tighter padding */
        top: 8px !important;
        left: 8px !important;
        /* Move closer to edge */
        line-height: normal;
        z-index: 5;
    }

    /* Fix Image Cropping */
    .product-image-container img {
        object-fit: contain !important;
        /* Ensure minimal cutting */
        width: 100%;
        height: 100%;
        background-color: #f9f9f9;
        /* Fallback background for transparent or smaller images */
    }

    /* Additional Global Mobile Fixes */
    .container {
        padding: 0 15px;
    }

    /* Buttons Full Width on Mobile */
    .btn,
    .btn-primary,
    .btn-outline,
    .add-to-cart-btn,
    .place-order-btn,
    .btn-buy-now {
        width: 100% !important;
        margin-bottom: 10px !important;
        justify-content: center !important;
    }

    /* Breadcrumbs spacing */
    .breadcrumbs {
        padding: 10px 0;
        margin-bottom: 10px !important;
    }

    .breadcrumbs ul {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    /* Section Spacing */
    section {
        padding: 40px 0 !important;
    }

    h2 {
        font-size: 1.8rem !important;
        margin-bottom: 2rem !important;
    }

    /* Footer Bottom Align */
    .footer-bottom {
        flex-direction: column !important;
        text-align: center;
        gap: 15px;
        padding: 20px 0;
    }

    .social-icons {
        justify-content: center !important;
        width: 100% !important;
    }

    /* Form stacking */
    .form-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    /* Cart card padding */
    .cart-item-card {
        gap: 15px !important;
        padding: 15px 0 !important;
    }

    .cart-item-image img {
        width: 80px !important;
        height: 100px !important;
    }

    .item-info-top h3 {
        font-size: 0.95rem !important;
    }

    .item-price {
        font-size: 0.9rem !important;
    }
}