/* ---------- Sticky mobile Add to Cart bar (single product) ---------- */
/* Phones only. Sits under the nav (1000) and cart drawer (1090+) lanes. */

.tc-sticky-atc {
    display: none;
}

@media all and (max-width: 767px) {
    .tc-sticky-atc {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 900;
        display: block;
        padding: var(--space-2) var(--gutter) calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--line);
        background: var(--surface-0);
        box-shadow: 0 -6px 18px rgb(41 48 66 / 8%);
        transform: translateY(100%);
        transition: transform var(--dur-base, 200ms) var(--ease-standard, ease);
    }

    .tc-sticky-atc[hidden] {
        display: none;
    }

    .tc-sticky-atc.is-visible {
        transform: translateY(0);
    }

    .tc-sticky-atc-inner {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        max-width: 1280px;
        margin: 0 auto;
    }

    /* Thumbnail and copy. On variable products this is a button that opens
       the variation sheet to change the chosen option. */
    .tc-sticky-atc-summary {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        flex: 1 1 auto;
        min-width: 0;
        min-height: 44px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: var(--radius-sm);
        background: none;
        color: inherit;
        font: inherit;
        text-align: left;
        -webkit-tap-highlight-color: transparent;
    }

    button.tc-sticky-atc-summary {
        cursor: pointer;
    }

    button.tc-sticky-atc-summary:focus-visible {
        outline: 2px solid var(--navy-700);
        outline-offset: 2px;
    }

    /* Two classes: `.woocommerce img { height: auto }` would otherwise win. */
    .tc-sticky-atc .tc-sticky-atc-thumb {
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        object-fit: cover;
    }

    .tc-sticky-atc-copy {
        display: flex;
        flex-direction: column;
        gap: 1px;
        flex-grow: 1;
        min-width: 0;
    }

    .tc-sticky-atc-name {
        display: flex;
        align-items: center;
        gap: var(--space-1);
        min-width: 0;
        color: var(--text-heading);
        font-size: var(--fs-13);
        font-weight: var(--fw-semibold);
        line-height: 1.3;
    }

    .tc-sticky-atc-name-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Variable products lead with the chosen option, the one decision on
       the page, rather than the product name. */
    .tc-sticky-atc--variable .tc-sticky-atc-name {
        font-size: var(--fs-14);
        font-weight: var(--fw-bold);
    }

    .tc-sticky-atc-chevron {
        flex-shrink: 0;
        width: 12px;
        height: 12px;
        color: var(--ink-500);
        fill: currentColor;
        transform: rotate(180deg);
    }

    .tc-sticky-atc-meta {
        overflow: hidden;
        color: var(--text-muted);
        font-size: var(--fs-12);
        line-height: 1.3;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tc-sticky-atc--variable .tc-sticky-atc-meta {
        color: var(--ink-900);
        font-size: var(--fs-13);
    }

    /* Variation price markup: current price first, then the struck regular
       price. style.css makes .price internals inherit their weight, so it is
       set on the container (and reset on del). */
    .tc-sticky-atc .tc-sticky-atc-meta .price {
        margin: 0;
        color: #222;
        font-size: inherit;
        font-weight: var(--fw-bold);
    }

    .tc-sticky-atc .tc-sticky-atc-meta .price ins {
        text-decoration: none;
    }

    .tc-sticky-atc .tc-sticky-atc-meta .price del {
        margin-left: 6px;
        color: var(--text-muted);
        font-size: var(--fs-12);
        font-weight: var(--fw-regular);
    }

    .tc-sticky-atc-button {
        flex-shrink: 0;
        min-height: 44px;
        padding: 0 var(--space-5);
        border: 0;
        border-radius: 6px;
        background: var(--orange-700, #c2540c);
        box-shadow: none;
        color: #fff;
        font-family: var(--font-ui);
        font-size: 15px;
        font-weight: var(--fw-bold);
        line-height: 1;
        white-space: nowrap;
        cursor: pointer;
        transition: background-color var(--dur-fast, 150ms) var(--ease-standard, ease);
    }

    /* Darken on hover/focus: the lighter orange-600 dropped white text to ~3.8:1. */
    .tc-sticky-atc-button:hover,
    .tc-sticky-atc-button:focus-visible {
        background: var(--orange-800, #ad490b);
        color: #fff;
    }

    .tc-sticky-atc-button:focus-visible {
        outline: 2px solid var(--navy-700);
        outline-offset: 2px;
    }

    .tc-sticky-atc-button.is-choose {
        background: var(--navy-700);
    }

    .tc-sticky-atc-button.is-loading,
    .tc-sticky-atc-button:disabled {
        opacity: 0.7;
        cursor: progress;
    }

    /* Keep the bar from covering the last thing on the page. */
    body:has(.tc-sticky-atc.is-visible) {
        padding-bottom: 72px;
    }
}

/* ---------- Variation sheet (variable products, opened from the bar) ---------- */
/* Above the bar (900), below the nav (1000) and the cart drawer (1090+), so a
   cart error the drawer reports lands on top of the sheet. */

body.tc-vsheet-locked {
    overflow: hidden;
}

.tc-vsheet {
    position: fixed;
    inset: 0;
    z-index: 980;
}

.tc-vsheet[hidden] {
    display: none;
}

/* The cart drawer's backdrop. */
.tc-vsheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(41, 48, 66, 0.5);
    opacity: 0;
    touch-action: none;
    transition: opacity var(--dur-base, 200ms) var(--ease-standard, ease);
}

.tc-vsheet.is-open .tc-vsheet-backdrop {
    opacity: 1;
}

/* Slides up decelerating; slides away a little faster, accelerating. */
.tc-vsheet-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    max-width: 560px;
    max-height: 88vh;
    max-height: 88dvh;
    margin: 0 auto;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background: var(--surface-0);
    box-shadow: 0 -8px 30px rgb(41 48 66 / 18%);
    color: var(--text-body);
    font-family: var(--font-ui);
    transform: translateY(100%);
    transition: transform 200ms cubic-bezier(0.4, 0, 1, 1);
}

