/* ── Widget ──────────────────────────────────────────────────────────────── */
.eyewear-tryon-widget {
    margin: 16px 0;
}
.eyewear-open-btn {
    font-size: 1rem;
    padding: 10px 20px;
    cursor: pointer;
}
.eyewear-widget-tip {
    font-size: .8rem;
    color: #777;
    margin: 6px 0 0;
}

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.eyewear-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.eyewear-modal.is-open {
    display: flex;
}
.eyewear-modal-inner {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.eyewear-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    color: #555;
}
.eyewear-close:hover { color: #000; }
.eyewear-modal-title {
    margin: 0 0 16px;
    font-size: 1.2rem;
}

/* ── View area ───────────────────────────────────────────────────────────── */
.eyewear-view-area {
    position: relative;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tryon-video-wrapper {
    position: relative;
    width: 100%;
}
#eyewear-tryon-video {
    width: 100%;
    display: block;
    border-radius: 8px;
}
#eyewear-tryon-canvas {
    width: 100%;
    border-radius: 8px;
}
#eyewear-ai-result {
    width: 100%;
    border-radius: 8px;
}

/* SVG guide overlay */
.eyewear-guide-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

/* ── Status ──────────────────────────────────────────────────────────────── */
.eyewear-status {
    min-height: 1.4em;
    margin: 10px 0;
    font-size: .9rem;
    color: #444;
}
.eyewear-status.error { color: #c0392b; }

/* ── Controls ────────────────────────────────────────────────────────────── */
.eyewear-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.eyewear-controls .button {
    padding: 8px 16px;
    font-size: .9rem;
    cursor: pointer;
    border-radius: 4px;
}
.eyewear-btn-primary {
    background: #0073aa;
    color: #fff;
    border-color: #005177;
}
.eyewear-btn-primary:hover {
    background: #005177;
    color: #fff;
}
.eyewear-btn-accent {
    background: #6c3483;
    color: #fff;
    border-color: #4a235a;
}
.eyewear-btn-accent:hover {
    background: #4a235a;
    color: #fff;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.eyewear-spinner {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    font-size: .9rem;
    border-radius: 8px;
}
.eyewear-spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: eyewear-spin .8s linear infinite;
}
@keyframes eyewear-spin {
    to { transform: rotate(360deg); }
}

/* ── Tip ─────────────────────────────────────────────────────────────────── */
.eyewear-tryon-tip {
    font-size: .8rem;
    color: #666;
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .eyewear-modal-inner { padding: 16px; }
    .eyewear-controls    { flex-direction: column; }
    .eyewear-controls .button { width: 100%; text-align: center; }
}
