/* Card wrapper */
.product-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-width: 290px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}

/* Remove old price-on-image badge */
.product-price-wrapper {
    display: none;
}

/* Content area */
.product-info {
    padding: 14px 16px 16px;
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Title */
.product-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    margin: 0 0 3px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.product-title a {
    text-decoration: none !important;
    color: inherit;
}

/* Categories under title – now with background chips */
.product-categories {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 2px;

    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-categories a {
    text-decoration: none;
    color: #4f46e5;          /* primary color */
    background: #eef2ff;     /* light background */
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.4;
}

.product-categories a:hover {
    background: #e0e7ff;
}

/* Bottom row: left = price + rating, right = buttons */
.product-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 6px;
    flex-wrap: nowrap;   /* lets it wrap on very small screens but keeps row layout */
}

.product-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Price (handles regular + sale) */
.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.product-price del {
    font-size: 13px;
    margin-right: 4px;
    color: #9ca3af;
}

.product-price ins {
    font-size: 16px;
    color: #4f46e5;
    text-decoration: none;
}

/* Rating line */
.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #f59e0b; /* star color */
}

.product-rating .star-rating {
    margin: 0;
}

.rating-count {
    color: #6b7280;
}

/* Right side: Buy button + preview icon */
.product-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Buy Now */
.buy-button {
    background-color: #4f46e5;
    color: #fff;
    padding: 9px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.buy-button:hover {
    background-color: #4338ca;
    transform: translateY(-1px);
}

/* Icon-only preview */
.preview-icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #4b5563;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.preview-icon:hover {
    background: #f3f4ff;
    border-color: #4f46e5;
    transform: translateY(-1px);
}

/* --------- MOBILE TWEAKS (same layout, just smaller) ---------- */
@media (max-width: 768px) {
    .product-card {
        max-width: 100%;
    }

    .product-title {
        font-size: 15px;
    }

    .buy-button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .product-info {
        padding: 12px 12px 14px;
    }

    .product-title {
        font-size: 14px;
        white-space: normal; /* let it wrap on very small phones */
    }

    .product-categories a {
        font-size: 10px;
        padding: 2px 7px;
    }

    .product-price {
        font-size: 14px;
    }

    .product-rating {
        font-size: 12px;
    }

    .preview-icon {
        width: 32px;
        height: 32px;
    }
}