.tc-vsheet.is-open .tc-vsheet-panel {
    transform: translateY(0);
    transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tc-vsheet .tc-vsheet-panel.is-dragging {
    transition: none;
}

.tc-vsheet-panel:focus {
    outline: none;
}

/* Grabber and header: the swipe-down handle. */
.tc-vsheet-drag {
    flex-shrink: 0;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.tc-vsheet-grabber {
    display: block;
    width: 36px;
    height: 4px;
    margin: var(--space-2) auto var(--space-1);
    border-radius: var(--radius-pill);
    background: var(--ink-100);
}

.tc-vsheet-head {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-1) var(--space-2) 14px var(--space-4);
    border-bottom: 1px solid var(--line);
}

.tc-vsheet .tc-vsheet-thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-1);
    object-fit: cover;
    -webkit-user-drag: none;
}

.tc-vsheet-head-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding-top: 2px;
}

.tc-vsheet .tc-vsheet-title {
    margin: 0;
    color: var(--text-heading);
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: var(--fw-semibold);
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
}

/* style.css makes .price internals inherit their weight, so weights are set
   on the .price container (and reset on del). */
.tc-vsheet .tc-vsheet-price .price {
    margin: 0;
    color: #222;
    font-size: var(--fs-18);
    font-weight: var(--fw-bold);
}

.tc-vsheet .tc-vsheet-price .price ins,
.tc-vsheet .tc-vsheet-option-price .price ins {
    text-decoration: none;
}

.tc-vsheet .tc-vsheet-price .price del {
    margin-left: var(--space-2);
    color: var(--text-muted);
    font-size: var(--fs-14);
    font-weight: var(--fw-regular);
}

.tc-vsheet-close {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--ink-500);
    cursor: pointer;
    transition: background-color var(--dur-fast, 150ms) var(--ease-standard, ease), color var(--dur-fast, 150ms) var(--ease-standard, ease);
}

.tc-vsheet-close:hover {
    background: var(--surface-1);
    color: var(--text-heading);
}

.tc-vsheet-close:focus-visible {
    outline: 2px solid var(--navy-700);
    outline-offset: 2px;
}

.tc-vsheet-close .icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Options. */
.tc-vsheet-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--space-5);
    min-height: 0;
    padding: var(--space-4);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.tc-vsheet-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.tc-vsheet-field[hidden] {
    display: none;
}

.tc-vsheet .tc-vsheet-legend {
    float: left;
    width: 100%;
    margin: 0 0 var(--space-2);
    padding: 0;
    color: var(--text-heading);
    font-size: var(--fs-16);
    font-weight: var(--fw-bold);
    line-height: 1.3;
}

/* float + width keeps the legend in the fieldset's flow; clear the content. */
.tc-vsheet-legend + * {
    clear: both;
}

.tc-vsheet-legend-value {
    font-weight: var(--fw-regular);
}

.tc-vsheet .tc-vsheet-help {
    margin: calc(var(--space-1) * -1) 0 var(--space-2);
    color: var(--ink-500);
    font-size: var(--fs-14);
    line-height: 1.45;
}

