.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.popup-content {
    background: var(--white);
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    text-align: center;
}

.popup-header {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.popup-images {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    /* flex-wrap: wrap; */ /* Removed to prevent wrapping */
    margin-bottom: 1.5rem;
    overflow-x: auto; /* Add horizontal scroll if needed */
    padding-bottom: 0.5rem; /* Add padding to account for scrollbar */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on touch devices */
    scrollbar-width: thin; /* For Firefox */
}

/* Add styling for scrollbar */
.popup-images::-webkit-scrollbar {
    height: 6px;
}

.popup-images::-webkit-scrollbar-thumb {
    background-color: var(--text-muted);
    border-radius: 3px;
}

.popup-images img {
    width: 80px;
    height: 180px;  /* Increased from 80px to 120px */
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.popup-images img.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px var(--primary-color);
}

.popup-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.popup-footer button {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.popup-footer .btn-cancel {
    background: var(--background-alt);
    color: var(--text-dark);
}

.popup-footer .btn-cancel:hover {
    background: var(--text-muted);
}

.popup-footer .btn-add {
    background: var(--primary-color);
    color: var(--white);
}

.popup-footer .btn-add:hover {
    background: var(--primary-dark);
}