.fcaiv-tryon {
    margin-top: 12px;
}

.fcaiv-tryon__open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    border: 1px solid currentColor;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.fcaiv-tryon .fcaiv-tryon__open:hover,
.fcaiv-tryon .fcaiv-tryon__open:active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.fcaiv-tryon .fcaiv-tryon__open:focus:not(:focus-visible):not(:hover) {
    background: transparent;
    color: inherit;
}

.fcaiv-tryon__open:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ---------- Virtual try-on modal ---------- */

.fcaiv-modal-open {
    overflow: hidden;
}

.fcaiv-modal {
    --fwtryon-accent: #111827;
    --fwtryon-accent-text: #fff;

    box-sizing: border-box;
    width: min(480px, calc(100vw - 32px));
    max-width: none;
    max-height: min(92vh, 860px);
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #fff;
    color: #111827;
    font: inherit;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
    overflow: hidden;
}

.fcaiv-modal[open] {
    display: flex;
}

.fcaiv-modal *,
.fcaiv-modal *::before,
.fcaiv-modal *::after {
    box-sizing: border-box;
}

.fcaiv-modal::backdrop {
    background: rgba(17, 24, 39, .6);
}

.fcaiv-sheet {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    max-height: inherit;
}

.fcaiv-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.fcaiv-sheet__heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.fcaiv-sheet__step {
    color: #4b5563;
    font-size: 12px;
    line-height: 1.4;
}

.fcaiv-modal .fcaiv-sheet__title {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.fcaiv-modal .fcaiv-sheet__close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    box-shadow: none;
    color: #111827;
    cursor: pointer;
}

.fcaiv-modal .fcaiv-sheet__close:hover {
    background: #e5e7eb;
}

.fcaiv-sheet__scroll {
    flex: 1 1 auto;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.fcaiv-sheet__foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 24px 24px;
    border-top: 1px solid #f3f4f6;
    background: #fff;
}

.fcaiv-icon {
    display: inline-flex;
    flex: 0 0 auto;
}

/* Buttons */

.fcaiv-modal .fcaiv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 12px 18px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
    color: #111827;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.fcaiv-modal .fcaiv-btn:hover:not(:disabled) {
    background: #f9fafb;
}

.fcaiv-modal .fcaiv-btn--primary {
    border-color: var(--fwtryon-accent);
    background: var(--fwtryon-accent);
    color: var(--fwtryon-accent-text);
}

.fcaiv-modal .fcaiv-btn--primary:hover:not(:disabled) {
    background: var(--fwtryon-accent);
    filter: brightness(1.12);
}

.fcaiv-modal .fcaiv-btn:disabled,
.fcaiv-modal .fcaiv-btn.is-disabled {
    opacity: .4;
    cursor: not-allowed;
}

.fcaiv-btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.fcaiv-modal .fcaiv-btn-row .fcaiv-btn {
    padding: 12px 8px;
    font-size: 14px;
}

.fcaiv-modal button:focus-visible,
.fcaiv-modal a:focus-visible,
.fcaiv-modal input:focus-visible + .fcaiv-consent-card__text {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.fcaiv-hint {
    margin: 2px 0 0;
    color: #4b5563;
    font-size: 12px;
    text-align: center;
}

.fcaiv-error {
    margin: 0;
    padding: 10px 14px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
    line-height: 1.4;
}

/* State 1 */

.fcaiv-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.fcaiv-chip__thumb {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 10px;
    background: #f3f4f6;
}

.fcaiv-chip__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fcaiv-chip__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.fcaiv-chip__label {
    color: #4b5563;
    font-size: 12px;
}

.fcaiv-chip__text strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fcaiv-pill {
    flex: 0 0 auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 12px;
}

.fcaiv-modal .fcaiv-section-title {
    margin: 20px 0 10px;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
}

.fcaiv-tips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.fcaiv-tip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    border-radius: 12px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
}

.fcaiv-tip__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    color: #111827;
}

.fcaiv-consent-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    cursor: pointer;
}

.fcaiv-consent-card.is-checked {
    border-color: #111827;
    background: #fff;
}

