/* =========================================================
   [PRODUK.CSS] - Full Width, Animation & 4 Badges (Updated)
   ========================================================= */

.unit-grid {
    display: grid;
    width: 100%;
    box-sizing: border-box;
    gap: 10px;
    /* Gunakan minmax(0, 1fr) untuk mengunci lebar kolom agar tidak meluber */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
    margin: 0;
}

.unit-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Sangat penting: mencegah kartu memaksa grid melebar */
    min-width: 0;
    transition: all 0.3s ease;
}

.unit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- STYLE BADGE (4 KATEGORI) --- */
.unit-badges {
    position: absolute;
    bottom: 6px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    z-index: 5;
}

.badge {
    font-size: 0.5rem;
    font-weight: 800;
    color: #fff;
    padding: 2px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.badge-type {
    background-color: #007bff;
}
.badge-fuel {
    background-color: #000000;
}
.badge-seat {
    background-color: #008751;
}
.badge-trans {
    background-color: #000000;
}

/* --- INFO KONTEN --- */
.card-info {
    padding: 12px 10px;
    text-align: left;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Mencegah overflow teks dalam card */
    min-width: 0;
}

.card-info h3 {
    font-size: 0.8rem;
    color: #333;
    text-transform: uppercase;
    margin-bottom: 5px;
    line-height: 1.2;
    font-weight: 700;
    /* Kunci judul agar tidak mendorong lebar kartu */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price {
    font-size: 0.9rem;
    font-weight: 800;
    color: #1a1a1a;
    display: block;
    margin-bottom: 12px;
}

.card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

.btn-detail,
.btn-booking {
    flex: 1;
    text-decoration: none;
    font-size: 0.7rem;
    padding: 7px 2px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
}

.btn-detail {
    border: 1px solid #008751;
    color: #008751;
}
.btn-booking {
    background: #008751;
    color: #fff;
    border: 1px solid #008751;
}
.unit-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Sangat penting: mencegah kartu memaksa grid melebar */
    min-width: 0;
    transition: all 0.3s ease;
    /* Tambahan Optimasi: Memberitahu browser untuk bersiap melakukan transformasi rendering */
    will-change: transform, box-shadow; 
}

/* --- SETTING GRID TABLET & DESKTOP --- */

@media (min-width: 600px) and (max-width: 991px) {
    .unit-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (min-width: 992px) {
    .unit-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
    }
    .badge {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
}
