/**
 * Theme Name: Styler Child
 * Description: This is a child theme of Styler.
 * Author: <a href="http://ninetheme.com/about">Ninetheme</a>
 * Template: styler
 * Version: 1.6.3
 */

/* Checkout Page Modernization */
.woocommerce-checkout {
    background-color: #f8f9fa;
    /* padding-top: 40px; */
    padding-bottom: 40px;
}

.woocommerce-checkout #customer_details,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.woocommerce-checkout h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #333 !important;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.woocommerce-checkout .form-row {
    margin-bottom: 20px;
}

/* OVERRIDE TOTAL: Paksa semua tombol add to cart untuk selalu aktif secara visual */
button.single_add_to_cart_button,
.single_add_to_cart_button,
button[name="add-to-cart"],
.variations_button .button {
    opacity: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    background-color: #000 !important;
    color: #fff !important;
}

.woocommerce-checkout input.input-text,
.woocommerce-checkout select,
.woocommerce-checkout textarea {
    border-radius: 8px !important;
    border: 1px solid #ddd !important;
    padding: 12px 15px !important;
    transition: all 0.3s ease;
}

.woocommerce-checkout input.input-text:focus {
    border-color: #000 !important;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

#order_review {
    border: none;
}

.woocommerce-checkout-review-order-table {
    border: none !important;
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    border: none !important;
    padding: 15px 0 !important;
}

.woocommerce-checkout-review-order-table .order-total {
    border-top: 2px solid #eee !important;
    font-size: 1.2em;
}

/* Payment Box Styling */
#payment {
    background: #fdfdfd !important;
    border: 1px solid #eee !important;
    border-radius: 10px;
    padding: 10px;
}

#payment ul.payment_methods {
    border-bottom: 1px solid #eee !important;
}

#payment div.payment_box {
    background-color: #f5f5f5 !important;
    border-radius: 8px;
    padding: 20px !important;
}

#place_order {
    background-color: #000 !important;
    color: #fff !important;
    border-radius: 8px !important;
    padding: 15px 30px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    transition: all 0.2s ease;
    margin-top: 20px;
}

#place_order:hover {
    background-color: #333 !important;
}

/* Helper to hide fields */
.hidden {
    display: none !important;
}

/* Mobile Adjustments */
@media (max-width: 768px) {

    form.woocommerce-checkout,
    .woocommerce-checkout .row,
    .woocommerce-checkout form.checkout,
    .woocommerce-checkout-layout,
    .woocommerce-checkout #customer_details {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
    }

    .woocommerce-checkout #customer_details>.col,
    .woocommerce-checkout #customer_details>.col-1,
    .woocommerce-checkout #customer_details>.col-2,
    .woocommerce-checkout #order_review_heading,
    .woocommerce-checkout #order_review,
    .woocommerce-checkout .col-12,
    .woocommerce-checkout .col-md-6,
    .woocommerce-checkout .col-lg-6,
    .woocommerce-checkout .col-lg-7,
    .woocommerce-checkout .col-lg-5,
    .woocommerce-checkout .col2-set,
    .woocommerce-shipping-fields,
    .woocommerce-additional-fields,
    .styler-order-review {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding: 10px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        float: none !important;
    }

    body .woocommerce-checkout #customer_details>.col {
        margin-bottom: 20px;
        display: block !important;
    }

    body .woocommerce-checkout #customer_details>.col:last-child {
        display: block !important;
        grid-template-columns: 1fr !important;
        /* Fallback if grid is still somehow applied */
    }

    body .woocommerce-checkout #customer_details>.col:last-child>.styler-order-review {
        margin-top: 20px;
    }
}

/* Hide shipping calculator and shipping cost row on the Cart page */
.woocommerce-cart tr.shipping,
.woocommerce-cart .shipping-calculator-button,
.woocommerce-cart .shipping-calculator-form,
.woocommerce-cart .styler-checkout-footer-item.woocommerce-shipping-totals.shipping {
    display: none !important;
}

/* GTranslate Flags Mobile Offset */
@media (max-width: 768px) {

    .gtranslate_wrapper,
    #gtranslate_wrapper,
    .gt_switcher_wrapper,
    #gt_float_wrapper,
    .glink {
        bottom: 80px !important;
        z-index: 999 !important;
    }
}

/* --- Fixes for Single Product Sticky Bottom Sheet --- */

/* Prevent 'Tambah Ke Keranjang' text from wrapping in small containers */
.single_add_to_cart_button,
button[name="add-to-cart"] {
    white-space: nowrap !important;
    min-width: max-content;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Offset WhatsApp and GTranslate to avoid overlapping the bottom sheet on product pages */
body.single-product #styler-wa-float-container {
    bottom: 100px !important;
    z-index: 99999 !important;
}

body.single-product .gtranslate_wrapper,
body.single-product #gtranslate_wrapper,
body.single-product .gt_switcher_wrapper,
body.single-product #gt_float_wrapper,
body.single-product .glink {
    bottom: 100px !important;
    z-index: 99999 !important;
}

