/* Container for the product grid */
#productList {
    display: grid;
    /* Responsive grid: Adjust minmax(250px, ...) based on desired min card width */
    /* Starts with 1 column, then 2, then 3, then 4 as screen widens */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px 20px;
    /* Row gap, Column gap */
    padding: 20px 0;
    /* Add some padding around the grid */
    box-sizing: border-box;
    /* Include padding in width calculations */
}

/* Individual product card */
.product-card {
    text-align: left;
    /* Align text to the left as per image */
    background-color: #fff;
    /* Optional: if page background isn't white */
    position: relative;
    /* Needed for potential absolute elements inside */
    display: flex;
    /* Use flexbox for vertical layout */
    flex-direction: column;
    /* Stack elements vertically */
}

/* Image container */
.product-image-container {
    position: relative;
    /* For positioning wishlist icon and badge */
    overflow: hidden;
    /* Hide parts of image if using object-fit: cover */
    margin-bottom: 10px;
    /* Space below image */
    background-color: #f8f8f8;
    /* Light background for images */
}

.product-image-link {
    display: block;
    /* Make link fill the container */
    text-decoration: none;
}


.product-card img {
    display: block;
    /* Remove extra space below image */
    width: 100%;
    /* Make image fill container width */
    height: auto;
    /* Maintain aspect ratio */
    aspect-ratio: 3 / 4;
    /* Force a consistent aspect ratio (adjust as needed) */
    object-fit: contain;
    /* Fit image within bounds, preserving aspect ratio */
    /* Use 'cover' if you want image to fill, potentially cropping: */
    /* object-fit: cover; */
    transition: transform 0.3s ease;
    /* Smooth zoom effect on hover */
}

.product-card:hover img {
    transform: scale(1.05);
    /* Slight zoom on hover */
}


/* Wishlist button */
.wishlist-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.7);
    /* Semi-transparent background */
    border: none;
    border-radius: 50%;
    padding: 5px;
    cursor: pointer;
    width: 32px;
    /* Fixed size */
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.wishlist-button svg {
    width: 18px;
    /* Size of the heart icon */
    height: 18px;
    stroke: #333;
    /* Icon color */
    fill: none;
    /* Default: not filled */
}

.wishlist-button:hover {
    background: rgba(255, 255, 255, 0.9);
}

.wishlist-button:hover svg,
.wishlist-button.active svg {
    /* Style when active (filled heart) */
    fill: #e74c3c;
    /* Red fill color */
    stroke: #e74c3c;
    /* Red stroke color */
}


/* Product info container */
.product-info {
    padding: 0 5px;
    /* Small padding */
    flex-grow: 1;
    /* Allow info to take remaining space */
}

/* Product Brand */
.product-brand {
    display: block;
    /* Put it on its own line */
    font-size: 0.8em;
    color: #777;
    /* Grey color */
    margin-bottom: 2px;
    text-transform: uppercase;
    /* Optional: uppercase brand */
    letter-spacing: 0.5px;
    /* Optional: slight spacing */
}

/* Product Title */
.product-title {
    font-size: 0.95em;
    /* Adjust size as needed */
    font-weight: 500;
    /* Normal/medium weight */
    margin: 0 0 5px 0;
    /* Remove top margin, add bottom margin */
    line-height: 1.3;
}

.product-title a {
    text-decoration: none;
    color: #333;
    /* Dark text color */
    transition: color 0.2s ease;
}

.product-title a:hover {
    color: #007bff;
    /* Or your theme's link hover color */
}

/* Product Price container */
.product-price {
    font-size: 1em;
    /* Base size for price */
    margin-top: auto;
    /* Push price to bottom if card heights vary slightly */
    padding-top: 5px;
    /* Space above price */
}

.product-price .original-price {
    text-decoration: line-through;
    color: #999;
    /* Lighter grey for original price */
    font-size: 0.85em;
    /* Slightly smaller */
    margin-right: 8px;
}

.product-price .current-price {
    font-weight: bold;
    color: #333;
    /* Default price color */
}

.product-price .current-price.discounted {
    color: #e74c3c;
    /* Red color for discounted price */
}

