/* Tradesalers Auctions frontend UI. Self-scoped so it will not disturb the theme. */
.tsa-auction-box,
.tsa-auction-box * {
    box-sizing: border-box;
}

.tsa-auction-box {
    --tsa-ink: #0b1220;
    --tsa-muted: #64748b;
    --tsa-border: rgba(15, 23, 42, 0.10);
    --tsa-soft-border: rgba(37, 99, 235, 0.16);
    --tsa-blue: #2563eb;
    --tsa-blue-dark: #1d4ed8;
    --tsa-blue-soft: #eff6ff;
    --tsa-green: #16a34a;
    --tsa-red: #dc2626;
    --tsa-amber: #d97706;

    position: relative;
    overflow: hidden;
    clear: both;
    margin: 22px 0;
    padding: 22px;
    color: var(--tsa-ink);
    border: 1px solid var(--tsa-soft-border);
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.22), transparent 32%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow:
        0 22px 60px rgba(37, 99, 235, 0.12),
        0 4px 18px rgba(15, 23, 42, 0.06);
}

.tsa-auction-box::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tsa-auction-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 18px;
}

.tsa-auction-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    color: var(--tsa-blue-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.tsa-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--tsa-green);
    box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.12);
}


@keyframes tsaLivePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.30), 0 0 0 5px rgba(22, 163, 74, 0.12);
    }
    70% {
        transform: scale(1.08);
        box-shadow: 0 0 0 10px rgba(22, 163, 74, 0), 0 0 0 5px rgba(22, 163, 74, 0.12);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0), 0 0 0 5px rgba(22, 163, 74, 0.12);
    }
}

.tsa-status-live .tsa-live-dot {
    animation: tsaLivePulse 1.8s ease-out infinite;
}


.tsa-status-scheduled .tsa-live-dot,
.tsa-status-ended .tsa-live-dot,
.tsa-status-reserve_not_met .tsa-live-dot,
.tsa-status-cancelled .tsa-live-dot {
    background: var(--tsa-amber);
    box-shadow: 0 0 0 5px rgba(217, 119, 6, 0.12);
}

.tsa-status-sold .tsa-live-dot,
.tsa-status-cancelled .tsa-live-dot {
    background: var(--tsa-red);
    box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.10);
}

.tsa-auction-box h3,
.tsa-auction-box h4 {
    margin: 0;
    color: var(--tsa-ink);
    letter-spacing: -0.03em;
}

.tsa-auction-box h3 {
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.05;
}

.tsa-auction-box h4 {
    font-size: 18px;
    line-height: 1.25;
}

.tsa-auction-subtitle,
.tsa-help-text,
.tsa-bidder-state,
.tsa-auction-closed,
.tsa-early-closure p {
    color: var(--tsa-muted);
    font-size: 14px;
    line-height: 1.55;
}

.tsa-auction-subtitle {
    max-width: 620px;
    margin: 9px 0 0;
}

.tsa-notices {
    margin: 0 0 14px;
}

.tsa-notice {
    border-radius: 14px;
    padding: 12px 14px;
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.35;
}

.tsa-notice-success {
    color: #14532d;
    background: rgba(22, 163, 74, 0.10);
    border: 1px solid rgba(22, 163, 74, 0.22);
}

.tsa-notice-error {
    color: #7f1d1d;
    background: rgba(220, 38, 38, 0.10);
    border: 1px solid rgba(220, 38, 38, 0.20);
}

.tsa-auction-state {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}

.tsa-auction-state > div {
    min-width: 0;
    min-height: 108px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid var(--tsa-border);
    border-radius: 16px;
    padding: 13px 14px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.tsa-auction-state dt {
    margin: 0 0 8px;
    color: var(--tsa-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.tsa-auction-state dd {
    margin: 0;
    width: 100%;
    text-align: center;
    color: var(--tsa-ink);
    font-size: 18px;
    font-weight: 850;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.tsa-current-bid {
    color: var(--tsa-blue-dark) !important;
}

.tsa-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    border-radius: 999px;
    padding: 6px 10px;
    color: #14532d;
    background: rgba(22, 163, 74, 0.12);
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tsa-status-scheduled .tsa-status-pill,
.tsa-status-ended .tsa-status-pill,
.tsa-status-reserve_not_met .tsa-status-pill {
    color: #78350f;
    background: rgba(217, 119, 6, 0.13);
}

.tsa-status-sold .tsa-status-pill,
.tsa-status-cancelled .tsa-status-pill {
    color: #7f1d1d;
    background: rgba(220, 38, 38, 0.11);
}

.tsa-bidder-state {
    margin: 0 0 14px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 14px;
    padding: 11px 13px;
    background: rgba(239, 246, 255, 0.72);
    font-weight: 700;
}

.tsa-bidder-state:empty {
    display: none;
}

.tsa-personal-bid-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.94), rgba(255, 255, 255, 0.90));
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.07);
}