@media (max-width: 768px) {

    body.single-product #styler-wa-float-container,
    body.single-product .gtranslate_wrapper,
    body.single-product #gtranslate_wrapper,
    body.single-product .gt_switcher_wrapper,
    body.single-product #gt_float_wrapper,
    body.single-product .glink {
        bottom: 110px !important;
    }
}

/* --- Custom Shopee Style Prices --- */

/* Wrapper for variable products */
.custom-shopee-price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 5px;
    width: 100%;
}

/* Original price (crossed out) */
.custom-shopee-price-wrapper .styler-original-price,
.custom-shopee-price-wrapper .styler-original-price .amount,
del.styler-original-price,
del.styler-original-price .amount {
    color: #999 !important;
    text-decoration: line-through !important;
    font-weight: normal !important;
}

/* Sale price */
.custom-shopee-price-wrapper .styler-sale-price,
.custom-shopee-price-wrapper .styler-sale-price .amount,
ins.styler-sale-price,
ins.styler-sale-price .amount {
    color: #ee4d2d !important;
    /* Shopee brand orange/red */
    font-weight: 700 !important;
    text-decoration: none !important;
}

ins.styler-sale-price {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}

/* Discount Badge */
.styler-discount-badge {
    background: #ee4d2d !important;
    color: #fff !important;
    padding: 6px 6px !important;
    border-radius: 3px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1.2 !important;
    margin-left: 0px !important;
    text-decoration: none !important;
}

/* Ensure no underlines from theme */
.styler-original-price,
.styler-sale-price {
    background: transparent !important;
    box-shadow: none !important;
}

/* Mobile Adjustments for Prices (keep on one line and reduce size) */
@media (max-width: 768px) {
    .custom-shopee-price-wrapper {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        /* Allow horizontal scroll if very long */
    }

    .custom-shopee-price-wrapper .styler-original-price,
    .custom-shopee-price-wrapper .styler-original-price .amount,
    del.styler-original-price,
    del.styler-original-price .amount {
        white-space: nowrap !important;
    }

    .custom-shopee-price-wrapper .styler-sale-price,
    .custom-shopee-price-wrapper .styler-sale-price .amount,
    ins.styler-sale-price,
    ins.styler-sale-price .amount {
        white-space: nowrap !important;
    }

    ins.styler-sale-price {
        gap: 4px;
        flex-wrap: nowrap !important;
    }

    .styler-discount-badge {
        padding: 2px 4px !important;
        margin-left: 0px !important;
    }
}

/* --- Font Sizes for Custom Shopee Prices --- */
.custom-shopee-price-wrapper .styler-original-price,
.custom-shopee-price-wrapper .styler-original-price .amount {
    font-size: 11px !important;
}

.custom-shopee-price-wrapper .styler-sale-price,
.custom-shopee-price-wrapper .styler-sale-price .amount {
    font-size: 14px !important;
}

.custom-shopee-price-wrapper .styler-discount-badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
}

/*styler-product-summary*/

/* Single Product Details Page Sizes */
.single-product .styler-product-summary-inner .custom-shopee-price-wrapper .styler-original-price,
.single-product .styler-product-summary-inner .custom-shopee-price-wrapper .styler-original-price .amount {
    font-size: 26px !important;
}

.single-product .styler-product-summary-inner .custom-shopee-price-wrapper .styler-sale-price,
.single-product .styler-product-summary-inner .custom-shopee-price-wrapper .styler-sale-price .amount {
    font-size: 32px !important;
}

.single-product .styler-product-summary-inner .custom-shopee-price-wrapper .styler-discount-badge {
    font-size: 14px !important;
    padding: 4px 8px !important;
    margin-top: 4px !important;
}

/* Mobile Adjustments */
@media (max-width: 768px) {

    .custom-shopee-price-wrapper del.styler-original-price,
    .custom-shopee-price-wrapper del.styler-original-price .amount {
        font-size: 9px !important;
    }

    .custom-shopee-price-wrapper ins.styler-sale-price,
    .custom-shopee-price-wrapper ins.styler-sale-price .amount {
        font-size: 11px !important;
    }

    .single-product .styler-product-summary-inner .custom-shopee-price-wrapper .styler-original-price,
    .single-product .styler-product-summary-inner .custom-shopee-price-wrapper .styler-original-price .amount {
        font-size: 20px !important;
    }

    .single-product .styler-product-summary-inner .custom-shopee-price-wrapper .styler-sale-price,
    .single-product .styler-product-summary-inner .custom-shopee-price-wrapper .styler-sale-price .amount {
        font-size: 24px !important;
    }
}

/* Hide Xendit Logo on Checkout Page */
.woocommerce-checkout label[for*="xendit"] img,
.woocommerce-checkout .payment_methods li[class*="xendit"] img,
li.payment_method_xendit_cc label img,
li[class*="payment_method_xendit"] label img {
    display: none !important;
}