/* Modern Product Grid Configuration */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem; /* Better gap for small screens */
    padding: 0.75rem;
    margin: 0;
    width: 100%;
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        padding: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* Premium Product Card */
.product-card {
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid #f1f5f9;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    height: 100%;
}

@media (min-width: 768px) {
    .product-card {
        border-radius: 1.5rem;
    }

    .product-card:hover {
        transform: translateY(-0.5rem);
        box-shadow: 0 20px 25px -5px rgba(22, 163, 74, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
        border-color: rgba(22, 163, 74, 0.2);
    }
}

.product-card-link {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-decoration: none;
    color: inherit;
}

/* Image Presentation */
.product-img-wrapper {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

@media (min-width: 768px) {
    .product-img-wrapper {
        aspect-ratio: 4 / 3;
    }
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-img.hover-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0;
    pointer-events: none;
}

.product-card:hover .product-img.main-img {
    opacity: 0;
    transform: scale(0.9);
}

.product-card:hover .product-img.hover-img {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Badges */
.product-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    border-radius: 0.75rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.badge-outlet { background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%); }
.badge-secondhand { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.badge-new { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.badge-discount { 
    background: linear-gradient(135deg, var(--accent) 0%, #ca8a04 100%);
    color: #0f172a; /* Dark text for yellow badge */
}

/* Favorite Button */
.fav-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 20;
    width: 2.25rem;
    height: 2.25rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.fav-btn:hover {
    transform: scale(1.1);
    background: #fff;
    color: #ef4444;
}

.fav-btn.active {
    color: #ef4444;
    background: #fff;
}

/* Product Content */
.product-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

@media (min-width: 768px) {
    .product-info {
        padding: 1.25rem;
        gap: 0.75rem;
    }
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars-row {
    display: flex;
    gap: 1px;
}

.review-count {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
}

.product-name {
    font-size: 0.85rem; /* ~13.6px on mobile */
    font-weight: 600;
    line-height: 1.4;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
    margin: 0;
    transition: color 0.2s;
}

.product-card:hover .product-name {
    color: var(--primary);
}

@media (min-width: 768px) {
    .product-name {
        font-size: 1.05rem;
        font-weight: 700;
    }
}

.product-price-section {
    margin-top: auto;
    padding-top: 0.75rem;
    width: 100%;
}

.old-price {
    font-size: 0.8rem;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
}

.price-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.current-price {
    font-size: 1.15rem; /* ~18.4px on mobile */
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.tax-hint {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .current-price {
        font-size: 1.6rem;
    }
}

/* Add to Cart Area */
.product-actions {
    padding: 0 0.75rem 0.75rem 0.75rem;
}

@media (min-width: 768px) {
    .product-actions {
        padding: 0 1.25rem 1.25rem 1.25rem;
    }
}

.btn-add-cart {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #1e293b;
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-weight: 800;
    font-size: 0.85rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.btn-add-cart:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(22, 163, 74, 0.3);
}

.btn-add-cart:active {
    transform: translateY(0);
}

.btn-out-of-stock {
    width: 100%;
    background: #f1f5f9;
    color: #94a3b8;
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-weight: 800;
    font-size: 0.85rem;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}