:root {
    --tmwob-primary: #168A4A;
    --tmwob-dark: #075B35;
    --tmwob-wa: #20B766;
    --tmwob-radius: 8px;
}

.tmwob-action-icon,
.tmwob-shop-action .tmwob-action-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
}

.tmwob-action-icon svg,
.tmwob-shop-action svg,
.tmwob-contact svg,
.tmwob-qty-button svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tmwob-single-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    width: 100%;
    clear: both;
    margin: 20px 0 10px;
}

.tmwob-action {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px !important;
    border: 2px solid transparent !important;
    border-radius: var(--tmwob-radius) !important;
    box-sizing: border-box;
    color: #fff !important;
    font: inherit;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-align: center;
    text-decoration: none !important;
    text-transform: none;
    cursor: pointer;
    box-shadow: none !important;
    transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

.tmwob-action:hover,
.tmwob-action:focus {
    color: #fff !important;
    transform: translateY(-1px);
    filter: brightness(.96);
    box-shadow: 0 8px 22px rgba(4, 82, 45, .16) !important;
    text-decoration: none !important;
}

.tmwob-action[disabled],
.tmwob-action[aria-disabled="true"] {
    opacity: .48;
    cursor: not-allowed;
    pointer-events: none;
}

.tmwob-single-add { background: var(--tmwob-primary) !important; }
.tmwob-single-buy { background: var(--tmwob-dark) !important; }
.tmwob-single-whatsapp { background: var(--tmwob-wa) !important; }
.tmwob-single-call { background: linear-gradient(135deg, var(--tmwob-dark), var(--tmwob-primary)) !important; }

/* Keep the real WooCommerce button available to JavaScript, but remove it visually. */
body.tmwob-single-enabled.tmwob-buttons-ready.single-product form.cart .single_add_to_cart_button {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.tmwob-single-enabled.single-product form.cart .tmwob-quantity-row {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    margin: 18px 0 2px;
    clear: both;
}

.tmwob-quantity-label {
    flex: 0 0 auto;
    color: inherit;
    font-size: 16px;
    font-weight: 600;
}

body.tmwob-single-enabled.single-product form.cart .quantity {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 190px;
    height: 58px;
    float: none !important;
    margin: 0 !important;
    padding: 0 8px !important;
    border: 1px solid #d5ddd8;
    border-radius: var(--tmwob-radius);
    background: #fff;
    box-sizing: border-box;
    overflow: hidden;
}

body.tmwob-single-enabled.single-product form.cart .quantity .qty {
    width: 72px !important;
    min-width: 0 !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    border: 0 !important;
    background: transparent !important;
    color: #14261d !important;
    box-shadow: none !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    text-align: center !important;
    -moz-appearance: textfield;
}

body.tmwob-single-enabled.single-product form.cart .quantity .qty::-webkit-outer-spin-button,
body.tmwob-single-enabled.single-product form.cart .quantity .qty::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.tmwob-qty-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    margin: 0;
    padding: 9px;
    border: 0;
    border-radius: 50%;
    background: #f0f6f2;
    color: var(--tmwob-dark);
    cursor: pointer;
    box-shadow: none;
    transition: background .15s ease, transform .15s ease;
}

.tmwob-qty-button:hover,
.tmwob-qty-button:focus {
    background: #e0efe6;
    color: var(--tmwob-dark);
    transform: scale(1.04);
}

/* Shop and category product cards: exactly two stacked buttons. */
.tmwob-shop-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    width: 100%;
    margin: 14px 0 4px;
    clear: both;
}

.tmwob-shop-action {
    width: 100%;
    min-height: 46px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px !important;
    border-radius: var(--tmwob-radius) !important;
    box-sizing: border-box;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    text-align: center;
    text-decoration: none !important;
    transition: transform .15s ease, background .15s ease, color .15s ease;
}

.tmwob-shop-action .tmwob-action-icon {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
}

.tmwob-shop-add {
    border: 2px solid var(--tmwob-primary) !important;
    background: #fff !important;
    color: var(--tmwob-primary) !important;
}

.tmwob-shop-add:hover,
.tmwob-shop-add:focus {
    background: #eff9f3 !important;
    color: var(--tmwob-dark) !important;
}

.tmwob-shop-buy {
    border: 2px solid var(--tmwob-primary) !important;
    background: var(--tmwob-primary) !important;
    color: #fff !important;
}