/* --- Responsive Adjustments --- */

/* Example: Adjust grid columns for smaller screens */
@media (max-width: 768px) {
    #productList {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        /* Smaller cards on medium screens */
        gap: 20px 15px;
    }

    .product-title {
        font-size: 0.9em;
    }

    .product-price {
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    #productList {
        grid-template-columns: repeat(2, 1fr);
        /* Force 2 columns on small screens */
        gap: 15px 10px;
    }

    /* .product-card {
       
    } */

    .product-title {
        font-size: 0.85em;
    }
}

/* Style the main product card when it's sold out */
.product-card.sold-out {
    opacity: 0.6;
    /* Make the whole card slightly faded */
    /* filter: grayscale(80%); */
    /* Optional: Make it grayscale */
    /* cursor: not-allowed; */
    /* Optional: Change cursor */
}

/* Style the image container specifically if needed */
.product-card.sold-out .product-image-container {
    position: relative;
    /* Needed for absolute positioning of overlay */
}

/* Style the image itself when sold out */
.product-card.sold-out .product-image-container img {
    /* filter: grayscale(100%); */
    /* Example: Make only the image grayscale */
    opacity: 0.7;
}


/* Style for the SOLD OUT overlay text */
.sold-out-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    /* Semi-transparent black background */
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.2em;
    /* Adjust size as needed */
    text-align: center;
    z-index: 10;
    /* Ensure it's above the image */
    pointer-events: none;
    /* Prevent overlay from blocking clicks on elements below if needed */
}

/* Ensure disabled buttons look clearly disabled */
.product-card.sold-out button:disabled,
.product-card button:disabled {
    /* General disabled style */
    cursor: not-allowed;
    opacity: 0.5;
    background-color: #cccccc;
    /* Lighter grey background */
    border-color: #aaaaaa;
    color: #666666;
}

.product-card.sold-out .add-to-cart:disabled:hover
{
    /* Prevent hover effects on disabled buttons */
    background-color: #cccccc;
    border-color: #aaaaaa;
    color: #666666;
}


/* Style for the discount badge */
.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    /* Or right: 10px; */
    background-color: #dc3545;
    /* Red color for discount */
    color: white;
    padding: 3px 8px;
    font-size: 0.8em;
    font-weight: bold;
    border-radius: 3px;
    z-index: 5;
    /* Ensure it's above the image but potentially below overlay */
}

/* Style for original vs discounted price */
.product-price .original-price {
    text-decoration: line-through;
    color: grey;
    margin-right: 10px;
    font-size: 0.9em;
}

.product-price .discounted-price {
    color: #dc3545;
    /* Match discount badge color */
    font-weight: bold;
}

.product-card.sold-out .product-price .current-price,
.sold-out-price {
    color: #666666;
    /* Dim the price text color for sold out items */
}

/* Optional: Disable link visually and prevent click */
.product-image-link.disabled-link {
    cursor: default;
}

/* Add styles for your wishlist button active state */
.wishlist-button.active svg {
    fill: red;
    /* Example: fill heart red when active */
    stroke: red;
}

.wishlist-button svg {
    fill: none;
    /* Default state */
    stroke: currentColor;
    /* Use surrounding text color */
}

/* Adjust basic card layout */
.product-card {
    border: 1px solid #eee;
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 5px;
    display: flex;
    /* Example: use flexbox for layout */
    flex-direction: column;
    /* Stack image container and info */
}

.product-image-container {
    position: relative;
    /* Needed for absolute positioned badges/overlays */
    margin-bottom: 15px;
    text-align: center;
    /* Center image */
}

.product-image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    /* Prevents extra space below image */
    margin: 0 auto;
    /* Center if container is wider */
}

.product-info {
    text-align: center;
    /* Center text */
}

.product-info .product-brand {
    font-size: 0.85em;
    color: #777;
    margin-bottom: 5px;
    display: block;
}

.product-info .product-title {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.product-actions {
    margin-top: 15px;
}

.product-actions button {
    margin: 0 5px;
    padding: 8px 12px;
    cursor: pointer;
}