* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    background: url('bg.jpg') center/cover fixed; 
    color: white; 
    font-family: 'Segoe UI', Tahoma, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ★ ДЕСКТОП ★ */
.main-container { display: flex; min-height: calc(100vh - 120px); }
.sidebar {
    width: 300px; background: rgba(0,0,0,0.92); padding: 20px; 
    backdrop-filter: blur(15px); border-right: 1px solid rgba(255,255,255,0.15);
    position: fixed; height: calc(100vh - 120px); overflow-y: auto; z-index: 100;
}
.content { margin-left: 300px; flex: 1; padding: 20px 20px 20px 40px; }
.container { max-width: 1100px; margin: 0 auto; width: 100%; }

.header { text-align: center; background: rgba(0,0,0,0.92); padding: 30px 20px; backdrop-filter: blur(15px); }
.header h1 { font-size: 32px; margin-bottom: 5px; }
.header p { font-size: 18px; opacity: 0.9; }

#categories-menu { margin-top: 20px; }
.category-item {
    background: rgba(0,0,0,0.8); margin: 10px 0; padding: 18px; border-radius: 12px; 
    cursor: pointer; transition: all 0.3s; border: 2px solid rgba(255,255,255,0.1);
    font-size: 16px; font-weight: 600; text-align: center;
}
.category-item:hover, .category-item.active {
    background: rgba(76,175,80,0.25); transform: translateX(5px); 
    box-shadow: 0 8px 25px rgba(76,175,80,0.4); border-color: #4CAF50;
}

.door-type { background: rgba(0,0,0,0.88); margin: 25px 0; padding: 30px; 
    border-radius: 20px; backdrop-filter: blur(10px); border: 2px solid rgba(255,255,255,0.12);
    transition: all 0.3s; text-align: center; cursor: pointer;
}
.door-type:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.6); }
.door-type h2 { color: #4CAF50; font-size: 28px; margin-bottom: 25px; font-weight: bold; }
.door-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.door-photo { width: 100%; height: 220px; object-fit: cover; border-radius: 15px; 
    cursor: pointer; transition: all 0.3s; border: 3px solid transparent;
}
.door-photo:hover { transform: scale(1.05); border-color: #4CAF50; box-shadow: 0 15px 35px rgba(76,175,80,0.4); }

/* ★ МОДАЛЬНЫЕ ОКНА ★ */
.modal-overlay { 
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.98); z-index: 10000; 
    justify-content: center; align-items: center; padding: 10px;
}
.modal-content { 
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d); 
    width: 95%; max-width: 900px; max-height: 90vh; 
    padding: 30px; border-radius: 20px; position: relative; 
    overflow-y: auto; border: 2px solid rgba(255,255,255,0.1);
}
.close { position: absolute; top: 15px; right: 20px; color: #ff4444; 
    font-size: 30px; cursor: pointer; font-weight: bold; z-index: 10001;
}
.close:hover { color: #ff6666; transform: scale(1.1); }
.modal-title { color: #4CAF50; font-size: 24px; margin-bottom: 25px; text-align: center; }
.modal-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.modal-photo { width: 100%; height: 240px; object-fit: cover; border-radius: 15px; 
    cursor: pointer; transition: all 0.3s; border: 2px solid transparent;
}
.modal-photo:hover { transform: scale(1.02); border-color: #4CAF50; }

/* ★ PHOTOLIGHTBOX ★ */
#photo-lightbox { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.98); z-index: 10002; 
    display: flex; justify-content: center; align-items: center; padding: 10px;
}
#photo-lightbox img { 
    max-width: 95%; max-height: 90vh; border-radius: 10px; 
    box-shadow: 0 20px 60px rgba(0,0,0,0.9);
}
.lightbox-nav { 
    position: absolute; top: 50%; transform: translateY(-50%); 
    background: rgba(76,175,80,0.9); color: white; border: none; 
    width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
    font-size: 20px; display: flex; align-items: center; justify-content: center;
}
.prev-btn { left: 20px; }
.next-btn { right: 20px; }
.lightbox-counter { 
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    color: white; font-size: 18px; background: rgba(0,0,0,0.7); padding: 10px 20px;
    border-radius: 20px;
}

.loading { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); 
    background: rgba(0,0,0,0.97); color: white; padding: 40px; border-radius: 20px; 
    z-index: 10001; text-align: center; display: none;
}
.spinner { border: 5px solid rgba(255,255,255,0.3); border-top: 5px solid #4CAF50; 
    border-radius: 50%; width: 60px; height: 60px; animation: spin 1s linear infinite; 
    margin: 0 auto 20px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ★ ПЛАНШЕТ ★ */
@media (max-width: 1024px) {
    .sidebar { width: 260px; }
    .content { margin-left: 260px; padding: 20px 20px 20px 30px; }
}

/* ★ МОБИЛЬНЫЕ ★ */
@media (max-width: 768px) { 
    .header { padding: 25px 15px; }
    .header h1 { font-size: 26px; }
    .header p { font-size: 16px; }
    
    .main-container { flex-direction: column; }
    .sidebar { 
        width: 100%; position: static; height: auto; order: 1; 
        border-right: none; border-bottom: 2px solid rgba(255,255,255,0.2);
        padding: 20px 15px; max-height: 250px;
    }
    .content { margin-left: 0; order: 2; padding: 15px; }
    
    .category-item { margin: 8px 0; padding: 15px; font-size: 16px; }
    .door-type { margin: 20px 0; padding: 25px 20px; }
    .door-type h2 { font-size: 22px; margin-bottom: 20px; }
    .door-photos { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
    .door-photo { height: 180px; }
    
    .modal-content { width: 98%; padding: 25px 15px; max-height: 85vh; }
    .modal-title { font-size: 20px; }
    .modal-photos { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 15px; }
    .modal-photo { height: 180px; }
    .close { font-size: 28px; top: 10px; right: 15px; }
}

/* ★ МАЛЕНЬКИЕ МОБИЛЬНЫЕ ★ */
@media (max-width: 480px) { 
    .header h1 { font-size: 22px; }
    .header p { font-size: 14px; }
    
    .category-item { padding: 12px 10px; font-size: 15px; margin: 6px 0; }
    .door-type { padding: 20px 15px; }
    .door-type h2 { font-size: 20px; }
    .door-photos { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .door-photo { height: 140px; }
    
    .modal-photos { grid-template-columns: 1fr; gap: 12px; }
    .modal-photo { height: 250px; }
    .modal-content { padding: 20px 10px; margin: 5px; }
}

/* ★ Lightbox на мобильных ★ */
@media (max-width: 768px) {
    #photo-lightbox img { max-height: 85vh !important; }
    .lightbox-nav { width: 40px; height: 40px; font-size: 16px; }
    .prev-btn { left: 10px; }
    .next-btn { right: 10px; }
}
