/* --- Storefront Product Grid --- */

.grid-container {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    padding: 2rem 0;
}

@media (min-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .grid-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* --- Product Card Styling --- */

.product-card {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Keeps image corners rounded */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative; /* For the badge */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

/* Image Area */
.image-container {
    width: 100%;
    height: 200px; /* Fixed height for uniformity */
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills box without distortion */
}

/* Badges */
.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 10;
}

.badge.sold {
    background-color: #ef4444; /* red 500 */
    color: white;
}

.badge.coming-soon {
    background-color: #f59e0b; /* amber 500 */
    color: white;
}

.badge.deal {
    background-color: #0b91f5; /* blue */
    color: white;
}

/* Content Area */
.product-details {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.product-specs {
    font-size: 0.875rem;
    color: #0369a1; /* Sky blue to highlight specs */
    font-weight: 600;
    margin-bottom: 1rem;
}

.price-block {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.original-price {
    font-size: 1rem;
    color: #f00b0b;
    text-decoration: line-through;
}

.product-desc {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1; /* Pushes the buttons to the bottom */
}

/* Actions Area */
.product-actions {
    display: grid;
    grid-template-columns: 1fr auto; /* Left side takes space, Right side fits content */
    gap: 1rem;
    align-items: center;
    margin-top: auto;
    width: 100%;
}

.buy-btn {
    /* Forces this button to be on the left */
    justify-self: start; 
    width: auto;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

.secondary-btns {
    display: flex;
    flex-direction: column; /* Stacks buttons vertically */
    gap: 0.5rem; /* Space between stacked buttons */
    align-items: flex-start; /* Aligns them to the right */
    justify-content: center;
}

.icon-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #6b7280;
    font-size: 0.85rem;
    transition: color 0.2s;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.icon-link:hover {
    color: #0369a1;
}

.small-icon {
    width: 18px !important; /* Force the width */
    height: 18px !important; /* Force the height */
    min-width: 18px; /* Prevent shrinking */
    max-width: 18px; /* Prevent growing */
    object-fit: contain; /* Keep aspect ratio inside the box */
    flex-shrink: 0; /* Stop flexbox from resizing it */
}