/*--------------------------------------------------------------
# Currency Toggle — Compact Pill Switcher
# Branded ARS / USD toggle that replaces the verbose YayCurrency
# dropdown. Used on product pages and checkout.
#
# @package TicketSystemTango
--------------------------------------------------------------*/


/* ==========================================================================
   §1  TOGGLE CONTAINER
   Rounded pill with a sliding active indicator
   ========================================================================== */

.ts-currency-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(201, 169, 110, 0.25);
    border-radius: 100px;
    padding: 3px;
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ts-currency-toggle:hover {
    border-color: rgba(201, 169, 110, 0.45);
}

.ts-currency-toggle:focus-within {
    border-color: rgba(201, 169, 110, 0.5);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.12);
}


/* ==========================================================================
   §2  TOGGLE BUTTONS
   Each currency option
   ========================================================================== */

.ts-currency-toggle__btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    /* MOE-12-571: each segment is a 44px target (was 28px tall) on every
       surface; the map bar already set 44px */
    padding: 0 14px;
    min-height: 44px;
    border: none;
    border-radius: 100px;
    background-color: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    line-height: 1;
    position: relative;
    z-index: 1;
    box-shadow: none;
    transform: none;
}

.ts-currency-toggle__btn:hover:not(.ts-currency-toggle__btn--active) {
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.06);
    transform: none;
    box-shadow: none;
}

.ts-currency-toggle__btn:active {
    transform: none;
    box-shadow: none;
}

