/* TCF Merchant Hub Alpha 2. Presentation inherits from TCF Core tokens. */
.tcf-quick-view-dialog {
    position: relative;
    width: min(900px, 92vw);
    max-width: 92vw;
    max-height: 90vh;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 14px;
    background: var(--tt-surface, #fff);
    color: var(--tt-text, #111);
    box-shadow: 0 24px 70px rgb(0 0 0 / .35);
}
.tcf-quick-view-dialog::backdrop { background: rgb(5 14 22 / .72); }
.tcf-quick-view-dialog__close {
    position: absolute;
    z-index: 2;
    top: .65rem;
    right: .65rem;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--tt-border, #ddd);
    border-radius: 999px;
    background: var(--tt-surface, #fff);
    color: var(--tt-text, #111);
    font: inherit;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}
.tcf-quick-view-dialog__close:focus-visible { outline: 3px solid var(--wp--preset--color--primary-green, #278520); outline-offset: 2px; }
[aria-busy="true"] { cursor: progress; }

/* Alpha 11 product-card actions and complete Quick View layout. */
.tcf-quick-view-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: .55rem;
    border: 1px solid var(--tt-border, #d8d8d8);
    background: transparent;
    color: var(--tt-text, #111);
    cursor: pointer;
}
.tcf-quick-view-trigger:hover,
.tcf-quick-view-trigger:focus-visible {
    border-color: var(--wp--preset--color--primary-green, #278520);
    outline: none;
    box-shadow: 0 0 0 3px rgb(39 133 32 / .18);
}
.tcf-quick-view {
    display: grid;
    grid-template-columns: minmax(240px, .9fr) minmax(0, 1.1fr);
    gap: clamp(1.25rem, 4vw, 3rem);
    padding: clamp(1.25rem, 4vw, 2.75rem);
}
.tcf-quick-view__media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}
.tcf-quick-view__body { min-width: 0; }
.tcf-quick-view__title { margin-top: 0; padding-right: 2.75rem; }
.tcf-quick-view__price { margin: .7rem 0 1rem; font-size: 1.15rem; font-weight: 800; }
.tcf-quick-view__purchase { margin-top: 1.25rem; }
.tcf-quick-view__purchase form.cart { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.tcf-quick-view__purchase .variations { width: 100%; }
.tcf-quick-view__purchase .variations th,
.tcf-quick-view__purchase .variations td { padding: .35rem .5rem .35rem 0; text-align: left; }
.tcf-quick-view__purchase select,
.tcf-quick-view__purchase input[type="number"] {
    max-width: 100%;
    padding: .65rem .75rem;
    border: 1px solid var(--tt-border, #ddd);
    border-radius: 8px;
    background: var(--tt-inset, #fff);
    color: var(--tt-text, #111);
}
.tcf-quick-view__details { margin-bottom: 0; }
@media (max-width: 700px) {
    .tcf-quick-view { grid-template-columns: 1fr; }
    .tcf-quick-view-dialog { width: min(94vw, 620px); }
}

/* --------------------------------------------------------------------------
   Alpha 12.2 — WooCommerce semantic contrast and unified reviews
   -------------------------------------------------------------------------- */
.woocommerce,
.woocommerce-page,
.woocommerce div.product,
.woocommerce div.product .woocommerce-product-details__short-description,
.woocommerce div.product .woocommerce-tabs .panel,
.woocommerce div.product .woocommerce-tabs .panel p,
.woocommerce div.product .woocommerce-tabs .panel li,
.woocommerce div.product .woocommerce-tabs .panel td,
.woocommerce div.product .woocommerce-tabs .panel th,
.woocommerce .product_meta,
.woocommerce .quantity .qty,
.woocommerce form .form-row label,
.woocommerce table.shop_table,
.woocommerce-account .woocommerce-MyAccount-content {
    color: var(--tt-text, #111);
}
.woocommerce .product_meta,
.woocommerce .product_meta > span,
.woocommerce .woocommerce-breadcrumb,
.woocommerce div.product .stock,
.woocommerce .woocommerce-result-count {
    color: var(--tt-text-muted, #666);
}
.woocommerce a:not(.button):not(.wp-element-button),
.woocommerce-page a:not(.button):not(.wp-element-button) {
    color: var(--tt-link, #1a7d15);
}
.woocommerce div.product p.price,
.woocommerce div.product span.price,
.woocommerce ul.products li.product .price,
.wc-block-components-product-price {
    color: var(--tt-text, #111);
}
.woocommerce .price ins,
.woocommerce div.product p.price ins,
.woocommerce div.product span.price ins {
    color: var(--tt-success-text, #1a7d15);
    text-decoration: none;
}
.woocommerce .price del,
.woocommerce div.product p.price del,
.woocommerce div.product span.price del {
    color: var(--tt-text-muted, #777);
    opacity: .9;
}
.woocommerce .stock.out-of-stock,
.woocommerce .required,
.woocommerce-error,
.woocommerce-invalid label,
.woocommerce-invalid .input-text {
    color: var(--tt-danger-text, #a61e23);
}
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    background: var(--tt-surface, #fff);
    color: var(--tt-text, #111);
    border-color: var(--tt-border, #ddd);
}
.woocommerce-error { border-top-color: var(--tt-danger-text, #a61e23); }
.woocommerce-message { border-top-color: var(--tt-success-text, #1a7d15); }
.woocommerce-info { border-top-color: var(--tt-link, #1a7d15); }

.tcf-unified-reviews {
    color: var(--tt-text, #111);
}
.tcf-unified-reviews__summary {
    display: grid;
    gap: .6rem;
    margin-bottom: 1.5rem;
}
.tcf-unified-reviews__summary h2,
.tcf-unified-reviews__average { margin: 0; }
.tcf-unified-reviews__sources {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .2rem 0 0;
    padding: 0;
    list-style: none;
}
.tcf-unified-reviews__sources li,
.tcf-unified-review__source,
.tcf-unified-review__verified {
    display: inline-flex;
    align-items: center;
    padding: .3rem .6rem;
    border: 1px solid var(--tt-border, #ddd);
    border-radius: 999px;
    background: var(--tt-raised, #f5f5f5);
    color: var(--tt-text-muted, #666);
    font-size: .75rem;
    font-weight: 700;
}
.tcf-unified-review__verified {
    color: var(--tt-success-text, #1a7d15);
}
.tcf-unified-reviews__list {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.tcf-unified-review {
    padding: 1.15rem;
    border: 1px solid var(--tt-border, #ddd);
    border-radius: var(--tt-radius, 14px);
    background: var(--tt-surface, #fff);
    color: var(--tt-text, #111);
}
.tcf-unified-review__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.tcf-unified-review__header > div {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
}
.tcf-unified-review__author { color: var(--tt-text, #111); }
.tcf-unified-review__header time { color: var(--tt-text-muted, #666); font-size: .82rem; }
.tcf-unified-review__rating { margin-top: .75rem; color: var(--tt-warning-text, #9a5f03); letter-spacing: .08em; }
.tcf-unified-review__content { margin-top: .65rem; color: var(--tt-text, #111); }
.tcf-unified-review__content > :last-child { margin-bottom: 0; }
.tcf-unified-review__source-link { margin: .75rem 0 0; }
.tcf-unified-reviews__form {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--tt-border, #ddd);
}
.tcf-unified-reviews__form input,
.tcf-unified-reviews__form textarea,
.tcf-unified-reviews__form select {
    max-width: 100%;
    border: 1px solid var(--tt-border, #ddd);
    background: var(--tt-inset, #fff);
    color: var(--tt-text, #111);
}
@media (max-width: 600px) {
    .tcf-unified-review__header { flex-direction: column; }
}
.woocommerce div.product .woocommerce-tabs ul.tabs::before{border-color:var(--tt-border,#ddd)}.woocommerce div.product .woocommerce-tabs ul.tabs li{border-color:var(--tt-border,#ddd);background:var(--tt-raised,#f5f5f5)}.woocommerce div.product .woocommerce-tabs ul.tabs li a{color:var(--tt-text-muted,#666)}.woocommerce div.product .woocommerce-tabs ul.tabs li.active{background:var(--tt-surface,#fff);border-bottom-color:var(--tt-surface,#fff)}.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover,.woocommerce div.product .woocommerce-tabs ul.tabs li a:focus-visible{color:var(--tt-text,#111)}

/* --------------------------------------------------------------------------
   Alpha 13 — frictionless Quick Add + reusable Commerce Action Toast
   -------------------------------------------------------------------------- */
.tcf-quick-add,
.tcf-variable-quick-add,
.tcf-native-add,
.wc-block-components-product-button__button.product_type_simple,
.tcf-buy-now,
.tcf-quick-view__purchase .single_add_to_cart_button,
.single-product form.cart .single_add_to_cart_button {
    transition:
        background-color 220ms ease-out,
        border-color 220ms ease-out,
        color 220ms ease-out;
}

.tcf-quick-add.tcf-action-acknowledged,
.tcf-variable-quick-add.tcf-action-acknowledged,
.tcf-native-add.tcf-action-acknowledged,
.wc-block-components-product-button__button.product_type_simple.tcf-action-acknowledged,
.tcf-buy-now.tcf-action-acknowledged,
.tcf-quick-view__purchase .single_add_to_cart_button.tcf-action-acknowledged,
.single-product form.cart .single_add_to_cart_button.tcf-action-acknowledged {
    background: var(--tcf-quick-add-confirm-bg, #f2c94c) !important;
    border-color: var(--tcf-quick-add-confirm-bg, #f2c94c) !important;
    color: var(--tcf-quick-add-confirm-color, #172010) !important;
}

.tcf-quick-add[aria-busy="true"],
.tcf-variable-quick-add[aria-busy="true"],
.tcf-buy-now[aria-busy="true"],
.tcf-quick-view__purchase .single_add_to_cart_button[aria-busy="true"],
.single-product form.cart .single_add_to_cart_button[aria-busy="true"] {
    cursor: wait;
}

.tcf-variable-quick-add {
    width: 100%;
}

.tcf-merchant-hub-toast {
    position: fixed;
    z-index: 100000;
    top: 1.25rem;
    right: 1.25rem;
    width: min(390px, calc(100vw - 2rem));
    padding: 1rem 1rem .95rem;
    border: 1px solid var(--tt-border, #ddd);
    border-radius: var(--tt-radius, 14px);
    background: var(--tt-surface, #fff);
    color: var(--tt-text, #111);
    box-shadow: var(--tt-shadow-lift, 0 16px 45px rgb(0 0 0 / .25));
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition:
        opacity 180ms ease-out,
        transform 180ms ease-out,
        visibility 180ms linear;
}

.tcf-merchant-hub-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.tcf-merchant-hub-toast.is-error {
    border-color: var(--tt-danger-text, #a61e23);
}

.tcf-merchant-hub-toast__close {
    position: absolute;
    top: .45rem;
    right: .55rem;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--tt-text-muted, #666);
    font: inherit;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.tcf-merchant-hub-toast__close:hover,
.tcf-merchant-hub-toast__close:focus-visible {
    background: var(--tt-raised, #f5f5f5);
    color: var(--tt-text, #111);
    outline: none;
    box-shadow: 0 0 0 3px rgb(39 133 32 / .18);
}

.tcf-merchant-hub-toast__message {
    margin: 0;
    padding-right: 2rem;
    color: var(--tt-text, #111);
    font-weight: 700;
    line-height: 1.45;
}

.tcf-merchant-hub-toast.is-error .tcf-merchant-hub-toast__message {
    color: var(--tt-danger-text, #a61e23);
}

.tcf-merchant-hub-toast__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    margin-top: .85rem;
}

.tcf-merchant-hub-toast__actions[hidden] { display: none; }

.tcf-merchant-hub-toast__cart,
.tcf-merchant-hub-toast__checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: .65rem .8rem;
    border-radius: 9px;
    font-weight: 800;
    text-decoration: none !important;
    text-align: center;
}

.tcf-merchant-hub-toast__cart {
    border: 1px solid var(--tt-border, #ddd);
    background: transparent;
    color: var(--tt-text, #111) !important;
}

.tcf-merchant-hub-toast__checkout {
    border: 1px solid var(--wp--preset--color--primary-green, #278520);
    background: var(--wp--preset--color--primary-green, #278520);
    color: #fff !important;
}

.tcf-merchant-hub-toast__cart:hover,
.tcf-merchant-hub-toast__cart:focus-visible,
.tcf-merchant-hub-toast__checkout:hover,
.tcf-merchant-hub-toast__checkout:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgb(39 133 32 / .18);
}

@media (max-width: 700px) {
    .tcf-merchant-hub-toast {
        top: auto;
        right: 1rem;
        bottom: 1rem;
        left: 1rem;
        width: auto;
        transform: translateY(8px);
    }
    .tcf-merchant-hub-toast.is-visible { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .tcf-quick-add,
    .tcf-variable-quick-add,
    .tcf-native-add,
    .wc-block-components-product-button__button.product_type_simple,
    .tcf-buy-now,
    .tcf-quick-view__purchase .single_add_to_cart_button,
    .tcf-merchant-hub-toast {
        transition-duration: .01ms !important;
    }
}

/* --------------------------------------------------------------------------
   Alpha 13.1 — Product Collection compatibility + stable action dimensions
   -------------------------------------------------------------------------- */
.tcf-quick-add,
.tcf-variable-quick-add,
.tcf-quick-view-trigger,
.tcf-buy-now,
.tcf-quick-view__purchase .single_add_to_cart_button {
    box-sizing: border-box;
    min-height: 42px;
    height: auto !important;
    max-height: none;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: normal;
    line-height: 1.2;
}

/* WooCommerce Product Collection owns this wrapper. TCF decorates its native
   button instead of replacing the wrapper, so the button remains a normal CTA. */
.tt-products .wc-block-components-product-button__button.tcf-quick-add,
.tt-products .wc-block-components-product-button__button.tcf-variable-quick-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    padding: .72rem .9rem;
}

/* A secondary Quick View trigger is a sibling of Woo's Product Button wrapper.
   It receives its own card spacing instead of inheriting Product Button internals. */
.tt-products .wc-block-components-product-button + .tcf-quick-view-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 2rem);
    margin: -.45rem 1rem 1.1rem;
    padding: .68rem .85rem;
}

.woocommerce ul.products li.product .tcf-quick-add,
.woocommerce ul.products li.product .tcf-variable-quick-add,
.woocommerce ul.products li.product .tcf-quick-view-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* --------------------------------------------------------------------------
   Alpha 17.2 — direct checkout action, still backed by WooCommerce Store API
   -------------------------------------------------------------------------- */
.tcf-buy-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    cursor: pointer;
}

.wc-block-product > .tcf-buy-now,
.wp-block-post.product > .tcf-buy-now,
.woocommerce ul.products li.product > .tcf-buy-now {
    width: 100%;
    margin-top: .55rem;
}

.single-product form.cart .tcf-buy-now,
.tcf-quick-view__purchase form.cart .tcf-buy-now {
    margin-inline-start: .55rem;
    vertical-align: middle;
}

.tcf-quick-view-dialog--buy-now .tcf-buy-now {
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}

/* --------------------------------------------------------------------------
   Alpha 13.2 — inline variation validation; no blocking browser alerts
   -------------------------------------------------------------------------- */
.tcf-quick-add-validation {
    width: 100%;
    margin: .35rem 0 .75rem;
    padding: .7rem .8rem;
    border: 1px solid var(--tt-danger-text, #c4454d);
    border-color: color-mix(in srgb, var(--tt-danger-text, #c4454d) 45%, transparent);
    border-radius: 9px;
    background: var(--tt-raised, #f7f2ea);
    background: color-mix(in srgb, var(--tt-danger-text, #c4454d) 10%, var(--tt-surface, #fff));
    color: var(--tt-danger-text, #c4454d);
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.4;
}

.tcf-quick-add-validation[hidden] {
    display: none !important;
}

form.variations_form .tcf-field-invalid {
    border-color: var(--tt-danger-text, #c4454d) !important;
    box-shadow: 0 0 0 2px rgb(196 69 77 / .22);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--tt-danger-text, #c4454d) 22%, transparent);
}
