/**
 * FittingBox VTO Styles
 * 
 * Professional eyewear-style UI with mobile responsiveness
 * 
 * @package FittingBox_VTO
 */

/* ============================================
   VTO Button Styles
   ============================================ */

.fittingbox-vto-button-wrapper {
    margin: 10px 0;
    z-index: 99;
}

.fittingbox-vto-button {
    /* Inherit theme button styles */
    font-family: 'Gilroy', sans-serif !important;
}

.fittingbox-vto-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

/* ============================================
   Modal Base Styles
   ============================================ */

/* ============================================
   Modal Base Styles (Redesigned)
   ============================================ */

.fittingbox-vto-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Gilroy', sans-serif !important;
}

.fittingbox-vto-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.fittingbox-vto-modal-container {
    position: relative;
    width: 70%;
    max-width: 1100px;
    height: 70vh;
    background: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: modalScaleIn 0.3s ease-out;
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Prevent body scroll when modal is open */
body.fittingbox-vto-modal-open {
    overflow: hidden;
}

/* ============================================
   Close Button Overlay (Screenshot Style)
   ============================================ */

.fittingbox-vto-modal-close-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 34px;
    height: 34px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    color: #000000;
    transition: all 0.2s;
    padding: 0;
}

.fittingbox-vto-modal-close-overlay:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #f5f5f5;
}

.fittingbox-vto-modal-close-overlay svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    pointer-events: none;
}

.fittingbox-vto-modal-close-overlay svg path {
    fill: currentColor !important;
    stroke: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.fittingbox-vto-modal-close-overlay img {
    display: none !important;
}

/* ============================================
   Modal Body & Container
   ============================================ */

.fittingbox-vto-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.fittingbox-vto-container {
    flex: 1;
    position: relative;
    background: #f0f0f0;
    width: 100%;
    overflow: hidden;
}

/* ============================================
   Color Selector Section (Screenshot Style)
   ============================================ */

.fittingbox-vto-color-selector {
    background: #ffffff;
    padding: 15px 30px;
    border-top: 1px solid #eee;
}

.fittingbox-vto-color-header {
    margin-bottom: 10px;
}

.fittingbox-vto-active-color-name {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.fittingbox-vto-color-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.fittingbox-vto-color-options {
    display: flex;
    gap: 12px;
}

.fittingbox-vto-color-option {
    width: 40px;
    height: 40px;
    padding: 2px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}

.fittingbox-vto-color-option:hover {
    border-color: #ccc;
}

.fittingbox-vto-color-option.active {
    border-color: #333;
}

.fittingbox-vto-swatch {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}

.fittingbox-vto-reset-options {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-decoration: underline;
    text-transform: capitalize;
}

/* ============================================
   Sticky Screen Footer (Screenshot Style)
   ============================================ */

.fittingbox-vto-sticky-screen-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000000;
    padding: 15px 20px;
}

.fittingbox-vto-sticky-footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.vto-footer-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.vto-footer-right {
    display: flex;
    align-items: center;
}

/* Proxy Qty Styles */
.fittingbox-vto-sticky-screen-footer .quantity {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.fittingbox-vto-sticky-screen-footer .quantity::before {
    content: "Qty";
    font-size: 14px;
    font-weight: 600;
}

.fittingbox-vto-sticky-screen-footer .quantity input.qty {
    width: 60px !important;
    height: 45px !important;
    text-align: center !important;
    border: 1px solid #ddd !important;
    border-radius: 0 !important;
    font-size: 16px !important;
    margin: 0 !important;
}

/* Proxy Button Styles */
.vto-footer-btn-black {
    background: #000000 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0 40px !important;
    height: 45px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
    cursor: pointer;
    font-family: 'Gilroy', sans-serif !important;
}

.vto-footer-btn-orange {
    background: #bfd1b0 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0 40px !important;
    height: 45px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
    cursor: pointer;
    font-family: 'Gilroy', sans-serif !important;
}

/* ============================================
   Mobile & Loading
   ============================================ */

.fittingbox-vto-loading,
.fittingbox-vto-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: #333;
}

.fittingbox-vto-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #f27435;
    border-radius: 50%;
    animation: vtoSpin 0.8s linear infinite;
}

@keyframes vtoSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1100px) {
    .fittingbox-vto-modal-container {
        width: 95%;
    }
}

@media (max-width: 768px) {
    .fittingbox-vto-modal-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .fittingbox-vto-modal-close-overlay {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
    }

    .fittingbox-vto-modal-close-overlay svg {
        width: 18px !important;
        height: 18px !important;
    }

    .fittingbox-vto-sticky-footer-content {
        flex-direction: row;
        /* Keep row unless very narrow */
        justify-content: center;
        width: 100%;
    }

    .vto-footer-btn-black,
    .vto-footer-btn-orange {
        padding: 0 15px !important;
        flex: 1;
    }
}

@media print {

    .fittingbox-vto-button-wrapper,
    .fittingbox-vto-modal,
    .fittingbox-vto-sticky-screen-footer {
        display: none !important;
    }
}