.tmwob-shop-buy:hover,
.tmwob-shop-buy:focus {
    background: var(--tmwob-dark) !important;
    border-color: var(--tmwob-dark) !important;
    color: #fff !important;
}

.tmwob-shop-action:hover,
.tmwob-shop-action:focus {
    transform: translateY(-1px);
    text-decoration: none !important;
}

/* Expandable contact button. */
.tmwob-contact {
    position: fixed;
    bottom: 22px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-family: inherit;
}

.tmwob-contact-right { right: 22px; }
.tmwob-contact-left { left: 22px; }

.tmwob-contact-items {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 11px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(18px) scale(.9);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.tmwob-contact.is-open .tmwob-contact-items {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.tmwob-contact-item,
.tmwob-contact-toggle {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 0 0 54px;
    padding: 14px;
    border: 0;
    border-radius: 50%;
    box-sizing: border-box;
    color: #fff !important;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 9px 25px rgba(0, 45, 25, .24);
    transition: transform .16s ease, filter .16s ease;
}

.tmwob-contact-item:hover,
.tmwob-contact-item:focus,
.tmwob-contact-toggle:hover,
.tmwob-contact-toggle:focus {
    color: #fff !important;
    transform: translateY(-2px) scale(1.03);
    filter: brightness(.97);
    text-decoration: none !important;
}

.tmwob-contact-whatsapp { background: #25D366; }
.tmwob-contact-messenger { background: #168AFF; }
.tmwob-contact-call { background: var(--tmwob-dark); }
.tmwob-contact-toggle { background: var(--tmwob-primary); }

.tmwob-contact-whatsapp svg,
.tmwob-contact-messenger svg {
    fill: currentColor;
    stroke: none;
}

.tmwob-contact-toggle svg {
    width: 27px;
    height: 27px;
}

.tmwob-toggle-close { display: none; }
.tmwob-contact.is-open .tmwob-toggle-message { display: none; }
.tmwob-contact.is-open .tmwob-toggle-close { display: inline-flex; }

.tmwob-contact-tooltip {
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    transform: translateY(-50%);
    min-width: max-content;
    padding: 6px 9px;
    border-radius: 5px;
    background: #183128;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease, visibility .15s ease;
}

.tmwob-contact-left .tmwob-contact-tooltip {
    right: auto;
    left: calc(100% + 10px);
}

.tmwob-contact-item:hover .tmwob-contact-tooltip,
.tmwob-contact-item:focus .tmwob-contact-tooltip {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 767px) {
    .tmwob-single-buttons {
        gap: 10px;
    }

    .tmwob-action {
        min-height: 54px;
        padding: 10px 8px !important;
        font-size: 14px !important;
        gap: 7px;
    }

    .tmwob-action-icon {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
    }

    body.tmwob-single-enabled.single-product form.cart .tmwob-quantity-row {
        gap: 12px;
    }

    body.tmwob-single-enabled.single-product form.cart .quantity {
        min-width: 175px;
        height: 54px;
    }

    .tmwob-contact {
        bottom: 16px;
    }

    .tmwob-contact-right { right: 15px; }
    .tmwob-contact-left { left: 15px; }
}

@media (max-width: 370px) {
    .tmwob-single-buttons {
        grid-template-columns: 1fr;
    }

    body.tmwob-single-enabled.single-product form.cart .tmwob-quantity-row {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Builder/theme fallback: keep the action grid inside the right-side product summary. */
body.single-product .summary .tmwob-single-buttons,
body.single-product .entry-summary .tmwob-single-buttons {
    max-width: 100%;
}

#tmwob-single-fallback {
    display: none !important;
}

/* Product-page reassurance badges below the four order buttons. */
.tmwob-trust-badges {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    clear: both;
    margin: 18px 0 12px;
    padding: 16px 18px;
    border: 1px solid #dcebe2;
    border-radius: var(--tmwob-radius);
    background: #fbfefc;
    box-sizing: border-box;
}

.tmwob-trust-badge {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #173c29;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
}

.tmwob-trust-icon {
    width: 29px;
    height: 29px;
    display: inline-flex;
    flex: 0 0 29px;
    align-items: center;
    justify-content: center;
    color: var(--tmwob-primary);
}

.tmwob-trust-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 767px) {
    .tmwob-trust-badges {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px 16px;
    }

    .tmwob-trust-badge {
        justify-content: flex-start;
    }
}
