:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --success: #27ae60;
    --warning: #f39c12;
    --text: #34495e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text);
    line-height: 1.6;
}

.wrapper {
    display: flex;
    flex: 1;
    position: relative;
    min-height: calc(100vh - 140px);
}

/* Шапка */
.page-header {
    display: grid;
    place-items: center;
    align-items: center;
    background-image: url("https://4f267ac3-df8d-4c1e-a7b5-da5d95a9ecd1.selstorage.ru/school1.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;;
    height: 300px;
    padding: 15px 30px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

.page-header h1 {
    color: #15066a;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    padding: 15px 30px;
    border-radius: 10px;
}

.header-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

/* Боковое меню */
.sidebar {
    width: auto;
    background: linear-gradient(180deg, var(--secondary) 0%, #2980b9 100%);
    padding: 25px 20px;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 90;
}

.sidebar.collapsed {
    width: 0;
    padding: 25px 0;
    overflow: hidden;
}

.sidebar h2 {
    color: white;
    text-align: center;
    padding-bottom: 15px;
    white-space: nowrap;
    margin: 0 0 25px 0;
    font-size: 22px;
    font-weight: 600;
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin: 12px 0;
    white-space: nowrap;
}

.sidebar a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    display: block;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.sidebar a:hover::before {
    left: 100%;
}

.sidebar a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.submenu {
    margin-left: 20px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.submenu li {
    margin: 8px 0;
}

.submenu a {
    font-weight: normal;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
}

.submenu a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.has-submenu > a::after {
    content: " ▼";
    font-size: 0.7em;
    margin-left: 5px;
}

.has-submenu.active > a::after {
    content: " ▲";
}

/* Основное содержимое */
.main-content {
    flex: 1;
    padding: 40px;
    background-color: white;
    transition: margin-left 0.3s ease;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
}

.main-content h1 {
    color: var(--primary);
    border-bottom: 3px solid var(--secondary);
    padding-bottom: 15px;
    margin-bottom: 30px;
    font-size: 32px;
    font-weight: 700;
    text-align: center;
}

.main-content h2 {
    color: var(--secondary);
    margin: 25px 0 15px;
    font-size: 24px;
    font-weight: 600;
}

/* Карточки */
.card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-left: 5px solid var(--secondary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card h2 {
    color: var(--primary);
    margin-top: 0;
    font-size: 22px;
}

.card h3 {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 1.6em;
}

.card h4 {
    color: #3498db;
    margin-bottom: 20px;
    font-size: 1.6em;
}

.card h5 {
    color: #e8cb12;
    margin-bottom: 20px;
    font-size: 1.6em;
}

.card p {
    margin: 0;
    line-height: 1.6;
    font-size: 1.1em;
}

.card p1 {
    font-size: 1.1em;
    line-height: 1.6;
    margin: 0;
}

.card h5 {
    color: #eed12a;
    margin-bottom: 20px;
    font-size: 1.6em;
}

.card h6 {
    color: #2eaef4;
    margin-bottom: 20px;
    font-size: 1.6em;
}

/* Галерея изображений */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.photo-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    height: fit-content;
    cursor: pointer;
    z-index: 999;
}

.photo-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.photo-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    background: white;
    min-height: 200px;
    max-height: 300px;
}

.photo-caption {
    background: rgba(44, 62, 80, 0.9);
    color: white;
    padding: 12px;
    font-size: 14px;
    text-align: center;
    margin-top: auto;
}

/* Подвал */
footer {
    text-align: center;
    padding: 20px;
    background: var(--primary);
    color: white;
    margin-top: auto;
    font-size: 14px;
}

/* Стили для мобильной кнопки меню */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--secondary);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.mobile-menu-toggle:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Ровный крестик для мобильной кнопки */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Специфические стили для страниц */
.auto_photo {
    width: 100%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    display: block;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 40px auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--secondary);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    width: 50%;
    padding: 20px;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 20px;
    width: 20px;
    height: 20px;
    background: var(--secondary);
    border-radius: 50%;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -10px;
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -10px;
}

/* Стили для форм */
.contact-form {
    max-width: 600px;
    margin: 30px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.submit-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: var(--primary);
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

.fade-in h2 {
    text-align: center;
    margin-top: 50px;
    color: #1e3c72;
}

/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 1% auto;
    padding: 30px;
    width: 95%;
    max-width: 1200px;
    min-height: 300px;
    border-radius: 12px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-picture {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
    text-align: center;

}

.modal-image-container {
    position: relative;
    overflow: hidden;
    cursor: grab;
    max-width: 400px;
    width: 40%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    flex-shrink: 0;
}

.BOB-content {
    margin-bottom: 40px;
    text-align: right;
}

.BOB-content h2 {
    text-align: right;
    color: #1e3c72;
    font-size: 1.8em;
    margin-bottom: 10px;
    font-weight: normal;
    font-style: italic;
}

.BOB-content h3 {
    text-align: right;
    color: #666;
    font-size: 1.2em;
    font-weight: normal;
    margin-bottom: 30px;
}

.SS-content {
    margin-bottom: 40px;
    text-align: right;
}

.SS-content h1 {
    color: #1e3c72;
    font-size: 1.8em;
    margin-bottom: 10px;
    font-weight: normal;
    font-style: italic;
}

.SS-content h2 strong1 {
    float: right;
    color: #f8e514;
    font-size: 1em;
    margin-bottom: 10px;
    font-weight: normal;
    font-style: italic;
}

.SS-content h2 strong {
    float: left;
    text-align: left;
    color: #979794;
    font-size: 1em;
    margin-bottom: 10px;
    font-weight: normal;
    font-style: italic;
}

.CBO-content {
    position: relative;
}

.CDO {
    float: left;
    margin: 0 30px 20px 0;
    width: 300px;
    text-align: center;
}

.CDO img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.CDO p {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
    font-style: normal;
}

.CKO p {
    font-size: 1em;
    line-height: 1.4;
    margin-bottom: 8px;
    font-style: italic;
    color: #2c3e50;
}

.CKO p1 {
    font-size: 0.9em;
    color: #377072;
    font-style: normal;
}
/* Фиксируем контейнер в верхнем правом углу */
.cube-container {
    position: absolute;
    top: 20px;     /* Отступ сверху */
    right: 20px;   /* Отступ справа */
    z-index: 9999; /* Чтобы куб был поверх всего контента */
}

/* Область ссылки и 3D-пространство (маленький размер) */
.cube-link {
    width: 50px;
    height: 50px;
    perspective: 400px;
    text-decoration: none;
    display: block;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s ease-in-out;
    /* Сразу немного наклоняем для объема */
    transform: rotateX(-20deg) rotateY(-20deg);
}

/* Вращение при наведении */
.cube-link:hover .cube {
    transform: rotateX(180deg) rotateY(360deg);
}

/* Общие стили черных граней */
.face {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #222 0%, #000 100%);
    border: 1px solid #444; /* Тонкие ребра */
    box-sizing: border-box;
}

/* Расстановка граней (половина от 50px = 25px) */
.front  { transform: translateZ(25px); }
.back   { transform: rotateY(180deg) translateZ(25px); }
.right  { transform: rotateY(90deg) translateZ(25px); }
.left   { transform: rotateY(-90deg) translateZ(25px); }
.top    { transform: rotateX(90deg) translateZ(25px); }
.bottom { transform: rotateX(-90deg) translateZ(25px); }


.modal-image {
    max-width: 40%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
    cursor: grab;
}
.modal-image.zoomed {
    cursor: grab;
}

.modal-image.dragging {
    cursor: grabbing;
}

.modal-text {
    flex: 1;
    padding: 15px;
    max-height: 80vh;
    overflow-y: auto;
    font-size: 1.1em;
    line-height: 1.8;
}

.modal-text h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 1.8em;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 10px;
}

.modal-text p {
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 1.05em;
    color: #444;
}

.modal-text strong {
    color: var(--primary);
    font-weight: 700;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    z-index: 10;
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.close:hover {
    color: #000;
    background: #f0f0f0;
    transform: scale(1.1);
}

/* Стили для центрированного заголовка */
.centered-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
}

.centered-header h1 {
    font-size: 2.2em;
    color: #1e3c72;
    margin-bottom: 15px;
    font-weight: 600;
}

.centered-header .subtitle {
    font-size: 1.3em;
    color: #555;
    font-weight: 500;
}

/* Стили для центрированного контента */
.centered-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    line-height: 1.7;
}

