:root {
    --mirror-ink: #101828;
    --mirror-muted: #667085;
    --mirror-border: #e4e7ec;
    --mirror-surface: #ffffff;
    --mirror-soft: #f6f7f9;
    --mirror-red: #a90310;
    --mirror-red-dark: #81020c;
    --mirror-blue: #1769e0;
    --mirror-green: #087a55;
    --mirror-shadow: 0 22px 55px rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
}

body.mirror-page {
    margin: 0;
    background:
        radial-gradient(circle at 8% 8%, rgba(169, 3, 16, 0.07), transparent 24rem),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: var(--mirror-ink);
    font-family: "Plus Jakarta Sans", sans-serif;
}

.mirror-main {
    width: min(1420px, calc(100% - 44px));
    margin: 0 auto;
    padding: 46px 0 64px;
}

.mirror-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 26px;
}

.mirror-eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--mirror-red);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.mirror-hero h1 {
    margin: 0;
    font-family: "Outfit", sans-serif;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 0.94;
}

.mirror-hero p {
    max-width: 720px;
    margin: 15px 0 0;
    color: var(--mirror-muted);
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    line-height: 1.7;
}

.mirror-privacy-pill {
    display: flex;
    max-width: 390px;
    align-items: flex-start;
    gap: 11px;
    padding: 15px 17px;
    border: 1px solid #b7e4d1;
    border-radius: 14px;
    background: #ecfdf5;
    color: #276052;
    font-size: 0.72rem;
    line-height: 1.55;
}

.mirror-privacy-pill > span:first-child {
    font-size: 1rem;
}

.mirror-privacy-pill strong {
    display: block;
    color: #08664a;
}

.mirror-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.72fr);
    gap: 22px;
    align-items: start;
}

.mirror-camera-card,
.mirror-picker {
    border: 1px solid rgba(228, 231, 236, 0.94);
    border-radius: 22px;
    background: var(--mirror-surface);
    box-shadow: var(--mirror-shadow);
}

.mirror-camera-card {
    padding: 18px;
}

.mirror-picker {
    position: sticky;
    top: 20px;
    padding: 18px;
}

.mirror-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.mirror-card-heading > div:first-child {
    display: flex;
    align-items: center;
    gap: 11px;
}

.mirror-step {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
    background: #fff0f1;
    color: var(--mirror-red);
    font-family: "Outfit", sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
}

.mirror-card-heading h2 {
    margin: 0;
    font-family: "Outfit", sans-serif;
    font-size: 1.1rem;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.mirror-card-heading p {
    margin: 4px 0 0;
    color: var(--mirror-muted);
    font-size: 0.7rem;
    line-height: 1.5;
}

.mirror-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid var(--mirror-border);
    border-radius: 999px;
    background: #f9fafb;
    color: var(--mirror-muted);
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
}

.mirror-live-indicator i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #98a2b3;
}

.mirror-live-indicator.is-live {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.mirror-live-indicator.is-live i {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.13);
}

.mirror-stage {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 37%, rgba(255, 255, 255, 0.08), transparent 14rem),
        #0b1220;
    isolation: isolate;
}

.mirror-stage video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scaleX(-1);
    transition: opacity 0.28s ease;
}

.mirror-stage.is-running video {
    opacity: 1;
}

.mirror-eyewear {
    --frame-color: #111827;
    --lens-color: rgba(17, 24, 39, 0.47);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    display: none;
    width: 320px;
    aspect-ratio: 2.35 / 1;
    pointer-events: none;
    transform-origin: center;
    will-change: transform, width;
}

.mirror-eyewear.is-visible {
    display: block;
}

.mirror-eyewear[data-mode="image"] #mirror-product-overlay {
    display: block;
}

.mirror-eyewear[data-mode="image"] .mirror-demo-glasses {
    display: none;
}

.mirror-eyewear[data-mode="demo"] #mirror-product-overlay {
    display: none;
}

.mirror-eyewear[data-mode="demo"] .mirror-demo-glasses {
    display: block;
}

#mirror-product-overlay {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    filter:
        contrast(1.04)
        saturate(1.04)
        drop-shadow(0 2px 2px rgba(15, 23, 42, 0.24));
    transform: translateZ(0);
    transition: opacity 0.16s ease;
}

#mirror-product-overlay.is-ready {
    opacity: 0.98;
}

#mirror-product-overlay.is-fallback {
    mix-blend-mode: multiply;
}

.mirror-demo-glasses {
    position: absolute;
    inset: 0;
}