.tsa-personal-bid-label {
    display: block;
    margin: 0 0 5px;
    color: var(--tsa-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.07em;
    line-height: 1.2;
    text-transform: uppercase;
}

.tsa-user-max-bid {
    display: block;
    color: var(--tsa-blue-dark);
    font-size: clamp(20px, 2.2vw, 28px);
    font-weight: 900;
    line-height: 1.05;
}

.tsa-personal-bid-card small {
    display: block;
    margin-top: 6px;
    color: var(--tsa-muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
}

.tsa-user-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 8px 12px;
    color: #14532d;
    background: rgba(22, 163, 74, 0.12);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.tsa-no-user-max .tsa-user-max-bid {
    color: var(--tsa-ink);
    font-size: 18px;
}

.tsa-no-user-max .tsa-user-position {
    color: #334155;
    background: rgba(100, 116, 139, 0.12);
}

.tsa-bid-form,
.tsa-early-closure form {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 12px;
    margin: 0;
}

.tsa-bid-form label,
.tsa-early-closure label {
    grid-column: 1 / -1;
    color: var(--tsa-ink);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.tsa-bid-form input,
.tsa-early-closure input,
.tsa-early-closure textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(15, 23, 42, 0.14) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    color: var(--tsa-ink);
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: none !important;
    font-size: 15px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.tsa-early-closure textarea {
    min-height: 92px;
    resize: vertical;
}

.tsa-bid-form input:focus,
.tsa-early-closure input:focus,
.tsa-early-closure textarea:focus {
    border-color: rgba(37, 99, 235, 0.55) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10) !important;
}

.tsa-button,
.tsa-auction-box .button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 0 !important;
    border-radius: 14px !important;
    padding: 12px 18px !important;
    font-size: 14px !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.tsa-button:hover,
.tsa-auction-box .button:hover {
    transform: translateY(-1px);
}

.tsa-button-primary,
.tsa-auction-box .button.alt {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--tsa-blue), var(--tsa-blue-dark)) !important;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24) !important;
}

.tsa-button-secondary,
.tsa-auction-box .tsa-early-closure .button {
    color: var(--tsa-blue-dark) !important;
    background: var(--tsa-blue-soft) !important;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15) !important;
}

.tsa-button:disabled,
.tsa-auction-box button:disabled,
.tsa-auction-box input:disabled,
.tsa-auction-box textarea:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.tsa-help-text {
    grid-column: 1 / -1;
    margin: -2px 0 0;
}

.tsa-early-closure {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(37, 99, 235, 0.14);
}

.tsa-early-closure h4 {
    margin-bottom: 7px;
}

.tsa-early-closure p {
    margin: 0 0 13px;
}

.tsa-early-form {
    grid-template-columns: 1fr auto;
}

.tsa-early-form textarea,
.tsa-early-form label[for*="note"] {
    grid-column: 1 / -1;
}

.tsa-auction-closed {
    display: inline-flex;
    align-items: center;
    margin: 0;
    border-radius: 14px;
    padding: 12px 14px;
    color: #78350f;
    background: rgba(217, 119, 6, 0.10);
    border: 1px solid rgba(217, 119, 6, 0.16);
    font-weight: 800;
}

.tsa-is-loading {
    opacity: 0.78;
}

.tsa-is-closed .tsa-bid-form,
.tsa-is-closed .tsa-early-form {
    opacity: 0.55;
}

/* Keep auction lots from showing theme add-to-cart blocks if a builder ignores Woo purchasable state. */
.product .tsa-auction-box ~ form.cart,
.product .summary:has(.tsa-auction-box) form.cart {
    display: none !important;
}