.tc-vsheet-more {
    margin: 0 0 var(--space-2);
}

.tc-vsheet-more > summary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 32px;
    color: var(--color-link);
    font-size: var(--fs-14);
    font-weight: var(--fw-semibold);
    list-style: none;
    cursor: pointer;
}

.tc-vsheet-more > summary::-webkit-details-marker {
    display: none;
}

.tc-vsheet-more > summary:focus-visible {
    border-radius: var(--radius-sm);
    outline: 2px solid var(--navy-700);
    outline-offset: 2px;
}

.tc-vsheet-more > summary .icon {
    width: 12px;
    height: 12px;
    fill: currentColor;
    transition: transform var(--dur-slow, 300ms) var(--ease-standard, ease);
}

.tc-vsheet-more[open] > summary .icon {
    transform: rotate(180deg);
}

.tc-vsheet .tc-vsheet-more p {
    margin: var(--space-1) 0 0;
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-1);
    color: var(--text-body);
    font-size: var(--fs-14);
    line-height: 1.5;
}

.tc-vsheet-group + .tc-vsheet-group {
    margin-top: var(--space-4);
}

.tc-vsheet .tc-vsheet-group-label {
    margin: var(--space-2) 0;
    color: var(--text-muted);
    font-size: var(--fs-13);
    font-weight: var(--fw-semibold);
    line-height: 1.3;
}

.tc-vsheet-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.tc-vsheet-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 56px;
    margin: 0;
    padding: var(--space-2) 14px;
    border: 2px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-0);
    cursor: pointer;
    transition: border-color var(--dur-fast, 150ms) var(--ease-standard, ease), background-color var(--dur-fast, 150ms) var(--ease-standard, ease);
    -webkit-tap-highlight-color: transparent;
}

.tc-vsheet-option:hover {
    background: var(--surface-1);
}

.tc-vsheet-option.is-selected {
    border-color: var(--navy-700);
    background: var(--surface-0);
}

.tc-vsheet-option.is-out-of-stock,
.tc-vsheet-option.is-unavailable {
    background: var(--surface-1);
    cursor: not-allowed;
}

.tc-vsheet-option.is-out-of-stock:not(.is-selected),
.tc-vsheet-option.is-unavailable:not(.is-selected) {
    border-color: var(--line);
}

.tc-vsheet .tc-vsheet-radio {
    -webkit-appearance: none;
    appearance: none;
    display: grid;
    flex-shrink: 0;
    place-content: center;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 2px solid var(--ink-200);
    border-radius: 50%;
    background: var(--surface-0);
    cursor: inherit;
}

.tc-vsheet .tc-vsheet-radio::before {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--navy-700);
    content: "";
    transform: scale(0);
    transition: transform var(--dur-fast, 150ms) var(--ease-standard, ease);
}

.tc-vsheet .tc-vsheet-radio:checked {
    border-color: var(--navy-700);
}

.tc-vsheet .tc-vsheet-radio:checked::before {
    transform: scale(1);
}

.tc-vsheet .tc-vsheet-radio:disabled:not(:checked) {
    border-color: var(--ink-100);
    background: var(--surface-2);
}

.tc-vsheet .tc-vsheet-radio:focus-visible {
    outline: 2px solid var(--navy-700);
    outline-offset: 3px;
}

.tc-vsheet-option-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tc-vsheet-option-label {
    color: var(--text-heading);
    font-size: var(--fs-16);
    font-weight: var(--fw-semibold);
    line-height: 1.3;
}

/* Unavailable and out-of-stock options stay visible, struck through. */
.tc-vsheet-option.is-out-of-stock .tc-vsheet-option-label,
.tc-vsheet-option.is-unavailable .tc-vsheet-option-label {
    color: var(--text-muted);
    text-decoration: line-through;
}

.tc-vsheet-option-note,
.tc-vsheet-option-status {
    color: var(--text-muted);
    font-size: var(--fs-13);
    line-height: 1.35;
}

.tc-vsheet-option-status:empty {
    display: none;
}

.tc-vsheet-option.is-out-of-stock .tc-vsheet-option-status {
    align-self: flex-start;
    padding: 1px var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--danger-050);
    color: var(--danger-700);
    font-size: var(--fs-12);
    font-weight: var(--fw-semibold);
}

.tc-vsheet-option-price {
    flex-shrink: 0;
    text-align: right;
}

.tc-vsheet .tc-vsheet-option-price .price {
    margin: 0;
    color: #222;
    font-size: 15px;
    font-weight: var(--fw-bold);
}

