/* Selection Viewer Overlay */
.selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 10000;
    display: none; /* Controlled by JS */
    opacity: 0;
    transition: opacity 0.4s ease;
    flex-direction: column;
}

.selection-overlay.active {
    display: flex;
    opacity: 1;
}

.selection-header {
    padding: 30px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.selection-title-area h2 {
    font-size: 32px;
    font-weight: 900;
    margin: 0;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.selection-title-area p {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.selection-controls {
    display: flex;
    gap: 15px;
}

.close-selection-btn {
    background: #f0f0f0;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-selection-btn:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.selection-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px 60px;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Selected Product Card in Viewer */
.selected-item-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.03);
}

.selected-item-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.selected-item-img-box {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: 15px;
    margin-bottom: 15px;
}

.selected-item-img-box img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.selected-item-info {
    text-align: center;
    width: 100%;
}

.selected-item-nr {
    font-size: 12px;
    font-weight: 900;
    color: #fa1922;
    margin-bottom: 5px;
}

.selected-item-name {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.remove-item-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(250, 25, 34, 0.1);
    color: #fa1922;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected-item-card:hover .remove-item-btn {
    opacity: 1;
}

.remove-item-btn:hover {
    background: #fa1922;
    color: white;
    transform: scale(1.1);
}

.selection-empty {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
}

.selection-empty i {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.selection-footer {
    padding: 30px 60px;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: rgba(255,255,255,0.5);
    display: flex;
    justify-content: flex-end;
}

.selection-footer-btns {
    display: flex;
    gap: 20px;
}

.btn-premium {
    padding: 15px 35px;
    border-radius: 40px;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 1px;
}

.btn-premium.secondary {
    background: #333;
    color: white;
}

.btn-premium.primary {
    background: linear-gradient(135deg, #fa1922, #d10000);
    color: white;
    box-shadow: 0 10px 20px rgba(250, 25, 34, 0.2);
}

.btn-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.btn-premium i {
    font-size: 18px;
}

/* Responsiveness */
@media (max-width: 768px) {
    .selection-header { padding: 20px; }
    .selection-body { padding: 20px; }
    .selection-footer { padding: 20px; }
    .selection-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
    .selection-title-area h2 { font-size: 24px; }
    .btn-premium { padding: 12px 20px; font-size: 12px; }
}