@media (max-width: 920px) {
    .tsa-auction-state {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .tsa-auction-box {
        margin: 18px 0;
        padding: 18px;
        border-radius: 18px;
    }

    .tsa-auction-state {
        grid-template-columns: 1fr;
    }

    .tsa-bid-form,
    .tsa-early-closure form,
    .tsa-early-form {
        grid-template-columns: 1fr;
    }

    .tsa-button,
    .tsa-auction-box .button {
        width: 100%;
    }
}

.tsa-early-tier-note,
.tsa-early-locked {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(12, 102, 145, 0.08);
    border: 1px solid rgba(12, 102, 145, 0.14);
    font-size: 13px;
    font-weight: 700;
}

.tsa-early-locked {
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
}


@media (max-width: 640px) {
    .tsa-personal-bid-card {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .tsa-user-position {
        width: fit-content;
    }
}

.tsa-early-admin-disabled {
    background: rgba(245, 158, 11, 0.08);
    border-radius: 18px;
    padding: 18px;
    border: 1px dashed rgba(245, 158, 11, 0.42);
}

.tsa-early-admin-note {
    margin: 0 0 12px !important;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.13);
    color: #78350f;
    font-weight: 800;
}

/* v0.3.4: Early closure as a single clean primary accordion button */
.tsa-early-closure {
    margin-top: 18px;
    padding-top: 0;
    border-top: 1px solid rgba(37, 99, 235, 0.12);
}

.tsa-early-closure summary,
.tsa-early-toggle {
    list-style: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 14px 0 0;
    padding: 13px 18px;
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(37, 99, 235, 0.70);
    color: #ffffff;
    background: linear-gradient(135deg, #0ea5ff 0%, #2563eb 58%, #1d4ed8 100%);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.26);
    font-weight: 900;
    letter-spacing: -0.01em;
    cursor: pointer;
    user-select: none;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.tsa-early-closure summary::-webkit-details-marker {
    display: none;
}

.tsa-early-closure summary:hover,
.tsa-early-toggle:hover,
.tsa-early-closure summary:focus,
.tsa-early-toggle:focus {
    filter: brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.34);
    outline: none;
}

.tsa-early-toggle::after {
    content: attr(data-tier);
    position: absolute;
    right: 14px;
    bottom: calc(100% + 8px);
    max-width: min(320px, 80vw);
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.24);
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 20;
}

.tsa-early-toggle:hover::after,
.tsa-early-toggle:focus::after {
    opacity: 1;
    transform: translateY(0);
}

.tsa-early-toggle-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.tsa-early-panel {
    padding-top: 14px;
}

.tsa-early-intro {
    margin: 0 0 12px !important;
    color: var(--tsa-muted);
    font-size: 13px;
    line-height: 1.45;
}

.tsa-early-closure .tsa-early-tier-note {
    margin-bottom: 12px;
}

.tsa-early-closure .tsa-early-form {
    margin-top: 0;
}

.tsa-early-admin-disabled {
    padding: 0 16px 16px;
}

@media (max-width: 640px) {
    .tsa-early-closure summary,
    .tsa-early-toggle {
        min-height: 50px;
        padding: 14px 18px;
    }

    .tsa-early-toggle::after {
        display: none;
    }
}


/* v0.3.5: make the early closure toggle look physically pressed while open */
.tsa-early-closure[open] summary,
.tsa-early-closure[open] .tsa-early-toggle,
.tsa-early-closure[open] summary:hover,
.tsa-early-closure[open] .tsa-early-toggle:hover,
.tsa-early-closure[open] summary:focus,
.tsa-early-closure[open] .tsa-early-toggle:focus {
    transform: translateY(2px) !important;
    filter: brightness(0.94) saturate(0.96) !important;
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 58%, #172554 100%) !important;
    border-color: rgba(96, 165, 250, 0.86) !important;
    box-shadow:
        inset 0 4px 12px rgba(15, 23, 42, 0.32),
        inset 0 -1px 0 rgba(255, 255, 255, 0.14),
        0 6px 14px rgba(37, 99, 235, 0.18) !important;
}

.tsa-early-closure[open] .tsa-early-toggle-main {
    transform: translateY(1px);
}


/* v0.4.2: keep stat cards centered but put them on a diet */
.tsa-auction-state {
    gap: 10px !important;
    margin-bottom: 16px !important;
}

.tsa-auction-state > div {
    min-height: 82px !important;
    padding: 10px 12px !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.tsa-auction-state dt {
    margin: 0 0 6px !important;
    font-size: 10.5px !important;
    line-height: 1.08 !important;
    letter-spacing: 0.055em !important;
}

.tsa-auction-state dd {
    width: 100%;
    margin: 0 !important;
    font-size: 17px !important;
    line-height: 1.1 !important;
    text-align: center !important;
}

.tsa-status-pill {
    margin-inline: auto !important;
    padding: 5px 9px !important;
    font-size: 11px !important;
    line-height: 1 !important;
}

.tsa-reserve-state,
.tsa-time-remaining {
    font-size: 17px !important;
}
