/* WooCommerce Single Product Layout */

.product {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.product .images {
    flex: 0 0 45%;
    min-width: 300px;
}

.product .summary {
    flex: 0 0 50%;
    min-width: 300px;
}

.woocommerce-product-gallery {
    margin-bottom: 0;
}

.woocommerce-product-gallery__image {
    margin-bottom: 10px;
}

.woocommerce-product-gallery__trigger {
    display: none;
}

/* Product Title */
.product .product_title {
    font-size: 28px;
    margin-bottom: 15px;
    color: #d71149;
}

/* Price */
.product .price {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

.product .price del {
    color: #999;
    text-decoration: line-through;
    margin-right: 10px;
}

.product .price ins {
    text-decoration: none;
    color: #d71149;
}

/* Add to Cart Button */
.product .single_add_to_cart_button {
    background: #d71149;
    color: white;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
}

.product .single_add_to_cart_button:hover {
    background: #ff8000;
}

/* Quantity */
.product .quantity {
    margin-bottom: 15px;
}

.product .qty {
    padding: 8px;
    width: 80px;
}

/* Product Meta */
.product .product_meta {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #f1f1f1;
}

.product .product_meta p {
    margin: 5px 0;
}

/* Tabs */
.woocommerce-tabs {
    margin-top: 40px;
    border-top: 1px solid #f1f1f1;
}

.woocommerce-tabs .nav-tabs {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    border-bottom: 2px solid #f1f1f1;
    display: flex;
    gap: 0;
}

.woocommerce-tabs .nav-tabs li {
    margin: 0;
    padding: 0;
}

.woocommerce-tabs .nav-tabs a {
    display: block;
    padding: 10px 20px;
    border: none;
    color: #666;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}

.woocommerce-tabs .nav-tabs a:hover,
.woocommerce-tabs .nav-tabs .active a {
    color: #d71149;
    border-bottom-color: #d71149;
}

.woocommerce-tabs .tab-content {
    padding: 20px 0;
}

/* Related Products */
.related.products {
    margin-top: 50px;
    border-top: 1px solid #f1f1f1;
    padding-top: 30px;
}

.related.products h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #d71149;
}

/* Responsive */
@media (max-width: 768px) {
    .product {
        flex-direction: column;
    }
    
    .product .images,
    .product .summary {
        flex: 0 0 100%;
    }
    
    .product .product_title {
        font-size: 20px;
    }
}

/* ========================================================
   RE-FORCE TATA LETAK VARIASI PRODUCT & WARNA HARGA
======================================================== */

/* 1. Paksa form variasi menggunakan metode tumpukan blok berjarak */
.product form.variations_form,
.product .variations_form {
    display: block !important;
    margin-bottom: 25px !important;
}

/* 2. Beri jarak renggang di bawah dropdown Pilihan (Select option) */
.product form.variations_form select,
.product .variations_form select,
.product .value select {
    margin-bottom: 25px !important; /* Paksa jarak antara dropdown dan kotak quantity */
    display: block !important;
}

/* 3. Beri jarak di bawah label teks "Pilihan" atau "Ukuran" jika ada */
.product .label, 
.product .variations label {
    margin-bottom: 8px !important;
    display: inline-block !important;
}

/* 4. Beri jarak renggang tegas antara kotak Quantity ke Tombol Add to Cart */
.product .quantity {
    margin-bottom: 50px !important; 
    display: block !important;
    clear: both !important;
}

/* 5. Target Alternatif untuk Mewarnai Harga Variasi Tunggal saat Terpilih */
/* Menembus semua kemungkinan class harga dinamis WooCommerce */
.product .single_variation .price,
.product .woocommerce-variation-price .price,
.product .single_variation .price span,
.product .woocommerce-variation-price .price ins span,
.product div.single-product-summary .single_variation span.amount {
    color: #d71149 !important; /* Paksa warna merah magenta Lapax */
    font-size: 24px !important;
    font-weight: bold !important;
    margin-bottom: 15px !important;
    display: inline-block !important;
}

/* ========================================================
   1. TATA LETAK UTAMA PRODUK (Menyelaraskan File PHP Terbaru)
======================================================== */
.contain.product > div[style*="display:flex"] {
    /* Menimpa inline style jika layar mengecil agar layout tidak pecah */
    display: flex !important;
    gap: 100px;
}

/* ========================================================
   2. RELATED PRODUCTS GRID LAYOUT
======================================================== */

/* Mengubah kontainer produk terkait menjadi Grid */
.related.products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* Menampilkan 4 kolom */
    gap: 20px !important; /* Jarak antar kartu produk */
    margin: 30px 0 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Mereset gaya bawaan WooCommerce pada item produk */
.related.products ul.products li.product {
    width: 100% !important; /* Memaksa kartu melebar mengikuti grid */
    margin: 0 !important; /* Menghapus margin bawaan WooCommerce */
    float: none !important; /* Menghapus float agar grid tidak berantakan */
    display: flex !important;
    flex-direction: column !important;
    text-align: center !important;
    background: #ffffff;
    border: 1px solid #f1f1f1;
    padding: 15px;
    box-sizing: border-box;
}

/* Merapikan gambar produk terkait */
.related.products ul.products li.product img {
    width: 100% !important;
    height: auto !important;
    margin-bottom: 15px !important;
    object-fit: cover;
}

/* Menyelaraskan teks judul produk terkait */
.related.products ul.products li.product h2.woocommerce-loop-product__title {
    font-size: 16px !important;
    margin-bottom: 10px !important;
    color: #333 !important;
    min-height: 40px; /* Menjaga tinggi judul agar tombol tetap sejajar */
}

/* Memaksa tombol 'Select options' / 'Add to cart' berada di dasar kartu */
.related.products ul.products li.product .button {
    margin-top: auto !important; 
    display: block !important;
    width: 100% !important;
    padding: 10px 0 !important;
    background: #d71149 !important; /* Mengikuti warna tema merah magenta */
    color: #fff !important;
    border-radius: 0 !important;
    text-align: center;
}

.related.products ul.products li.product .button:hover {
    background: #ff8000 !important; /* Efek hover oranye sesuai tombol utama */
}

/* ========================================================
   3. RESPONSIVE GRID & LAYOUT (Tablet & Mobile)
======================================================== */

@media (max-width: 992px) {
    /* Kolom utama produk: memperkecil jarak gap */
    .contain.product > div[style*="display:flex"] {
        gap: 40px !important;
    }
    /* Related Products: Turun jadi 3 kolom di tablet */
    .related.products ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    /* Kolom utama produk: Ubah flex menjadi vertikal di HP */
    .contain.product > div[style*="display:flex"] {
        flex-direction: column !important;
        gap: 30px !important;
    }
    .contain.product > div[style*="display:flex"] > div {
        min-width: 100% !important;
    }
    /* Related Products: Turun jadi 2 kolom di HP */
    .related.products ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

@media (max-width: 480px) {
    /* Related Products: Jadi 1 kolom penuh pada HP layar sangat kecil */
    .related.products ul.products {
        grid-template-columns: 1fr !important;
    }
}