.fcaiv-consent-card input {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 1px 0 0;
    accent-color: var(--fwtryon-accent);
    cursor: pointer;
}

.fcaiv-consent-card__text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.fcaiv-consent-card__main {
    font-size: 14px;
    line-height: 1.45;
}

.fcaiv-consent-card__note {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4b5563;
    font-size: 12px;
}

.fcaiv-camera {
    display: block;
    width: 100%;
    max-height: 60vh;
    border-radius: 12px;
    background: #111827;
    object-fit: cover;
}

/* State 2 */

.fcaiv-stage {
    position: relative;
    height: 420px;
    overflow: hidden;
    border-radius: 14px;
    background: #e5e7eb;
}

.fcaiv-stage__photo {
    position: absolute;
    inset: -20px;
    background-position: center;
    background-size: cover;
    filter: blur(14px) saturate(.6);
    opacity: .55;
}

.fcaiv-stage__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px;
}

.fcaiv-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--fwtryon-accent);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 10px #fff;
    animation: fcaiv-spin 1s linear infinite;
}

.fcaiv-stage__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #fff;
    font-size: 12px;
    text-align: center;
    color: #4b5563;
}

.fcaiv-stage__label strong {
    color: #111827;
    font-size: 14px;
}

.fcaiv-progress {
    height: 6px;
    margin: 16px 0;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.fcaiv-progress__bar {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--fwtryon-accent);
    transition: width .4s ease;
}

.fcaiv-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fcaiv-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #4b5563;
    font-size: 15px;
}

.fcaiv-step__mark {
    position: relative;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
}

.fcaiv-step.is-active {
    color: #111827;
    font-weight: 700;
}

.fcaiv-step.is-active .fcaiv-step__mark {
    border-color: #111827;
}

.fcaiv-step.is-active .fcaiv-step__mark::after {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #111827;
    content: "";
}

.fcaiv-step.is-done {
    color: #111827;
}

.fcaiv-step.is-done .fcaiv-step__mark {
    border-color: #111827;
    background: #111827;
}

.fcaiv-step.is-done .fcaiv-step__mark::after {
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    content: "";
}

/* State 3 */

.fcaiv-result {
    position: relative;
    height: clamp(260px, 44vh, 520px);
    overflow: hidden;
    border-radius: 14px;
    background: #f3f4f6;
}

.fcaiv-result__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fcaiv-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .88);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.fcaiv-modal .fcaiv-result__save {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    color: #111827;
    cursor: pointer;
}

.fcaiv-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    color: #4b5563;
    font-size: 12px;
}

.fcaiv-product-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    font-size: 14px;
}

.fcaiv-product-row__name span {
    color: #4b5563;
}

.fcaiv-link {
    color: #111827;
    font-size: 12px;
    text-decoration: underline;
}

.fcaiv-sizes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.fcaiv-modal .fcaiv-size {
    min-height: 44px;
    padding: 8px 4px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
    color: #111827;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.fcaiv-modal .fcaiv-size[aria-checked="true"] {
    border: 2px solid #111827;
    background: #f3f4f6;
}

.fcaiv-modal .fcaiv-size:disabled {
    opacity: .4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.fcaiv-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@keyframes fcaiv-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fcaiv-spinner {
        animation-duration: 3s;
    }

    .fcaiv-progress__bar {
        transition: none;
    }
}

/* Bottom sheet on phones */
@media (max-width: 599px) {
    .fcaiv-modal {
        width: 100%;
        max-height: 92vh;
        margin: auto 0 0;
        border-radius: 16px 16px 0 0;
    }

    .fcaiv-sheet__head,
    .fcaiv-sheet__scroll {
        padding: 20px;
    }

    .fcaiv-sheet__foot {
        padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    }

    .fcaiv-stage {
        height: 340px;
    }

    .fcaiv-result {
        height: clamp(260px, 42vh, 420px);
    }
}

.fcaiv-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.fcaiv-videos__item {
    width: 100%;
    border-radius: 8px;
    background: #000;
}
