.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;     
    justify-content: center; 
    background: rgba(0, 0, 0, 0.55); 
    backdrop-filter: blur(10px);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 50;
    transition: color 0.2s ease;
}
.close-btn:hover {
    color: #ff0000;
}

.modal-diesign-content {
    position: relative;
    width: min(95vw, 1300px); /* Единый размер */
    height: min(85vh, 750px); 
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.diesign-grid-overlay {
    width: 100%;
    height: 100%;
    padding: 85px 30px 30px 30px; 
    box-sizing: border-box;
    display: flex;
}

#diesign-grid {
    width: 100%;
    height: 100%;
    overflow-y: auto !important;
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    grid-auto-rows: min-content;           
    gap: 20px;                             
    box-sizing: border-box;
    padding-right: 5px;                    
}

.diesign-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; 
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #111;
}

.diesign-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: brightness(0.7);
}

.diesign-item:hover img {
    transform: scale(1.03);
    filter: brightness(1);
}

.diesign-loading {
    grid-column: span 3;
    color: #666;
    font-size: 32px;
    letter-spacing: 3px;
    text-align: center;
    padding: 40px;
}

.diesign-fullview {
    position: fixed !important; 
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.98) !important;
    z-index: 10000 !important; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.diesign-fullview.active {
    opacity: 1;
    pointer-events: auto;
}

.diesign-fullview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}