/* ═══════════════════════════════════════════════─── Wrapper that contains both the native <select> and the swatches ─── */
.wcvs-wrapper {
    display: block;
    position: relative;
}

/* ─── Hide the native <select> visually, but keep it in the DOM for form submission ─── */
.wcvs-wrapper select {
    position: absolute !important;
    left: -99999px !important;
    top: -99999px !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    /* Keep pointer-events: none so clicks pass through to the swatches */
    pointer-events: none !important;
}

/* ─── Swatch container ─── */
.wcvs-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

/* ─── Base swatch button ─── */
.wcvs-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #d5d5d5;
    background: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.1s ease;
    user-select: none;
    outline: none;
    position: relative;
    box-sizing: border-box;
    color: #333;
    text-transform: uppercase;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wcvs-swatch:hover {
    border-color: #888;
    transform: scale(1.1);
    z-index: 2;
}

.wcvs-swatch:focus-visible {
    box-shadow: 0 0 0 2px rgba(0, 120, 255, 0.6);
}

.wcvs-swatch.selected {
    border-color: #222;
    box-shadow:
        0 0 0 2px #222,
        0 2px 8px rgba(0, 0, 0, 0.18);
    transform: scale(1.06);
}

/* ─── Colour swatch ─── */
.wcvs-swatch--color {
    border-color: #ccc;
}

.wcvs-swatch--color.selected {
    border-color: #222;
}

/* Inner ring for light colours so they show up against a white page */
.wcvs-inner-ring {
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

/* ─── Size / text swatch — rectangle ─── */
.wcvs-swatch--size {
    width: auto;
    min-width: 42px;
    height: 40px;
    padding: 0 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    background: #f5f5f5;
    border-color: #d5d5d5;
    color: #333;
}

.wcvs-swatch--size:hover {
    background: #e8e8e8;
    border-color: #999;
}

.wcvs-swatch--size.selected {
    background: #222;
    color: #fff;
    border-color: #222;
}

/* ─── Tooltip ─── */
.wcvs-swatch .wcvs-tooltip {
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.88);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 9px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
    text-transform: none;
    letter-spacing: 0;
}

.wcvs-swatch:hover .wcvs-tooltip {
    opacity: 1;
}

/* ─── Disabled / out-of-stock swatch ─── */
.wcvs-swatch.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.wcvs-swatch.disabled::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 12%;
    right: 12%;
    height: 2px;
    background: #999;
    transform: translateY(-50%) rotate(-40deg);
}

/* ═══════════════════════════════════════════════════════════
   TRUST STACK — badges + accordions
   ═══════════════════════════════════════════════════════════ */

.truststack-section {
    margin-top: 0px;
    padding: 0 !important;
}

.truststack-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

/* ─── Trust badges row ─── */
.truststack-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 0;
}

.truststack-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 140px;
}

.truststack-badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.truststack-badge-icon svg {
    width: 44px;
    height: 44px;
    stroke: var(--truststack-icon-color, #4f46e5);
    fill: none;
}

.wcvs-custom-icon {
    max-width: 80px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.truststack-badge-text {
    display: flex;
    flex-direction: column;
}

.truststack-badge-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--truststack-text-color, #111827);
    line-height: 1.3;
}

.truststack-badge-subtitle {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.3;
    margin-top: 1px;
}

/* ─── Accordion section ─── */
.truststack-accordions {
    border: 1px solid var(--truststack-border-color, #e5e7eb);
    border-radius: var(--truststack-border-radius, 12px);
    overflow: hidden;
    margin-top: 8px;
}

.truststack-accordion {
    border-bottom: 1px solid var(--truststack-border-color, #e5e7eb);
}

.truststack-accordion:last-child {
    border-bottom: none;
}

.truststack-accordion-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--truststack-text-color, #111827);
    text-align: left;
    transition: background-color 0.15s ease;
}

.truststack-accordion-trigger:hover {
    background-color: #f9fafb;
}

.truststack-accordion-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.truststack-accordion-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--truststack-icon-color, #4f46e5);
    fill: none;
}

.truststack-accordion-title {
    flex: 1;
}

.truststack-accordion-arrow {
    display: flex;
    align-items: center;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.truststack-accordion.is-open .truststack-accordion-arrow {
    transform: rotate(180deg);
}

.truststack-accordion-content {
    display: none;
    background: inherit;
}

.truststack-accordion.is-open .truststack-accordion-content {
    display: block;
    animation: truststackFadeIn 0.3s ease;
}

@keyframes truststackFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.truststack-accordion-inner {
    padding: 0 16px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

.truststack-accordion-inner p {
    margin: 0 0 8px;
}

.truststack-accordion-inner p:last-child {
    margin-bottom: 0;
}

/* ─── Mobile responsive ─── */
@media (max-width: 999.98px) {
    .truststack-badges {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .truststack-badge {
        flex-direction: column;
        text-align: center;
        min-width: 0;
        flex: 1;
    }

    .truststack-badge-text {
        align-items: center;
    }
}

/* ─── Size Guide link ─── */
.wcvs-size-guide {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    color: #555 !important;
    font-size: 12px;
    text-decoration: none !important;
    border-bottom: 1px dotted #999;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
}

.wcvs-size-guide:hover {
    color: #333 !important;
    border-bottom-color: #555;
}

.wcvs-ruler-icon {
    flex-shrink: 0;
    display: inline-flex;
    color: #999;
}

/* ─── Size Guide Modal ─── */
.wcvs-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.75);
    align-items: center;
    justify-content: center;
    padding: 1px;
    box-sizing: border-box;
}

.wcvs-modal-overlay.is-open {
    display: flex;
}

.wcvs-modal-content {
    position: relative;
    max-width: 98vw;
    max-height: 90vh;
    background-color: white;
    border-radius: 25px;
}

.wcvs-modal-close {
    position: absolute;
    top: -36px;
    right: -36px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    padding: 0;
    line-height: 1;
}

.wcvs-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.wcvs-modal-image {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    height: auto;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

@media (max-width: 600px) {
    .wcvs-modal-close {
        top: -40px;
        right: 0;
    }

    .wcvs-modal-content {
        max-width: 98vw;
    }
}

/* ─── Variation row spacing ─── */
form.variations_form table.variations tr:not(:last-child) {
    margin-bottom: 0.5em;
}