.demo-lens {
    position: absolute;
    top: 16%;
    width: 42%;
    height: 70%;
    border: clamp(5px, 1.8vw, 10px) solid var(--frame-color);
    border-radius: 22%;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.2), transparent 38%),
        var(--lens-color);
    box-shadow:
        inset 0 0 25px rgba(0, 0, 0, 0.18),
        0 4px 10px rgba(0, 0, 0, 0.15);
}

.demo-lens-left {
    left: 4%;
}

.demo-lens-right {
    right: 4%;
}

.demo-bridge {
    position: absolute;
    top: 38%;
    left: 44%;
    width: 12%;
    height: 16%;
    border-top: clamp(5px, 1.4vw, 8px) solid var(--frame-color);
    border-radius: 50%;
}

.demo-temple {
    position: absolute;
    top: 37%;
    width: 13%;
    height: 7%;
    border-radius: 999px;
    background: var(--frame-color);
}

.demo-temple-left {
    left: -6%;
    transform: rotate(8deg);
}

.demo-temple-right {
    right: -6%;
    transform: rotate(-8deg);
}

.mirror-demo-glasses[data-style="round"] {
    --frame-color: #202530;
    --lens-color: rgba(75, 85, 99, 0.43);
}

.mirror-demo-glasses[data-style="round"] .demo-lens {
    top: 11%;
    width: 40%;
    height: 78%;
    border-radius: 50%;
}

.mirror-demo-glasses[data-style="round"] .demo-lens-left {
    left: 6%;
}

.mirror-demo-glasses[data-style="round"] .demo-lens-right {
    right: 6%;
}

.mirror-demo-glasses[data-style="amber"] {
    --frame-color: #71462b;
    --lens-color: rgba(116, 74, 46, 0.36);
}

.mirror-demo-glasses[data-style="amber"] .demo-lens {
    border-radius: 31%;
}