.centered-content p {
    margin-bottom: 40px;
    font-size: 1.2em;
    text-align: center;
    line-height: 1.8;
}

.centered-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 15px;
}

.sidebar-header h2 {
    margin: 0;
    color: white;
    font-size: 22px;
    font-weight: 600;
    white-space: nowrap;
}

/* Стили для кнопки переключения меню в сайдбаре */
.menu-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 5px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}
/* Контейнер для элементов управления zoom */
.zoom-controls-container {
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 15px;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 8px 8px;
    z-index: 100;
}

/* Кнопки управления zoom */
.zoom-controls {
    display: flex !important;
    gap: 8px;
    margin: 0 auto;
}
.zoom-btn {
    width: 40px;
    height: 40px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* Индикатор zoom */
.zoom-indicator {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: none;
}

/* Кнопка сброса */
.reset-zoom-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.reset-zoom-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.menu-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
}

/* Состояние по умолчанию (свернутое меню) - три горизонтальные линии */
.menu-toggle span:nth-child(1) {
    transform: none;
}

.menu-toggle span:nth-child(2) {
    transform: none;
}

.menu-toggle span:nth-child(3) {
    transform: none;
}

/* Анимация кнопки при развернутом меню - ровный крестик */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -1px;
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -1px;
}

/* Стили для свернутого меню */
.sidebar.collapsed {
    width: 60px;
    padding: 25px 10px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding-bottom: 10px;
}

