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

/* =====================================
   PRODUCT CARD - FIXED UNTUK SEMUA DEVICE
   ===================================== */

.product-card {
    width: 100%;
    height: 100%;
    min-width: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 17px rgba(15, 23, 42, 0.3);
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    color: #111827;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    transform: translateY(-2px);
}

/* =====================================
   CARD MEDIA
   ===================================== */

.card-media {
    position: relative;
    background: #f8fafc;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    flex-shrink: 0;
    min-width: 0;
}

.product-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.discount-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    background: #ff5860;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 8px;
    z-index: 10;
}

/* =====================================
   CARD BODY
   ===================================== */

.card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.current-price {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.original-price {
    font-size: 11px;
    color: #9ca3af;
    text-decoration: line-through;
}

.rating-sold-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.rating {
    color: #f59e0b;
    display: flex;
    gap: 2px;
    align-items: center;
}

.rating-value {
    color: #6b7280;
    margin-left: 2px;
}

.sold {
    color: #2cce2c;
    font-weight: 500;
}

.soldCount {
    color: #193c76;
    font-weight: 600;
}

.shop-row {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #6b21a8;
    font-size: 12px;
    font-weight: 600;
    margin-top: auto;
}

.shop-row i {
    background: #f3e8ff;
    padding: 6px;
    border-radius: 6px;
    font-size: 14px;
    flex-shrink: 0;
}

.shop-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* =====================================
   ✅ RESPONSIVE - UKURAN KONSISTEN SEMUA DEVICE
   ===================================== */

/* Desktop besar & standar (1200px+) */
@media (min-width: 1200px) {
    .card-body {
        padding: 14px;
        gap: 9px;
    }
    
    .product-name {
        font-size: 14.5px;
        min-height: 38px;
    }
    
    .current-price {
        font-size: 16px;
    }
    
    .original-price {
        font-size: 11.5px;
    }
    
    .rating-sold-row,
    .shop-row {
        font-size: 12.5px;
    }
    
    .discount-badge {
        font-size: 12px;
        padding: 6px 9px;
    }
}

/* Desktop kecil / Laptop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .card-body {
        padding: 13px;
        gap: 8px;
    }
    
    .product-name {
        font-size: 14px;
        min-height: 37px;
    }
    
    .current-price {
        font-size: 15.5px;
    }
    
    .original-price {
        font-size: 11px;
    }
    
    .rating-sold-row,
    .shop-row {
        font-size: 12px;
    }
    
    .discount-badge {
        font-size: 11.5px;
        padding: 6px 8px;
    }
}

/* Tablet landscape (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .card-body {
        padding: 12px;
        gap: 8px;
    }
    
    .product-name {
        font-size: 13.5px;
        min-height: 36px;
    }
    
    .current-price {
        font-size: 15px;
    }
    
    .original-price {
        font-size: 11px;
    }
    
    .rating-sold-row,
    .shop-row {
        font-size: 11.5px;
    }
    
    .shop-row i {
        padding: 5px;
        font-size: 13px;
    }
    
    .discount-badge {
        font-size: 11px;
        padding: 6px 8px;
    }
}

/* Tablet portrait (601px - 767px) */
@media (min-width: 601px) and (max-width: 767px) {
    .card-body {
        padding: 11px;
        gap: 7px;
    }
    
    .product-name {
        font-size: 13px;
        line-height: 1.25;
        min-height: 34px;
    }
    
    .current-price {
        font-size: 14.5px;
    }
    
    .original-price {
        font-size: 10.5px;
    }
    
    .rating-sold-row {
        font-size: 11px;
        gap: 5px;
    }
    
    .rating i {
        font-size: 10px;
    }
    
    .shop-row {
        font-size: 11px;
        gap: 6px;
    }
    
    .shop-row i {
        padding: 5px;
        font-size: 12px;
    }
    
    .discount-badge {
        font-size: 10.5px;
        padding: 5px 7px;
    }
}

/* ✅ Mobile - Disesuaikan untuk 2 kolom */
@media (max-width: 600px) {
    .product-card {
        border-radius: 10px;
    }
    
    .card-body {
        padding: 8px;
        gap: 5px;
    }
    
    .product-name {
        font-size: 11.5px;
        line-height: 1.2;
        min-height: 28px;
        -webkit-line-clamp: 2;
    }
    
    .current-price {
        font-size: 13px;
    }
    
    .original-price {
        font-size: 9px;
    }
    
    .rating-sold-row {
        font-size: 10px;
        gap: 4px;
    }
    
    .rating i {
        font-size: 9px;
    }
    
    .rating-value {
        font-size: 9px;
    }
    
    .shop-row {
        font-size: 10px;
        gap: 5px;
    }
    
    .shop-row i {
        padding: 4px;
        font-size: 11px;
    }
    
    .discount-badge {
        font-size: 10px;
        padding: 4px 6px;
        left: 6px;
        top: 6px;
    }
}

/* ✅ Mobile Kecil - Extra adjustment */
@media (max-width: 400px) {
    .card-body {
        padding: 7px;
        gap: 4px;
    }
    
    .product-name {
        font-size: 11px;
        min-height: 26px;
    }
    
    .current-price {
        font-size: 12px;
    }
    
    .original-price {
        font-size: 8.5px;
    }
    
    .rating-sold-row,
    .shop-row {
        font-size: 9.5px;
    }
    
    .rating i {
        font-size: 8.5px;
    }
    
    .discount-badge {
        font-size: 9px;
        padding: 3px 5px;
    }
}

/* ✅ Mobile Sangat Kecil */
@media (max-width: 360px) {
    .card-body {
        padding: 6px;
        gap: 3px;
    }
    
    .product-name {
        font-size: 10.5px;
        min-height: 25px;
    }
    
    .current-price {
        font-size: 11.5px;
    }
    
    .original-price {
        font-size: 8px;
    }
    
    .rating-sold-row,
    .shop-row {
        font-size: 9px;
    }
    
    .rating i {
        font-size: 8px;
    }
    
    .shop-row i {
        padding: 3px;
        font-size: 10px;
    }
    
    .discount-badge {
        font-size: 8.5px;
        padding: 3px 4px;
    }
}

/* =====================================
   SKELETON
   ===================================== */

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e6e9ee 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite;
}

.product-card:not(.loaded) .product-img {
    opacity: 0;
}

.product-card.loaded .product-img {
    opacity: 1;
}