/* ============================================================
   HOME.CSS - Akila Florist Modular Grid (Final Version)
   ============================================================ */

/* --- Penyelamat Layout Grid --- */
.st-product-main-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px; 
    margin-top: 15px; /* Jarak atas ke grid produk */
}

/* Header Grid Umum (Kategori Standar) */
.st-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline; 
    margin-bottom: 20px; /* Jarak standar yang lebih proporsional */
    padding-bottom: 10px;
}

/* 1. JUDUL KATEGORI STANDAR */
.st-grid-header h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--primary-color);
    text-transform: capitalize;
    letter-spacing: 0.02em;
}

/* 2. JUDUL KHUSUS PROMOTION (TETAP SAMA JARAKNYA) */
.st-promo-header {
    border-bottom: none; 
    margin-bottom: 20px; /* Disamakan agar tidak terlalu jauh */
}

.st-promo-header h2.st-section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 800;
    text-transform: capitalize;
    letter-spacing: 0.03em;
    color: var(--primary-color);
    margin: 0;
}

/* Link View All */
.st-view-all {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

/* --- RESPONSIVITAS MOBILE --- */
@media (max-width: 576px) {
    .st-product-main-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .st-grid-header {
        margin-bottom: 15px; /* Lebih rapat lagi di mobile */
        padding-bottom: 8px;
    }

    .st-grid-header h2 {
        font-size: 0.95rem; 
    }

    .st-promo-header h2.st-section-title {
        font-size: 1.15rem;
    }
}

/* --- 5. LAYOUT: FEATURED (ANTI GEPENG FIX) --- */
.st-promo-container.st-layout-featured {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr); 
    grid-template-rows: repeat(2, 1fr);
    gap: 25px;
    /* Batasi tinggi grid agar tidak terlalu raksasa di desktop */
    height: 550px; 
}

/* Item Besar Pertama */
.st-promo-container.st-layout-featured .st-card-promo:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

/* KUNCI: Thumbnail di layout featured harus bersifat 'Cover' */
.st-promo-container.st-layout-featured .st-card-promo-thumb {
    height: 100% !important;
    aspect-ratio: auto !important;
    position: relative;
    overflow: hidden;
}

.st-promo-container.st-layout-featured .st-card-promo-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Ini yang paling penting agar tidak gepeng */
    object-fit: cover !important; 
    object-position: center;
}

/* Item kecil lainnya agar tetap rapi */
.st-promo-container.st-layout-featured .st-card-promo:not(:first-child) .st-card-promo-thumb {
    height: 100%;
}

@media (max-width: 992px) {
    .st-promo-container.st-layout-featured { 
        height: auto; /* Lepas batasan tinggi */
        grid-template-columns: repeat(2, 1fr); 
        grid-template-rows: auto;
    }
    
    /* Kembalikan gambar ke posisi normal, tidak absolut lagi */
    .st-promo-container.st-layout-featured .st-card-promo-thumb { 
        aspect-ratio: var(--card-aspect-ratio, 1/1) !important; 
    }
    
    .st-promo-container.st-layout-featured .st-card-promo-thumb img {
        position: static;
        height: auto;
    }
}