/* ============================================= */
/* SIMPLE PRODUCT CARD - MOBILE 2 KOLOM          */
/* GAMBAR PERSEGI 1:1 (600x600)                  */
/* ============================================= */

/* ===== GRID CONTAINER ===== */
.simple-products-grid-img {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 13px;
    margin: 10px 0;
    align-items: stretch;
    width: 100%;
}

/* ===== CARD CONTAINER ===== */
.simple-product-card-img {
    background: white;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.simple-product-card-img:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #2d3194;
}

/* ===== BADGE ===== */
.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #c71b35, #ff3838);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 8px rgba(199, 27, 53, 0.3);
    z-index: 10;
}

/* ===== IMAGE SECTION - PERSEGI 1:1 ===== */
.card-image {
    width: 100%;
    aspect-ratio: 1 / 1; /* Membuat container persegi */
    overflow: hidden;
    background: #f8fafc;
    margin-bottom: 15px;
    position: relative;
}

.card-image a {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.card-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Gambar utuh di dalam kotak */
    padding: 25px; /* Padding lebih untuk gambar produk */
    transition: transform 0.4s ease;
    background: white;
}

.simple-product-card-img:hover .card-main-img {
    transform: scale(1.05);
}

/* Image sizes untuk persegi */
.card-main-img.small {
    padding: 11px; /* Lebih banyak padding untuk gambar kecil */
}

.card-main-img.medium {
    padding: 11px;
}

.card-main-img.large {
    padding: 11px;
}

/* ===== CONTENT SECTION ===== */
.card-content {
    padding: 0 20px 15px;
    flex: none;
    display: flex;
    flex-direction: column;
}

/* Title - FIXED HEIGHT */
.card-title {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1.4;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Subtitle - PROPER SPACING */
.card-subtitle {
    font-size: 13px;
    color: #555;
    margin: 0 0 5px 0;
    font-weight: 500;
    line-height: 1.3;
}

/* Specs - PROPER SPACING */
.card-specs {
    font-size: 12px;
    color: #777;
    margin: 0 0 12px 0;
    padding-bottom: 12px;
    border-bottom: 1px dashed #eee;
    line-height: 1.4;
}

/* ===== PRICE - FROM WOOCOMMERCE ===== */
.card-price {
    font-size: 18px;
    font-weight: 800;
    color: #2d3194;
    margin: 5px 0 15px 0;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-price del {
    font-size: 15px;
    color: #999;
    font-weight: normal;
    margin-right: 8px;
}

.card-price ins {
    text-decoration: none;
    color: #e74c3c;
}

/* ===== BUTTON ===== */
.card-button {
    display: block;
    background: #2d3194;
    color: white;
    padding: 14px 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    margin-top: auto;
}

.card-button:hover {
    background: #1a1d6e;
    color: white;
}

/* ===== RESPONSIVE DESIGN ===== */
/* Tablet (768px - 1024px) - 2 atau 3 kolom */
@media (max-width: 1024px) {
    .simple-products-grid-img {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

/* TABLET (2 KOLOM) */
@media (max-width: 900px) {
    .simple-products-grid-img {
        grid-template-columns: repeat(2, 1fr); /* 2 kolom pasti */
        gap: 15px;
    }
}

/* MOBILE (768px) - 2 KOLOM */
@media (max-width: 768px) {
    .simple-products-grid-img {
        grid-template-columns: repeat(2, 1fr); /* 2 kolom */
        gap: 12px;
        margin: 20px 0;
    }
    
    .simple-product-card-img {
        padding-bottom: 10px;
    }
    
    /* Gambar tetap persegi di mobile */
    .card-image {
        aspect-ratio: 1 / 1; /* Tetap persegi */
        margin-bottom: 10px;
    }
    
    .card-main-img {
        padding: 20px; /* Kurangi padding di mobile */
    }
    
    .card-title {
        font-size: 14px;
        min-height: 40px;
        margin: 0 0 6px 0;
    }
    
    .card-subtitle {
        font-size: 12px;
        margin: 0 0 4px 0;
    }
    
    .card-specs {
        font-size: 11px;
        margin: 0 0 10px 0;
        padding-bottom: 10px;
    }
    
    .card-price {
        font-size: 16px;
        margin: 5px 0 12px 0;
    }
    
    .card-content {
        padding: 0 8px 8px;
    }
    
    .card-button {
        padding: 12px 15px;
        font-size: 13px;
        margin: 0 12px 12px;
    }
    
    .product-badge {
        font-size: 10px;
        padding: 4px 10px;
        top: 8px;
        left: 8px;
    }
}

/* MOBILE KECIL (480px) - TETAP 2 KOLOM */
@media (max-width: 480px) {
    .simple-products-grid-img {
        grid-template-columns: repeat(2, 1fr); /* Tetap 2 kolom */
        gap: 10px;
    }
    
    .simple-product-card-img {
        border-radius: 10px;
    }
    
    .card-image {
        aspect-ratio: 1 / 1; /* Tetap persegi */
    }
    
    .card-main-img {
        padding: 15px; /* Lebih sedikit padding di mobile kecil */
    }
    
    .card-title {
        font-size: 13px;
        min-height: 36px;
        line-height: 1.3;
    }
    
    .card-subtitle {
        font-size: 11px;
    }
    
    .card-specs {
        font-size: 10px;
        margin: 0 0 8px 0;
        padding-bottom: 8px;
    }
    
    .card-price {
        font-size: 15px;
        margin: 4px 0 10px 0;
    }
    
    .card-button {
        padding: 10px 12px;
        font-size: 12px;
        margin: 0 10px 10px;
    }
}

/* MOBILE SANGAT KECIL (360px) */
@media (max-width: 360px) {
    .simple-products-grid-img {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .card-image {
        aspect-ratio: 1 / 1; /* Tetap persegi */
    }
    
    .card-main-img {
        padding: 12px;
    }
    
    .card-title {
        font-size: 12px;
        min-height: 34px;
    }
    
    .card-button {
        padding: 8px 10px;
        font-size: 11px;
        margin: 0 8px 8px;
    }
}

/* Fallback untuk browser yang tidak support aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
    .card-image {
        height: 0;
        padding-bottom: 100%; /* Membuat persegi dengan padding trick */
        position: relative;
    }
    
    .card-image a {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .card-main-img {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 80%;
        max-height: 80%;
    }
}

/* ===== LOADING STATE ===== */
.card-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.simple-product-card-img .card-subtitle {
    margin-bottom: 4px !important;
}

.simple-product-card-img .card-specs {
    margin-bottom: 8px !important;
}

/* Untuk memastikan tinggi seragam di mobile */
@media (max-width: 768px) {
    .simple-product-card-img {
     height: auto; /* ← BARIS INI */
     min-height: unset; /* ← BARIS INI */
    }
}