/* Variables */
:root {
    --primary: #ff592b;
    --primary-dark: #e44c1c;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --background: #f5f5f5;
    --white: #fff;
    --border: #ddd;
    --border-light: #eee;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --radius: 4px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 12px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    height: 36px;
}

.nav-brand h1 {
    font-family: 'Anton', sans-serif;
    color: var(--primary);
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary);
    color: white;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
}

.nav-toggle span {
    width: 24px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

/* Banner */
.banner {
    margin-top: 72px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.banner-content h1 {
    font-family: 'Anton', sans-serif;
    font-size: 3rem;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.banner-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Search Section (Amazon Style) */
/* IMPROVED Search Section - Long & Minimal on Desktop */
.search-section {
    background: var(--white);
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Long & Minimal Search Bar for Desktop */
.search-bar {
    display: flex;
    width: 70%; /* Much longer on desktop */
    max-width: 800px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 6px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e8e8e8;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 1rem;
    outline: none;
    background: #fafafa;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 89, 43, 0.1);
}

.search-bar input::placeholder {
    color: #999;
    font-weight: 400;
}

.search-btn {
    padding: 14px 20px;
    background: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 0 6px 6px 0;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    min-width: 60px;
    justify-content: center;
}

.search-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.results-info {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap;
}

/* MOBILE MENU APPROACH - Like Desktop but with Toggle */
.mobile-filters-toggle {
    display: none;
    background: var(--white);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.filters-menu-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 89, 43, 0.3);
}

.filters-menu-btn:hover {
    background: var(--primary-dark);
}

.filters-menu-btn .icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.filters-menu-btn.active .icon {
    transform: rotate(180deg);
}

/* Make sidebar work on mobile with menu */
.filters-sidebar.mobile-hidden {
    display: none;
}

.filters-sidebar.mobile-shown {
    display: block;
    position: static;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MOBILE RESPONSIVE IMPROVEMENTS */
@media (max-width: 768px) {
    /* Navigation */
    .nav-links {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Banner */
    .banner-content h1 {
        font-size: 2.2rem;
    }

    .banner-content p {
        font-size: 1rem;
    }

    /* Search - Stack vertically on mobile */
    .search-container {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .search-bar {
        width: 100%;
        max-width: none;
    }

    .search-bar input {
        padding: 12px 16px;
        font-size: 1rem;
    }

    .search-btn {
        padding: 12px 16px;
    }

    .results-info {
        text-align: center;
        font-size: 0.9rem;
    }

    /* Show mobile filters toggle */
    .mobile-filters-toggle {
        display: block;
    }

    /* Main content - stack vertically */
    .main-content {
        flex-direction: column;
        padding: 16px;
        gap: 0;
    }

    /* Hide sidebar by default on mobile */
    .filters-sidebar {
        display: none; /* Hidden by default */
        width: 100%;
        position: static;
        margin-bottom: 20px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    }

    /* Products grid - better mobile layout */
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
    }

    .product-card {
        max-width: none;
    }

    .product-image {
        height: 200px;
    }

    .product-info {
        padding: 12px;
    }

    .product-name {
        font-size: 1rem;
        line-height: 1.3;
    }

    .product-price {
        font-size: 1.2rem;
    }

    .view-product-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    /* Modal improvements */
    .modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 12px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .search-section {
        padding: 12px 0;
    }

    .search-container {
        padding: 0 16px;
    }

    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .product-image {
        height: 180px;
    }

    .mobile-filters-toggle {
        padding: 12px 16px;
    }
}


.results-info {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Main Content (Amazon Layout) */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 20px;
}

/* Left Sidebar Filters (Amazon Style) */
.filters-sidebar {
    width: 250px;
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.filters-sidebar h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.filter-section {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-section h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.filter-section select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 0.9rem;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 0;
}

.filter-checkbox:hover {
    color: var(--primary);
}

.filter-checkbox input {
    accent-color: var(--primary);
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    text-align: center;
}

.clear-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.2s;
}

.clear-btn:hover {
    background: var(--primary-dark);
}

/* Products Area */
.products-area {
    flex: 1;
}

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.active-filter {
    background: #e3f2fd;
    color: #1976d2;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.active-filter .remove {
    cursor: pointer;
    font-weight: bold;
}

/* Loading */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text);
}

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

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    cursor: pointer;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

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

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.product-info {
    padding: 16px;
}

.product-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.view-product-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.view-product-btn:hover {
    background: var(--primary-dark);
}

/* Load More */
.load-more-container {
    text-align: center;
    margin-top: 40px;
}

.load-more-btn {
    padding: 12px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
}

.load-more-btn:hover {
    background: var(--primary-dark);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.modal-image img {
    width: 100%;
    border-radius: var(--radius);
}

.modal-details h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 16px;
}

.modal-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.modal-description {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 24px;
}

.size-selector {
    margin-bottom: 24px;
}

.size-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.size-selector select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--border-light);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    z-index: 3000;
    transform: translateX(400px);
    transition: transform 0.3s;
}


.notification.show {
    transform: translateX(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .banner-content h1 {
        font-size: 2rem;
    }

    .search-container {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .search-bar {
        width: 100%;
    }

    .main-content {
        flex-direction: column;
        padding: 16px;
    }

    .filters-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}