.ts-currency-toggle__btn:focus-visible {
    outline: 2px solid var(--ts-gold, #c9a96e);
    outline-offset: 1px;
    box-shadow: none;
}


/* ==========================================================================
   §3  ACTIVE STATE
   Gold background pill for the selected currency
   ========================================================================== */

.ts-currency-toggle__btn.ts-currency-toggle__btn--active {
    background-color: var(--ts-gold, #c9a96e);
    color: #111111;
    box-shadow: 0 2px 8px rgba(201, 169, 110, 0.3);
    cursor: default;
}

.ts-currency-toggle__btn.ts-currency-toggle__btn--active:hover {
    background-color: var(--ts-gold, #c9a96e);
    color: #111111;
    transform: none;
}

/* Flag emoji sizing */
.ts-currency-toggle__flag {
    font-size: 1rem;
    line-height: 1;
}


/* ==========================================================================
   §4  LOADING STATE
   Subtle pulse animation while the currency switch is being processed
   ========================================================================== */

.ts-currency-toggle--loading {
    pointer-events: none;
    opacity: 0.7;
    animation: ts-toggle-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes ts-toggle-pulse {
    from { opacity: 0.5; }
    to   { opacity: 0.9; }
}


/* ==========================================================================
   §5  PRODUCT PAGE — EVENT META CARD PLACEMENT
   Right of the price inside .tac-event-details__pricing
   ========================================================================== */

.ts-product-currency-switcher {
    margin: 0;
    flex: none;
}


/* ==========================================================================
   §5b SEAT MAP — BOTTOM BAR PLACEMENT
   The pill is moved into the overlay's checkout bar while the map is
   open (seating-mobile-zoom.js). Text-only, 44px targets, sits left of
   the IR AL CARRITO button (MapaAsientos artboard).
   ========================================================================== */

.tc-checkout-bar .ts-currency-toggle {
    flex: none;
    margin: 0;
    padding: 2px;
}

.tc-checkout-bar .ts-currency-toggle .ts-currency-toggle__btn {
    min-height: 44px;
    padding: 0 12px;
}

/* MOE-1-218: the map bar used to drop the flags the product page and the cart
   show — same pill everywhere (compact spacing keeps it inside the bar). */
.tc-checkout-bar .ts-currency-toggle .ts-currency-toggle__flag {
    display: inline;
    font-size: 0.85em;
    margin-right: 2px;
}

/* The subtotal shares the row with the pill and the CTA: let it wrap onto
   two lines ("Subtotal:" / amount) instead of clipping the amount. */
.tc_seating_map .tc-checkout-bar .tc-seatchart-subtotal {
    white-space: normal;
    line-height: 1.2;
    overflow: visible;
    /* the label may break between words ("Subtotal:" / amount), never inside one */
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
    font-size: 0.8rem;
}

/* compact pill in the map bar now that it carries the flags */
.tc-checkout-bar .ts-currency-toggle .ts-currency-toggle__btn {
    padding: 0 9px;
}

/* Phones: pill + subtotal + "IR AL CARRITO (n)" share ~370px — the amount was
   clipped under the CTA. Tighter pill, amount only (the "Subtotal:" label stays
   for screen readers). */
@media (max-width: 430px) {
    .tc-checkout-bar .ts-currency-toggle .ts-currency-toggle__btn {
        padding: 0 7px;
        font-size: 0.78rem;
    }

    /* MOE-3-035: the bar is not inside .tc_seating_map, so the old selectors
       never matched — flags go, the label goes, the amount keeps its room */
    .tc-checkout-bar .ts-currency-toggle .ts-currency-toggle__flag {
        display: none;
    }

    .tc-checkout-bar .tc-checkout-button {
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .tc_seating_map .tc-checkout-bar .tc-seatchart-subtotal,
    .tc-checkout-bar .tc-seatchart-subtotal {
        font-size: 0; /* the ≤768px rule below outranks this block otherwise */
        flex: 1 1 auto;
        min-width: 0;
        text-align: right;
        padding-right: 8px;
    }

    .tc-checkout-bar .tc-seatchart-subtotal strong,
    .tc-checkout-bar .tc-seatchart-subtotal .amount,
    .tc-checkout-bar .tc-seatchart-subtotal .woocommerce-Price-currencySymbol {
        font-size: 0.95rem;
        white-space: nowrap;
    }
}

/* The amount itself never breaks mid-number ("$ 60.00 / 0,00"). */
.tc_seating_map .tc-checkout-bar .tc-seatchart-subtotal strong {
    display: inline-block;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .tc_seating_map .tc-checkout-bar .tc-seatchart-subtotal {
        font-size: 0.8rem;
    }

    .tc_seating_map .tc-checkout-bar .tc-seatchart-subtotal strong {
        font-size: 0.92rem;
    }

    .tc-checkout-bar .ts-currency-toggle .ts-currency-toggle__btn {
        padding: 0 11px;
    }

    /* Three things share 348px: pill · subtotal · "IR AL CARRITO (n)".
       Compact the CTA and the amount so the amount never clips. */
    .tc_seating_map .tc-checkout-bar .tc-checkout-button {
        min-width: 0;
        padding: 10px 12px;
        font-size: 0.75rem; /* 12px floor */
        letter-spacing: 0.02em;
    }

    .tc_seating_map .tc-checkout-bar .tc-seatchart-subtotal strong {
        font-size: 0.85rem;
    }
}

/* MOE-3-035: under 430px the "Subtotal:" label goes and the amount keeps a
   readable size — placed after the ≤768px block so it wins the cascade */
@media (max-width: 430px) {
    .tc_seating_map .tc-checkout-bar .tc-seatchart-subtotal {
        font-size: 0;
    }

    .tc_seating_map .tc-checkout-bar .tc-seatchart-subtotal strong {
        font-size: 0.95rem;
    }
}


/* ==========================================================================
   §6  CHECKOUT CONTEXT
   Currency indicator + toggle inside the checkout mobile summary bar
   and payment hint area
   ========================================================================== */

.ts-checkout-currency {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ts-checkout-currency__hint {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-body);
    letter-spacing: 0.02em;
}

.ts-checkout-currency__hint strong {
    color: var(--ts-gold, #c9a96e);
    font-weight: 600;
}


/* ==========================================================================
   §7  PAYMENT METHOD HINT STRIP
   Contextual banner explaining currency ↔ payment method link
   ========================================================================== */

.ts-payment-currency-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background-color: rgba(201, 169, 110, 0.08);
    border: 1px solid rgba(201, 169, 110, 0.2);
    border-radius: 8px;
    margin-bottom: 16px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.ts-payment-currency-hint__icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    line-height: 1;
}

.ts-payment-currency-hint__text strong {
    color: #ffffff;
    font-weight: 600;
}

.ts-payment-currency-hint__change {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--ts-gold, #c9a96e);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-body);
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
    padding: 0;
}

.ts-payment-currency-hint__change:hover {
    color: #ffffff;
}

@media (max-width: 480px) {
    .ts-payment-currency-hint {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 14px;
    }

    .ts-payment-currency-hint__change {
        margin-left: 0;
        width: 100%;
        text-align: center;
        padding-top: 8px;
        border-top: 1px solid rgba(201, 169, 110, 0.15);
    }
}

/* Phone tap targets retain the same currency behavior and labels. */
@media (max-width: 767px) {
    .ts-currency-toggle__btn { min-height: 44px; }
}