.mirror-face-guide {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.mirror-stage.is-running .mirror-face-guide {
    opacity: 1;
}

.mirror-stage.has-face .mirror-face-guide {
    opacity: 0;
}

.mirror-face-guide span {
    width: min(43%, 260px);
    aspect-ratio: 0.74;
    border: 2px dashed rgba(255, 255, 255, 0.58);
    border-radius: 48% 48% 45% 45%;
    box-shadow: 0 0 0 999px rgba(4, 11, 23, 0.1);
}

.mirror-stage-status {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 8;
    display: inline-flex;
    max-width: calc(100% - 28px);
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(7, 15, 28, 0.74);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.35;
    backdrop-filter: blur(10px);
}

.mirror-stage-status i {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.mirror-stage-status.is-loading i {
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    background: transparent;
    animation: mirror-spin 0.8s linear infinite;
}

.mirror-stage-status.is-success i {
    background: #34d399;
}

.mirror-stage-status.is-warning i {
    background: #fbbf24;
}

.mirror-stage-status.is-error i {
    background: #fb7185;
}

.mirror-cart-toast {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 11;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(167, 243, 208, 0.78);
    border-radius: 11px;
    background: rgba(6, 78, 59, 0.94);
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
    font-size: 0.68rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.mirror-cart-toast[hidden] {
    display: none;
}

.mirror-cart-toast a {
    color: #d1fae5;
    font-weight: 800;
}

.mirror-cart-toast.is-error {
    border-color: rgba(254, 202, 202, 0.82);
    background: rgba(127, 29, 29, 0.95);
}

.mirror-cart-toast.is-error a {
    display: none;
}

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

.mirror-permission {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 28px;
    background:
        radial-gradient(circle at 50% 35%, rgba(169, 3, 16, 0.2), transparent 18rem),
        linear-gradient(145deg, #101828, #030712);
    color: #ffffff;
    text-align: center;
    transition: opacity 0.24s ease, visibility 0.24s ease;
}

.mirror-stage.is-running .mirror-permission {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mirror-permission-icon {
    display: grid;
    width: 72px;
    height: 72px;
    margin-bottom: 17px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    color: #fda4af;
    font-size: 2rem;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.22);
}

.mirror-permission h3 {
    margin: 0;
    font-family: "Outfit", sans-serif;
    font-size: 1.55rem;
}

.mirror-permission p {
    max-width: 390px;
    margin: 9px 0 19px;
    color: #cbd5e1;
    font-size: 0.8rem;
    line-height: 1.65;
}

.mirror-permission small {
    margin-top: 13px;
    color: #8492a6;
    font-size: 0.65rem;
}

.mirror-primary-button,
.mirror-stop-button {
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.mirror-primary-button {
    padding: 12px 20px;
    background: var(--mirror-red);
    color: #ffffff;
    box-shadow: 0 11px 24px rgba(169, 3, 16, 0.28);
}

.mirror-primary-button:hover {
    background: #c00c1a;
    transform: translateY(-1px);
}

.mirror-primary-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.mirror-stop-button {
    align-self: end;
    padding: 10px 14px;
    border: 1px solid #f3c3c6;
    background: #fff7f7;
    color: var(--mirror-red);
}

.mirror-stop-button:hover {
    background: #ffe8e9;
}

.mirror-controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 14px;
    margin-top: 14px;
    padding: 13px;
    border: 1px solid var(--mirror-border);
    border-radius: 13px;
    background: var(--mirror-soft);
}

.mirror-controls label {
    display: grid;
    gap: 7px;
    color: var(--mirror-muted);
    font-size: 0.66rem;
    font-weight: 700;
}

.mirror-controls label > span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.mirror-controls label > span small {
    color: #98a2b3;
    font-size: 0.6rem;
    font-weight: 700;
}

.mirror-controls input[type="range"] {
    width: 100%;
    accent-color: var(--mirror-red);
}

.mirror-calibration {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 9px;
}

.mirror-calibration > span {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #f8fafc;
    color: #667085;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.35;
}

.mirror-calibration i {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #98a2b3;
}

.mirror-calibration > span.is-good {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.mirror-calibration > span.is-good i {
    background: #10b981;
}

.mirror-calibration > span.is-warning {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #b45309;
}

.mirror-calibration > span.is-warning i {
    background: #f59e0b;
}

.mirror-selected {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 13px;
    padding: 2px 3px;
    font-size: 0.7rem;
}

.mirror-selected > span {
    color: var(--mirror-muted);
}

.mirror-selected strong {
    color: var(--mirror-ink);
}

.mirror-selected a {
    margin-left: auto;
    color: var(--mirror-red);
    font-weight: 800;
    text-decoration: none;
}

.mirror-product-list {
    display: grid;
    max-height: 586px;
    gap: 9px;
    padding-right: 3px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #c9ced7 transparent;
    scrollbar-width: thin;
}

.mirror-product-option {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: 82px minmax(0, 1fr) 24px 30px;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--mirror-border);
    border-radius: 13px;
    background: #ffffff;
    color: var(--mirror-ink);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.mirror-cart-button {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: var(--mirror-red);
    color: #ffffff;
    font: inherit;
    font-size: 0.74rem;
    cursor: pointer;
    box-shadow: 0 5px 13px rgba(169, 3, 16, 0.24);
}

.mirror-cart-button:hover {
    background: #86020d;
}

.mirror-cart-button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.mirror-cart-button.is-added {
    background: #047857;
}

.mirror-product-option:hover {
    border-color: #cbd1d9;
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.07);
    transform: translateY(-1px);
}

.mirror-product-option.is-selected {
    border-color: rgba(169, 3, 16, 0.42);
    background: #fff8f8;
    box-shadow: 0 0 0 3px rgba(169, 3, 16, 0.07);
}

.mirror-product-image,
.mirror-demo-thumb {
    display: grid;
    width: 82px;
    height: 62px;
    place-items: center;
    overflow: hidden;
    border-radius: 9px;
    background: #f4f5f7;
}

.mirror-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.mirror-product-copy {
    min-width: 0;
}

.mirror-product-copy strong,
.mirror-product-copy span,
.mirror-product-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mirror-product-copy strong {
    font-family: "Outfit", sans-serif;
    font-size: 0.8rem;
}

.mirror-product-copy span {
    margin-top: 2px;
    color: #344054;
    font-size: 0.69rem;
}

.mirror-product-copy small {
    margin-top: 5px;
    color: var(--mirror-muted);
    font-size: 0.6rem;
}

.mirror-product-check {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: #f0f2f5;
    color: transparent;
    font-size: 0.68rem;
    font-weight: 800;
}

.mirror-product-option.is-selected .mirror-product-check {
    background: var(--mirror-red);
    color: #ffffff;
}

.mirror-catalog-note {
    padding: 12px;
    border: 1px solid #f2d39a;
    border-radius: 11px;
    background: #fffbeb;
    color: #8a5a11;
    font-size: 0.67rem;
    line-height: 1.55;
}

.mirror-demo-thumb {
    position: relative;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 18px 10px;
}

.mirror-demo-thumb::after {
    position: absolute;
    top: 29px;
    left: 37px;
    width: 8px;
    height: 3px;
    border-radius: 99px;
    background: #111827;
    content: "";
}

.mirror-demo-thumb i {
    width: 29px;
    height: 20px;
    border: 4px solid #111827;
    border-radius: 7px;
    background: rgba(17, 24, 39, 0.32);
}

.demo-thumb-round i {
    border-radius: 50%;
    background: rgba(75, 85, 99, 0.3);
}

.demo-thumb-amber::after {
    background: #71462b;
}

.demo-thumb-amber i {
    border-color: #71462b;
    border-radius: 9px;
    background: rgba(116, 74, 46, 0.28);
}

.mirror-help {
    margin-top: 14px;
    padding: 14px;
    border-radius: 12px;
    background: #f8fafc;
}

.mirror-help strong {
    font-family: "Outfit", sans-serif;
    font-size: 0.72rem;
}

.mirror-help ul {
    margin: 8px 0 0;
    padding-left: 18px;
    color: var(--mirror-muted);
    font-size: 0.65rem;
    line-height: 1.7;
}

@media (max-width: 1080px) {
    .mirror-layout {
        grid-template-columns: 1fr;
    }

    .mirror-picker {
        position: static;
    }

    .mirror-product-list {
        max-height: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mirror-catalog-note {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .mirror-main {
        width: min(100% - 24px, 560px);
        padding: 30px 0 46px;
    }

    .mirror-hero {
        align-items: stretch;
        flex-direction: column;
        gap: 17px;
    }

    .mirror-privacy-pill {
        max-width: none;
    }

    .mirror-camera-card {
        padding: 12px;
        border-radius: 16px;
    }

    .mirror-stage {
        min-height: 68vh;
        max-height: 720px;
        border-radius: 13px;
    }

    .mirror-card-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .mirror-card-heading > div:first-child {
        width: 100%;
    }

    .mirror-live-indicator {
        align-self: flex-end;
        margin-top: -44px;
    }

    .mirror-controls {
        grid-template-columns: 1fr;
    }

    .mirror-calibration {
        grid-template-columns: 1fr;
    }

    .mirror-stop-button {
        width: 100%;
    }

    .mirror-selected {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .mirror-selected a {
        width: 100%;
        margin-left: 0;
    }

    .mirror-stage > .mirror-picker {
        position: absolute;
        top: 68px;
        right: 5px;
        bottom: 76px;
        z-index: 8;
        display: block;
        width: 58px;
        padding: 4px;
        border-color: rgba(255, 255, 255, 0.24);
        border-radius: 14px;
        background: rgba(11, 18, 32, 0.7);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
        backdrop-filter: blur(12px);
    }

    .mirror-stage > .mirror-picker > .mirror-card-heading,
    .mirror-stage > .mirror-picker > .mirror-help,
    .mirror-stage > .mirror-picker .mirror-catalog-note {
        display: none;
    }

    .mirror-stage > .mirror-picker .mirror-product-list {
        display: flex;
        max-height: 100%;
        height: 100%;
        flex-direction: column;
        gap: 5px;
        padding: 1px;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-behavior: smooth;
        scroll-snap-type: y proximity;
        scrollbar-width: none;
        touch-action: pan-y;
    }

    .mirror-stage > .mirror-picker .mirror-product-list::-webkit-scrollbar {
        display: none;
    }

    .mirror-stage > .mirror-picker .mirror-product-option {
        display: block;
        flex: 0 0 auto;
        width: 48px;
        min-height: 43px;
        padding: 3px;
        border-color: rgba(255, 255, 255, 0.34);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.92);
        scroll-snap-align: center;
    }

    .mirror-stage > .mirror-picker .mirror-product-option.is-selected {
        border-color: #ffffff;
        background: #ffffff;
        box-shadow:
            0 0 0 2px rgba(169, 3, 16, 0.88),
            0 8px 20px rgba(0, 0, 0, 0.25);
    }

    .mirror-stage > .mirror-picker .mirror-product-copy,
    .mirror-stage > .mirror-picker .mirror-product-check {
        display: none;
    }

    .mirror-stage > .mirror-picker .mirror-product-image,
    .mirror-stage > .mirror-picker .mirror-demo-thumb {
        width: 40px;
        height: 34px;
        border-radius: 6px;
    }

    .mirror-stage > .mirror-picker .mirror-cart-button {
        position: absolute;
        right: -2px;
        bottom: -2px;
        width: 19px;
        height: 19px;
        border: 2px solid #ffffff;
        border-radius: 50%;
        font-size: 0.48rem;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    }

    .mirror-stage > .mirror-picker .mirror-cart-button span {
        transform: translateY(-0.5px);
    }

    .mirror-cart-toast {
        right: 8px;
        bottom: 8px;
        left: 8px;
        justify-content: space-between;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
}
