/* ─── Botón de carrito del header ([tr_cart_button]) ──────────────────────────
 * Chip circular con icono + contador en círculo rojo. Se inserta en el header
 * de Elementor vía widget Shortcode. Los updates del contador los hace el JS
 * de WooCommerce (woocommerce_add_to_cart_frag → reemplaza .tr-cart-btn);
 * este archivo es 100% presentación.
 * Scope: body .tr-cart-btn… (aislado, sin choques con el resto del header).
 */

body .tr-cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid #e3e9f2;
    color: #0f1b3d;
    text-decoration: none;
    vertical-align: middle;
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}

body .tr-cart-btn:hover {
    background: #e8f1fd;
    border-color: #b9d2fb;
    color: #0a63f5;
    box-shadow: 0 8px 18px -10px rgba(10, 99, 245, .45);
}

body .tr-cart-btn:focus-visible {
    outline: 2px solid #0a63f5;
    outline-offset: 2px;
}

body .tr-cart-btn__icon {
    width: 20px;
    height: 20px;
    flex: none;
}

/* Contador: círculo rojo en la esquina superior derecha */
body .tr-cart-btn__count {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-family: inherit;
    font-size: .7rem;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
    letter-spacing: .01em;
    box-shadow: 0 0 0 2px #fff, 0 4px 10px -4px rgba(220, 38, 38, .6);
    transition: transform .2s;
}

/* Carrito vacío: sin badge (el elemento queda para que el fragment lo pinte) */
body .tr-cart-btn__count.is-empty {
    display: none;
}

/* Tamaño compacto en headers angostos */
@media (max-width: 560px) {
    body .tr-cart-btn {
        width: 40px;
        height: 40px;
    }

    body .tr-cart-btn__icon {
        width: 18px;
        height: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body .tr-cart-btn,
    body .tr-cart-btn__count {
        transition: none !important;
    }
}