.tc-vsheet .tc-vsheet-option-price .price del {
    margin-left: 6px;
    color: var(--text-muted);
    font-size: var(--fs-13);
    font-weight: var(--fw-regular);
}

/* Short option sets as tiles. The radio stays in place for keyboard and
   screen readers; the tile shows the selection. */
.tc-vsheet-field--tiles .tc-vsheet-options {
    display: grid;
    grid-template-columns: repeat(var(--tc-vsheet-columns, 3), minmax(0, 1fr));
}

.tc-vsheet-field--tiles .tc-vsheet-option {
    justify-content: center;
    min-height: 48px;
    padding: 6px var(--space-2);
    text-align: center;
}

.tc-vsheet .tc-vsheet-field--tiles .tc-vsheet-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tc-vsheet-field--tiles .tc-vsheet-option-text {
    align-items: center;
}

.tc-vsheet-field--tiles .tc-vsheet-option-label {
    font-size: 15px;
}

.tc-vsheet-field--tiles .tc-vsheet-option:has(.tc-vsheet-radio:focus-visible) {
    outline: 2px solid var(--navy-700);
    outline-offset: 2px;
}

/* Stock, quantity and Add to Cart. */
.tc-vsheet-foot {
    flex-shrink: 0;
    padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--surface-0);
}

.tc-vsheet .tc-vsheet-stock {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: var(--fs-14);
    line-height: 1.3;
}

.tc-vsheet .tc-vsheet-stock[hidden] {
    display: none;
}

.tc-vsheet-stock-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-500);
    box-shadow: 0 0 0 4px var(--success-050);
}

.tc-vsheet-stock strong {
    color: var(--success-600);
    font-weight: var(--fw-bold);
}

.tc-vsheet-stock.is-out-of-stock .tc-vsheet-stock-dot {
    background: var(--danger-500);
    box-shadow: 0 0 0 4px var(--danger-050);
}

.tc-vsheet-stock.is-out-of-stock strong {
    color: var(--danger-700);
}

.tc-vsheet-stock.is-on-backorder .tc-vsheet-stock-dot {
    background: var(--warning-500);
    box-shadow: 0 0 0 4px var(--warning-050);
}

.tc-vsheet-stock.is-on-backorder strong {
    color: var(--text-heading);
}

.tc-vsheet-buy {
    display: flex;
    gap: var(--space-2);
}

.tc-vsheet-qty {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    height: 48px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-0);
}

.tc-vsheet-qty[hidden] {
    display: none;
}

.tc-vsheet-qty button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 46px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-heading);
    font-family: var(--font-ui);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.tc-vsheet-qty button:disabled {
    color: var(--ink-100);
    cursor: default;
}

.tc-vsheet-qty button:focus-visible {
    border-radius: var(--radius-lg);
    outline: 2px solid var(--navy-700);
    outline-offset: -2px;
}

.tc-vsheet-qty output {
    min-width: 24px;
    color: var(--text-heading);
    font-size: var(--fs-16);
    font-weight: var(--fw-semibold);
    text-align: center;
}

.tc-vsheet-cta {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    margin: 0;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: 6px;
    background: var(--orange-700, #c2540c);
    color: #fff;
    font-family: var(--font-ui);
    font-size: var(--fs-16);
    font-weight: var(--fw-bold);
    line-height: 1.2;
    cursor: pointer;
    transition: background-color var(--dur-fast, 150ms) var(--ease-standard, ease);
}

.tc-vsheet-cta:hover {
    background: var(--orange-800, #ad490b);
}

.tc-vsheet-cta:focus-visible {
    outline: 2px solid var(--navy-700);
    outline-offset: 2px;
}

.tc-vsheet-cta:disabled {
    background: var(--surface-3);
    color: var(--ink-500);
    cursor: not-allowed;
}

.tc-vsheet-cta.is-loading,
.tc-vsheet-cta.is-loading:disabled {
    background: var(--orange-700, #c2540c);
    color: #fff;
    opacity: 0.7;
    cursor: progress;
}

/* Reduced motion: the sheet fades instead of sliding. */
@media (prefers-reduced-motion: reduce) {
    .tc-sticky-atc {
        transition: none;
    }

    .tc-vsheet-panel,
    .tc-vsheet.is-open .tc-vsheet-panel {
        opacity: 0;
        transform: none;
        transition: opacity var(--dur-fast, 150ms) var(--ease-standard, ease);
    }

    .tc-vsheet.is-open .tc-vsheet-panel {
        opacity: 1;
    }

    .tc-vsheet .tc-vsheet-radio::before,
    .tc-vsheet-more > summary .icon {
        transition: none;
    }
}
