/* 1. Global Variables & Reset */
:root {
    --primary-color: #3B82F6; /* Tech Blue */
    --primary-dark: #2563eb;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f3f4f6;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif; /* Make sure to import a font like Inter or Roboto */
}

body {
    background-color: #f9fafb;
    color: var(--text-dark);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 2. Header Styles */
.main-header {
    background: rgb(246, 246, 247);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
    position: relative;
    display: flex;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 50px 0 0 50px;
    outline: none;
}

.search-bar button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    font-size: 1.2rem;
}

.user-nav {
    display: flex;
    gap: 20px;
}

.nav-icon {
    font-size: 1.5rem;
    color: var(--text-dark);
    position: relative;
    transition: color 0.2s;
}

.nav-icon:hover { color: var(--primary-color); }

/* 3. Hero Section */
.hero {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    padding: 60px 0;
    margin-bottom: 30px;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-text { flex: 1; }

.tagline {
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin: 15px 0;
    color: #111827;
}

.hero p {
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.btn-shop-now {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.2s, background 0.2s;
}

.btn-shop-now:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.hero-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1));
}

/* 4. Category Navigation */
.category-nav {
    background: var(--white);
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 40px;
}

.category-list {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 15px 0;
    white-space: nowrap;
}

.category-list::-webkit-scrollbar { display: none; }

.cat-item {
    padding: 8px 20px;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 0.95rem;
    color: var(--text-dark);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.cat-item:hover, .cat-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 5. Filter & Sort Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.filter-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.dropdown select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: var(--text-dark);
    outline: none;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
}

/* 6. Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.product-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid #f3f4f6;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.badge {
    position: absolute;
    top: 15px;
    left: 0;
    background: #ef4444; /* Red for hot/sale */
    color: white;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 0 50px 50px 0;
    z-index: 1;
}

.product-tumb {
    padding: 30px;
    background: #f9fafb;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-tumb img {
    max-width: 100%;
    max-height: 100%;
}

.product-details {
    padding: 20px;
}

.product-cat {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 8px;
}

.product-details h4 a {
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-bottom-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 15px;
    margin-top: 10px;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-links a {
    display: inline-block;
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-left: 10px;
    transition: 0.3s;
}

.product-links a:hover {
    color: var(--primary-color);
}

/* 7. Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 60px;
}

.pagination a {
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    font-weight: 500;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination a.active, .pagination a:hover:not(.prev):not(.next) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.btn-view-options {
    /* Base Button Style */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    background: var(--primary-color); 
    color: var(--white);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--primary-color);
}

.btn-view-options:hover {
    /* Hover Effect */
    background: rgb(190, 190, 255); 
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(1, 63, 164, 0.3);
}

/* Ensure the price box and button are properly spaced */
.product-bottom-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 1px solid #f3f4f6;
}
/* Style for the 'X' Reset Icon */
.reset-search {
    position: absolute;
    right: 65px; /* Adjust based on your button size */
    top: 50%;
    transform: translateY(-50%); /* Vertically center exactly */
    font-size: 22px;
    color: #999;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.reset-search:hover {
    color: #dc3545;
}

.search-bar input {
    padding-right: 40px; /* Space for the icon */
}
/* --- RESPONSIVE HEADER & LAYOUT --- */
@media (max-width: 768px) {

    /* 1. Header Layout - "Amazon Style" */
    .header-wrapper {
        flex-wrap: wrap; /* Allows items to wrap to the next line */
        gap: 15px; /* Space between rows */
    }

    .logo {
        order: 1; /* Stays first */
        flex: 1; /* Takes up available space on the left */
    }

    .user-nav {
        order: 2; /* Moves to the right of the logo */
    }

    .search-bar {
        order: 3; /* Force to a new line */
        display: flex; /* UN-HIDE IT */
        width: 100%; /* Full screen width */
        max-width: 100%; /* Remove the 500px limit */
        margin: 0; /* Reset margins */
    }
    .search-bar button {
        font-size: 1rem;       /* Reduce from 1.2rem */
        padding: 10px 15px;    /* Optional: Reduce padding to make the button slimmer */
        width: auto;           /* Prevents button from stretching oddly */
    }
    .search-bar input {
        font-size: 0.9rem;
    }
    
    /* 2. Hero Section Adjustments */
    .hero-content {
        flex-direction: column-reverse; /* Text below image */
        text-align: center;
        gap: 30px;
    }

    .hero h1 { 
        font-size: 2rem; 
    }
    
    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center; /* Center the buttons */
    }

    /* 3. Category Nav (Horizontal Scroll) */
    .category-nav {
        padding: 0 10px; /* Prevent edge touching */
    }
    
    /* 4. Reset Icon Position Fix for Mobile */
    .reset-search {
        right: 15px; /* Adjust because button is smaller or removed */
    }
}