/* ==========================================================================
   Contact Lens Virtual Try-On (VTO) — Luxury Optical Studio Styling
   ========================================================================== */

/* Clean Flex Spacing for Action Buttons Row */
.detail-extralink .product-extra-link2 {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
}

.detail-extralink .product-extra-link2 .button-buy-now,
.detail-extralink .product-extra-link2 .button-vto {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Product Page Try-On Button - Pill-Shaped Matching Add to Cart & Buy Now */
.button.button-vto {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 22px !important;
    height: 44px !important;
    line-height: 44px !important;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #2563eb 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    letter-spacing: 0.4px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25) !important;
    transition: all 0.25s ease !important;
    vertical-align: middle !important;
}

.button.button-vto:hover {
    background: linear-gradient(135deg, #1e293b 0%, #1d4ed8 60%, #3b82f6 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.38) !important;
    color: #ffffff !important;
}

.button.button-vto svg {
    flex-shrink: 0;
}

/* ==========================================================================
   Modal Overlay & Studio Window
   ========================================================================== */
#vto-lens-modal {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(3, 7, 18, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    color: #f8fafc;
    opacity: 0;
    transition: opacity 0.22s ease;
}

#vto-lens-modal.vto-active {
    display: flex !important;
    opacity: 1 !important;
}

.vto-window {
    position: relative;
    width: 94%;
    max-width: 520px;
    height: 90vh;
    max-height: 820px;
    background: #060a14;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: vto-window-pop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vto-window-pop {
    from { transform: scale(0.96) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ==========================================================================
   Full-Bleed Live Camera Viewport
   ========================================================================== */
.vto-viewport {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #000000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#vto-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    transition: transform 0.2s ease;
}

#vto-canvas.vto-unmirrored {
    transform: scaleX(1);
}

/* Loader */
#vto-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(6, 10, 20, 0.92);
    z-index: 15;
    gap: 14px;
    padding: 24px;
    text-align: center;
}

.vto-spinner {
    width: 42px;
    height: 42px;
    border: 2.5px solid rgba(255, 255, 255, 0.15);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: vto-spin 0.75s linear infinite;
}

.vto-loader-label {
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e1;
    max-width: 260px;
    line-height: 1.4;
}

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

/* Floating Top Glass Bar */
.vto-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 16px 24px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

.vto-top-pill {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    max-width: 66%;
}

.vto-live-dot {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.9);
}

.vto-color-swatch-dot {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
}

.vto-top-title {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vto-top-actions {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.vto-glass-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.vto-glass-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.vto-glass-btn.vto-close-btn:hover {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 0.9);
}

/* Floating Camera Action HUD (Compare & Capture) */
.vto-camera-hud {
    position: absolute;
    bottom: 14px;
    left: 14px;
    right: 14px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.vto-hud-pill {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: all 0.18s ease;
}

.vto-hud-pill:hover {
    background: rgba(30, 41, 59, 0.85);
}

.vto-hud-pill.comparing,
.vto-hud-pill:active {
    background: #2563eb;
    border-color: #60a5fa;
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.65);
}

/* ==========================================================================
   Luxury Bottom Control Sheet
   ========================================================================== */
.vto-bottom-sheet {
    background: rgba(10, 15, 28, 0.97);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Slim Intensity Slider */
.vto-intensity-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vto-intensity-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #94a3b8;
}

.vto-intensity-row input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.vto-intensity-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2.5px solid #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.vto-intensity-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.12);
}

.vto-intensity-badge {
    font-size: 11px;
    font-weight: 700;
    color: #60a5fa;
    min-width: 34px;
    text-align: right;
}

/* Horizontal Lens Swatch Strip */
.vto-carousel {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 2px 2px 4px;
    scrollbar-width: none;
}

.vto-carousel::-webkit-scrollbar {
    display: none;
}

.vto-card {
    flex: 0 0 auto;
    width: 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
}

.vto-card:hover {
    transform: translateY(-2px);
}

.vto-card-ring {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 3px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background: #0f172a;
    overflow: hidden;
    transition: all 0.2s ease;
}

.vto-card.active .vto-card-ring {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3), 0 4px 12px rgba(37, 99, 235, 0.4);
    transform: scale(1.06);
}

.vto-card-ring img,
.vto-card-color-fill {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.vto-card-name {
    font-size: 11px;
    font-weight: 500;
    color: #cbd5e1;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vto-card.active .vto-card-name {
    color: #ffffff;
    font-weight: 600;
}

/* Bottom Purchase Bar */
.vto-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vto-selected-summary {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.vto-summary-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vto-summary-price {
    font-size: 13px;
    font-weight: 600;
    color: #60a5fa;
}

.vto-modal-add-to-cart {
    flex-shrink: 0;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 11px 26px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
}

.vto-modal-add-to-cart:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55);
}

/* ==========================================================================
   Mobile Full-Screen Immersive Layout
   ========================================================================== */
@media (max-width: 768px) {
    .vto-window {
        width: 100%;
        max-width: 100%;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
    }

    .vto-top-bar {
        padding: calc(env(safe-area-inset-top, 12px) + 10px) 14px 20px;
    }

    .vto-bottom-sheet {
        padding: 12px 16px calc(env(safe-area-inset-bottom, 12px) + 12px);
    }
}
