/* --- Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* --- CSS Variables (Marketplace Theme) --- */
:root {
    --bg-white: #FFFFFF;
    --bg-light-gray: #FFFFFF;
    --font-promo-red: #d9534f;
    --text-dark: #333333;
    --text-light: #777777;
    --border-color: #E0E0E0;
    --font-main: 'Roboto', sans-serif;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --border-radius: 8px;
}

/* --- Global Reset & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: var(--font-main);
    background-color: var(--bg-light-gray);
    color: var(--text-dark);
    line-height: 1.5;
}
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
.header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo a {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
}
.logo .highlight {
    color: var(--font-promo-red);
}
.search-container {
    position: relative;
    width: 40%;
    display: flex;
}
#searchInput {
    width: 100%; padding: 12px 20px; border-radius: var(--border-radius); border: 1px solid var(--border-color);
    background-color: #FFF; font-size: 16px; outline: none;
}
#searchButton {
    padding: 0 18px; border: 1px solid var(--border-color); border-left: none; background-color: #f8f8f8;
    color: var(--text-dark); cursor: pointer; border-radius: 0 var(--border-radius) var(--border-radius) 0;
}
.main-nav {
    display: flex; gap: 20px;
}
.nav-icon {
    font-size: 24px; color: var(--text-light); text-decoration: none;
}

/* Remove Hero Section for a direct grid look */
#hero {
    display: none;
}

/* --- Products Section --- */
#products {
    padding: 30px 0;
}
.section-title {
    font-size: 24px; font-weight: 600; text-align: left; margin-bottom: 20px;
}
/* Find and replace these rules in your styles.css */

/* Makes grid denser to fit 6 columns */
#product-listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 15px; /* Reduced gap */
    justify-content: center;
}
.product-card {
    background-color: var(--bg-white);
    border-radius: 0; /* Changed for sharp corners */
    overflow: hidden;
    text-decoration: none;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    /*box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);*/
    transition: box-shadow 0.3s, transform 0.3s;
}
.product-card:hover {
    /* Make the shadow stronger and lift the card on hover */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}
.product-card .product-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.product-card h3 {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: auto;
    color: var(--text-dark);
    line-height: 1.3;
    height: 34px; /* Adjust height for 2 lines */
    overflow: hidden;
}

/* --- Sales Detail Styles --- */
.product-image-container {
    position: relative;
}
.product-image {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}
.cart-icon-overlay {
    position: absolute; bottom: 8px; right: 8px; width: 32px; height: 32px; background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color); border-radius: 50%; display: none; /* Hidden by default */
    justify-content: center; align-items: center; color: var(--text-dark); cursor: pointer; transition: all 0.2s;
}
.product-card:hover .cart-icon-overlay {
    display: flex; /* Show on hover */
}
.cart-icon-overlay:hover {
    background-color: var(--bg-white); transform: scale(1.1);
}
/* Reduces the space above the price */
.price-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px; /* Changed from 8px */
}
.price {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}
.original-price {
    font-size: 12px;
    color: var(--text-light);
    text-decoration: line-through;
}
.extra-promo {
    color: var(--font-promo-red);
    font-size: 18px;
    font-weight: bold; /* Changed from 500 */
}
.meta-info {
    display: flex; justify-content: space-between; align-items: center; margin-top: 8px;
    font-size: 12px; color: var(--text-light);
}

/* --- Footer & Search Suggestions... --- */
.footer {
    background-color: var(--bg-white); border-top: 1px solid var(--border-color);
    padding: 30px 0; text-align: center; color: var(--text-light);
}
.search-suggestions {
    position: absolute; top: 100%; left: 0; right: 0; background-color: var(--bg-white);
    border: 1px solid var(--border-color); z-index: 999; display: none; box-shadow: 0 4px 8px var(--shadow-color);
}
.suggestion, .no-results {
    padding: 12px 20px; cursor: pointer;
}
.suggestion:hover {
    background-color: var(--bg-light-gray);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .header .container { flex-direction: column; gap: 15px; }
    .search-container { width: 100%; }
    #product-listings { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-card h3 { font-size: 13px; }
    .price { font-size: 16px; }
}
/* ADD THESE NEW STYLES TO THE BOTTOM OF YOUR CSS FILE */

/* Replace old .promo-line and .extra-promo with these */
.promo-line {
    display: flex;
    align-items: center;
    gap: 8px; /* Adds space between items */
    margin-top: 6px;
    height: 22px; /* Give it a fixed height */
}

.promo-line .sale-badge {
    background-color: var(--font-promo-red);
    color: white;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

.extra-promo {
    color: var(--font-promo-red);
    font-size: 11px;
    font-weight: bold; /* This will now apply correctly */
}
/* ADD THESE NEW STYLES TO THE BOTTOM OF YOUR CSS FILE */

/* Reduces the space below the stars */
.rating-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    /* margin-bottom: 6px; <-- This line is removed */
    height: 18px;
    font-size: 12px;
    color: var(--text-dark);
}

.star-rating {
    display: flex;
    align-items: center;
}

.star-rating .fa-star {
    font-size: 12px;
    color: #d8d8d8; /* Color for empty stars */
}

.star-rating .fa-star.filled {
    color: var(--text-dark); /* Changed from yellow to black */
}

.units-sold {
    font-size: 12px;
    color: var(--text-light);
}

/* Update promo-line to better fit shipping text */
.promo-line {
   display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    height: 20px;
}

/* Remove margin from meta-info as it is no longer used for this */
/* Update the meta-info style */
.meta-info {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-dark); /* Changed from --text-light */
}
