/**
 * Product Selector Modal - Base Styles
 * Modal container, overlay, layout, animations
 */

/* ==========================================================================
   Modal Container & Overlay
   ========================================================================== */

.product-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.product-selector-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.product-selector-modal__content {
    position: relative;
    width: 100%;
    max-width: 1400px;
    max-height: 90vh;
    background-color: var(--bg-modal);
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modal-slide-in 0.3s ease-out;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.product-selector-modal__layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    flex: 1;
    overflow: hidden;
}

/* ==========================================================================
   Loading & Empty States
   ========================================================================== */

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loading-spinner__icon {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

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

.product-grid__empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.product-grid__empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
    color: var(--text-muted);
}

.product-grid__empty-title {
    font-size: clamp(1.1rem, 3vw + 0.1rem, 1.25rem);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.product-grid__empty-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Light Theme
   ========================================================================== */

.light .product-selector-modal__backdrop {
    background-color: rgba(0, 0, 0, 0.4);
}
