/* =========================================================
   WRAPPER — sama dengan Custom Button Product Card
========================================================= */

.custom-woo-loop-buttons,
.topsell-loop-buttons {
    display: flex !important;
    gap: 8px;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    margin-top: 10px;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Reset class .button WooCommerce/tema agar tidak bentrok */
.custom-woo-loop-buttons a,
.topsell-loop-buttons a {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    border: none !important;
    box-shadow: none !important;
    min-height: 40px !important;
    transition: background-color 0.3s ease !important;
}

/* =========================================================
   CART (simple product)
========================================================= */

.custom-cart-btn,
.topsell-cart-btn {
    background-color: #d92128 !important;
    color: #fff !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    min-width: 44px !important;
    width: auto !important;
    flex: 0 0 auto !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.custom-cart-btn:hover,
.topsell-cart-btn:hover {
    background-color: #b91c22 !important;
    color: #fff !important;
}

.custom-cart-btn svg,
.topsell-cart-btn svg {
    display: block;
    flex-shrink: 0;
}

/* =========================================================
   DETAIL — variable (satu tombol) & simple (dua tombol)
========================================================= */

.custom-detail-btn,
.topsell-detail-btn {
    background-color: #03445f !important;
    color: #fff !important;
    border-radius: 6px !important;
    padding: 8px 15px !important;
    flex: 1 1 auto !important;
    width: auto !important;
    text-align: center;
    font-size: 14px !important;
    font-weight: 600 !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
}

/* Variable: hanya Detail — lebar penuh, style sama */
.topsell-loop-buttons--detail-only .custom-detail-btn,
.topsell-loop-buttons--detail-only .topsell-detail-btn {
    flex: 1 1 100% !important;
    width: 100% !important;
}

.custom-detail-btn:hover,
.topsell-detail-btn:hover {
    background-color: #2b303b !important;
    color: #fff !important;
}

/* =========================================================
   MOBILE — tampilkan wrapper (Thrive / Elementor)
========================================================= */

@media (max-width: 768px) {

    .woocommerce ul.products li.product,
    .woocommerce-page ul.products li.product,
    body.tve ul.products li.product,
    body.archive ul.products li.product,
    body.search ul.products li.product {
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        padding-bottom: 16px !important;
    }

    .woocommerce ul.products li.product .thrv_wrapper,
    .woocommerce ul.products li.product .tcb-flex-row,
    .woocommerce ul.products li.product .tcb-flex-col {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    .custom-woo-loop-buttons,
    .topsell-loop-buttons {
        position: relative !important;
        z-index: 2 !important;
        margin-top: 12px !important;
    }
}

/* Sembunyikan tombol WooCommerce bawaan (bukan milik plugin) */
.woocommerce ul.products li.product .add_to_cart_button:not(.custom-cart-btn):not(.topsell-cart-btn),
.woocommerce ul.products li.product a.button.product_type_simple:not(.custom-cart-btn),
.woocommerce ul.products li.product a.button.product_type_variable:not(.custom-detail-btn) {
    display: none !important;
}