.sidebar.collapsed .sidebar-header h2 {
    display: none;
}

.sidebar.collapsed ul {
    display: none;
}

.sidebar.collapsed .menu-toggle {
    margin: 0 auto;
}

/* Адаптивность */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        height: 100%;
        z-index: 10;
        width: 280px;
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .main-content {
        padding: 20px;
        margin-left: 0 !important;
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
        margin: 20px 0;
    }
    .photo-item img {
        min-height: 150px;
        max-height: 250px;
    }

    .header-title {
        font-size: 22px;
    }

    /* Показываем кнопку только на мобильных устройствах */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Корректируем отступы для шапки при наличии кнопки */
    .page-header {
        padding-left: 80px;
    }

    /* Скрываем кнопку меню в сайдбаре на мобильных устройствах */
    .menu-toggle {
        display: none !important;
    }

    /* Убираем flex-распределение для заголовка на мобильных */
    .sidebar-header {
        display: block;
        text-align: center;
        padding-bottom: 15px;
        margin-bottom: 20px;
        border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    }

    .sidebar-header h2 {
        display: block !important;
        text-align: center;
        margin: 0;
    }

    /* Убираем отступы у сайдбара на мобильных */
    .sidebar {
        padding: 20px 15px;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 45px;
        height: 45px;
        top: 15px;
        left: 15px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(5px) rotate(45deg);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-5px) rotate(-45deg);
    }

    .sidebar {
        width: 260px;
        padding: 15px 10px;
    }

    /* Адаптивность для модального окна на мобильных */
    .modal-content {
        flex-direction: column;
        margin: 2% auto;
        width: 95%;
        padding: 20px;
        gap: 20px;
    }

    .modal-image-container {
        max-width: 100%;
        width: 100%;
        height: 400px;
    }

    .modal-image {
        max-height: 380px;
    }

    .modal-text {
        max-height: 60vh;
        padding: 10px;
        font-size: 1em;
    }

    .modal-text h3 {
        font-size: 1.5em;
    }

    /* Адаптивность для элементов управления zoom на мобильных */
    .zoom-controls-container {
        padding: 8px 12px;
    }

    .zoom-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .reset-zoom-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .zoom-indicator {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 45px;
        height: 45px;
        top: 15px;
        left: 15px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(5px) rotate(45deg);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-5px) rotate(-45deg);
    }

    .sidebar {
        width: 260px;
        padding: 15px 10px;
    }

    .main-content {
        padding: 15px;
    }

    .photo-gallery {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .photo-item img {
        min-height: 180px;
        max-height: 220px;
    }

    .modal-content {
        margin: 1% auto;
        width: 98%;
        padding: 15px;
    }

    .modal-text {
        font-size: 0.95em;
        line-height: 1.7;
    }

    .modal-text h3 {
        font-size: 1.3em;
    }

    /* Адаптивность для элементов управления zoom на очень маленьких экранах */
    .zoom-controls-container {
        padding: 6px 10px;
    }

    .zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .reset-zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .zoom-indicator {
        font-size: 10px;
        padding: 4px 8px;
    }

    .modal-image-container {
        height: 350px;
    }

    .modal-image {
        max-height: 330px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .modal-content {
        width: 98%;
        max-width: 900px;
        gap: 25px;
        padding: 25px;
    }

    .modal-image-container {
        max-width: 350px;
        width: 45%;
    }

    .modal-image {
        max-height: 450px;
    }
}

@media (max-width: 768px) and (max-height: 600px) {
    .modal-image-container {
        height: 300px;
    }

    .modal-image {
        max-height: 280px;
    }
}

/* Подсказки для кнопок (только для десктопа) */
@media (min-width: 769px) {
    .reset-zoom-btn::after {
        content: attr(title);
        position: absolute;
        bottom: -30px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 5px 10px;
        border-radius: 4px;
        font-size: 12px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 1000;
    }

    .reset-zoom-btn:hover::after {
        opacity: 1;
    }
}
