

/*================ Дальше некритические стили, пока что тут будут, после в отдельном файле ==========================*/
/* ========== НЕКРИТИЧЕСКИЕ СТИЛИ ========== */
/* Загружаются после основной отрисовки страницы */

/* ========== БЛОК ТАРИФОВ ========== */
.tariffs-block .tariffs-container {
    background: #F0F0F0;
    padding: 30px 0;
    border-radius: var(--border-radius);
    margin: 30px 0;
    text-align: left;
}

.tariffs-header {
    text-align: center;
    margin-bottom: 25px;
}

.tariffs-header h2 {
    color: var(--primary);
    font-size: 2em;
    margin: 0 0 25px;
}

.tariffs-note {
    margin-top: 20px;
    margin-left: 20px;
    background: #f8fff8;
    padding: 12px;
    border-radius: 5px;
    border-left: 4px solid var(--primary);
}

.tariffs-note p {
    margin: 0;
    font-size: 1.0em;
}

.tariffs-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 40px 0;
    justify-content: center;
}

.tariff-card {
    background: var(--white);
    border-radius: 15px;
    padding: 25px 15px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    border: 2px solid rgba(244,107,108,0.2);
    transition: all 0.3s ease;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex: 0 1 200px;
	min-height: 230px; /* Примерная высота карточки тарифа */
}

.tariff-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(244,107,108,0.15);
}

.tariff-card.popular {
    border: 2px solid var(--primary);
    box-shadow: 0 5px 10px rgba(244,107,108,0.2);
}

.popular-badge {
    position: absolute;
    top: 15px;
    right: -39px;
    background: var(--primary);
    color: white;
    padding: 5px 30px;
    transform: rotate(45deg);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tariff-name {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-dark);
    margin: 15px 0 10px;
}

.tariff-price {
    font-size: 2.0rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1;
    margin: 10px 0 5px;
}










/* ========== БЛОК ФОРМЫ ЗАКАЗА ========== */
.order-form-container {
    position: sticky;
    top: 20px;
    z-index: 100;
    background: #FFD9D9;
    border-radius: var(--border-radius);
    padding: 30px 0;
    margin: 30px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.order-form-title {
    color: var(--primary);
    font-size: 1.8em;
    margin: 0 0 10px;
}

.order-form-subtitle {
    color: var(--text-light);
    font-size: 1.2em;
    margin: 0 0 25px;
}

.order-buttons-block {
    border-radius: 10px;
    padding: 0 0 20px 0;
    margin: 0;
    width: 100%;
}

.order-buttons-block .buttons__flex {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 0 15px;
}

.order-buttons-block .buttons__button {
    cursor: pointer;
    color: var(--primary);
    background: #fff;
    border-radius: 7px;
    height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    border: 2px solid var(--primary);
    font-size: 120%;
    transition: all 0.3s;
    box-sizing: border-box;
    text-decoration: none;
    min-width: 200px;
}

.order-buttons-block .buttons__button:hover {
    background-color: var(--primary-light);
}

.order-buttons-block .buttons__button.phone-button {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
}

.order-buttons-block .buttons__button.phone-button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ========== БЛОК КАРТЫ ========== */
.map-block .map-container {
    background: #f5f5f5;
    padding: 30px 20px;
    border-radius: var(--border-radius);
    margin: 30px 0;
    text-align: center;
}

.map-header {
    text-align: center;
    margin-bottom: 30px;
}

.map-title {
    color: #444;
    font-size: 2em;
    margin: 0 0 10px;
}

.map-subtitle {
    color: var(--text-light);
    margin: 0;
}

.map-wrapper {
    background: white;
    border-radius: var(--border-radius);
    padding: 10px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    width: 100%;
    box-sizing: border-box;
}

#map {
    width: 100%;
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
}

.map-balloon {
    padding: 15px;
    max-width: 250px;
}

.map-balloon h3 {
    color: #F46B6C;
    margin: 0 0 10px;
    font-size: 18px;
}

.map-balloon p {
    margin: 5px 0;
    color: #333;
}

/* Адаптивность карты */
@media (max-width: 600px) {
    #map { 
        height: 350px; 
    }
    
    .map-block .map-container {
        padding: 20px 5px;
    }
}


/* ========== БЛОК ДВОЙНОЙ КАРТОЧКИ РАЙОНА ========== */

.district-description-block {
    width: 100%;
	
    margin: 40px auto; /* Отступ между блоками районов */
	box-sizing: border-box;
	padding: 0;
}

/* Контейнер внутри блока района, который держит весь контент */
.district-description-container {
    background: #F0F0F0;  /* СЕРЫЙ ФОН, КАК У ПРЕИМУЩЕСТВ */
    padding: 30px 20px;   /* Внутренние отступы, чтобы контент не прилипал к краям */
    border-radius: var(--border-radius); /* Скругление углов */
	width: 100%;
	box-sizing: border-box;
}

.district-double-header {
    text-align: left;
    margin-bottom: 20px;
    padding-bottom: 10px;
    
}

.district-double-header h2 {
    color: var(--primary);
    font-size: 2em;
    margin: 0;
	padding-left: 20px;
}

.district-double-offices {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.district-single-office {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid #eee;
}

.district-single-office .district-text-column {
    flex: 1 1 60%;
    min-width: 250px;
}

.district-single-office .district-gallery-column {
    flex: 0 0 35%;
    max-width: 350px;
    margin-left: auto;
}

.district-office-title {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--primary-dark);
    margin: 0 0 15px 0;
    padding-bottom: 5px;
    
}

.district-single-office .district-office-address,
.district-single-office .district-office-description,
.district-single-office .district-tax-office,
.district-single-office .district-fszn-office {
    margin: 0;
    font-size: 1.0em;
    line-height: 1.6;
}

.district-single-office .district-tax-office,
.district-single-office .district-fszn-office {
    margin-top: 15px;
}

/* ========== ГАЛЕРЕЯ (ОБЩИЕ СТИЛИ) ========== */
.district-gallery-wrapper {
    width: 100%;
	max-width: 400px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.gallery-slider {
    display: flex;
    transition: transform 0.3s ease;
    width: 100%;
}

.gallery-image {
    width: 100%;
    height: auto;
    flex-shrink: 0;
    display: block;
	aspect-ratio: attr(width) / attr(height);
    object-fit: cover; 
}

/* Стрелки галереи - без !important */
.district-gallery-wrapper .gallery-nav {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    text-shadow: none;
    color: #777;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    font-size: 67px;
    font-weight: 200;
    line-height: 0.8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    text-decoration: none;
    opacity: 0.7;
}

.district-gallery-wrapper .gallery-nav:hover {
    color: #eeeeee;
    opacity: 0.9;
    transform: translateY(-50%) scale(1.1);
}

.district-gallery-wrapper .gallery-prev {
    left: 10px;
    right: auto;
}

.district-gallery-wrapper .gallery-next {
    right: 10px;
    left: auto;
}

/* Точки галереи */
.district-gallery-wrapper .gallery-dots {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    z-index: 15;
    padding: 5px 0;
}

.district-gallery-wrapper .gallery-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.district-gallery-wrapper .gallery-dot:hover {
    transform: scale(1.2);
}

.district-gallery-wrapper .gallery-dot.active {
    background-color: var(--primary);
}

/* ========== БЛОК НАВИГАЦИИ ПО РАЙОНАМ ========== */
.district-nav-block {
    width: 100%;
    margin: 40px 0;
}

.district-nav-container {
    background: #f9f9f9;
    padding: 30px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.district-nav-header {
    text-align: center;
    margin-bottom: 25px;
}

.district-nav-header h2 {
    color: var(--primary);
    font-size: 2em;
    margin: 0 0 10px;
}

.district-nav-header p {
    color: var(--text-light);
    font-size: 1.1em;
}

.district-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
}

.district-nav-btn {
    background: #e0e0e0;
    border: none;
    border-radius: 20px;
    padding: 12px 20px;
    min-width: 140px;
    min-height: 48px;
    font-size: 0.95em;
    font-weight: 700;
    color: #8B0000;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.district-nav-btn:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(244,107,108,0.2);
}

.district-nav-btn.active {
    background: #F5BFBF;
    color: white;
    box-shadow: 0 4px 10px rgba(244,107,108,0.3);
}

/* ========== МОДАЛЬНОЕ ОКНО ЗАКАЗА ========== */


.modal__wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.modal__body {
    overflow-y: auto;
    position: relative;
    margin: 0 12px;
    max-height: 100%;
    width: 100%;
    max-width: 600px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.modal__body::-webkit-scrollbar {
    display: none;
}

.modal__inner {
    display: flex;
    flex-direction: column;
    background: var(--primary);
    width: 100%;
    padding: 42px 12px;
    align-items: center;
    text-align: center;
    border-radius: var(--border-radius);
    position: relative;
    margin: 60px 0;
    color: black;
}

.modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    cursor: pointer;
    font-size: 14px;
    color: #FFFFFF;
}

.modal__close:hover {
    font-size: 120%;
}

.modal__title {
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    margin-bottom: -20px;
    margin-top: 0;
    color: #FFFFFF;
}

#grad {
    width: 100%;
}

#sendbutt {
    padding: 0;
    margin: 20px 0 -50px;
}

/* ========== МОДАЛЬНОЕ ОКНО РАЙОНА ========== */
.district-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100000;
    overflow-y: auto;
}

.district-modal.active {
    display: block;
}

.district-modal-content {
    position: relative;
    width: 95%;
    max-width: 1200px;
    margin: 2.5% auto;
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-sizing: border-box;
}

.district-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    cursor: pointer;
    color: #F46B6C;
    z-index: 100002;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.district-modal-close:hover {
    color: #FFFFFF;
    transform: scale(1.1);
    background: #F5BFBF;
}

.district-modal-flex {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-top: 20px;
}

.district-modal-text {
    flex: 1;
    min-width: 300px;
}

.district-modal-text h2 {
    color: #F46B6C;
    font-size: 2.2em;
    margin: 0 0 20px 0;
	text-align: left;     
    padding-left: 20px;    
}

.district-modal-info {
    background: #f5f5f5;
    padding: 25px;
    border-radius: 15px;
    margin: 25px 0;
}

.district-modal-info p {
    margin: 12px 0;
    font-size: 1.1em;
    line-height: 1.5;
}

.district-modal-gallery {
    width: 400px;
    flex-shrink: 0;
}

.district-modal-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0 10px;
    flex-wrap: wrap;
}

.district-modal-btn {
    cursor: pointer;
    border-radius: 7px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 30px;
    font-size: 1.2em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    text-decoration: none;
    min-width: 200px;
    border: 1px solid #F46B6C;
    background: #FFFFFF;
    color: #F46B6C;
}

.district-modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(244,107,108,0.3);
    background: #F5BFBF;
    border-color: #F5BFBF;
}

/* ========== БЛОК ПОЛЕЗНЫХ МАТЕРИАЛОВ ========== */
.seo-container a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary);
}

.seo-container a:hover {
    color: var(--primary-dark);
    border-bottom-style: solid;
}





/* МЕДИА-ЗАПРОСЫ - ОБЪЕДИНЕННЫЕ */
@media screen and (max-width: 1024px) {
    .district-nav-btn {
        min-width: 100px;
        padding: 10px 15px;
        font-size: 0.9em;
    }
}

@media screen and (max-width: 968px) {
    .district-modal-flex {
        flex-direction: column-reverse;
        gap: 30px;
    }
    
    .district-modal-gallery {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
    
}


@media screen and (max-width: 768px) {
    /* Общие */
    
	
    
    .tariffs-flex { 
        gap: 35px; 
    }
    
    .tariff-card { 
        flex: 0 1 70%; 
        max-width: 80%; 
		min-height: 150px;
    }
    
    .order-buttons-block .buttons__flex {
        flex-direction: column;
        gap: 15px;
    }
    
    .order-buttons-block .buttons__button {
        width: 100%;
        max-width: 280px;
        min-width: unset;
        margin: 0 auto;
    }
    
    .district-gallery-wrapper {
        margin: 0 auto 20px;
        width: 100%;
        max-width: 400px;
    }
    
    .district-gallery-wrapper .gallery-nav {
        font-size: 78px;
        width: 39px;
        height: 39px;
    }
    
    .tariffs-header h2,
    .map-title,
    .district-double-header h2  {
        font-size: 2.0em;

    }
    
    .order-form-title {
        font-size: 1.6em;
    }
    
    .district-single-office {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .district-single-office .district-text-column,
    .district-single-office .district-gallery-column {
        width: 100%;
        flex-basis: auto;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .district-nav-container {
        padding: 20px 5px;
        border-radius: 15px;
    }
    
    .district-nav-buttons {
        gap: 6px;
    }
    
    .district-nav-btn {
        min-width: calc(50% - 6px);
        white-space: normal;
        padding: 12px 5px;
        min-height: 50px;
    }
    
    .seo-container {
        padding: 20px 15px !important;
    }
    
    .seo-container div[style*="display: flex"] {
        flex-direction: column;
        align-items: stretch;
    }
    
    .seo-container a[target="_blank"] {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .modal__body {
        width: 95%;
        margin: 0 10px;
    }
    
    .modal__inner {
        margin: 30px 0;
        padding: 32px 12px;
    }
    
    .district-modal-content {
        width: 98%;
        margin: 1% auto;
        padding: 20px 15px;
    }
    
    .district-modal-close {
        top: 10px;
        right: 15px;
        font-size: 35px;
        width: 40px;
        height: 40px;
    }
    
    .district-modal-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .district-modal-btn {
        width: 100%;
        max-width: 280px;
    }
	
	
 }	
	
	
	
@media screen and (max-width: 480px) {
    
	
    
    .tariffs-header h2,
    .map-title,
    .district-double-header h2  {
        font-size: 1.8em;
    }
    
    .order-form-title {
        font-size: 1.4em;
    }
    
    .order-buttons-block .buttons__button {
        max-width: 100%;
        font-size: 110%;
    }
    
    .district-gallery-wrapper {
        max-width: 100%;
    }
    
    .district-nav-container {
        padding: 15px 3px;
        border-radius: 12px;
    }
    
    .district-nav-btn {
        min-width: calc(50% - 6px);
        padding: 10px 3px;
        font-size: 0.85em;
        min-height: 45px;
    }
    
    .district-nav-header h2 {
        font-size: 1.4em;
        margin-bottom: 5px;
    }
    
    .district-nav-header p {
        font-size: 0.9em;
    }
	
	.tariff-card {
        min-height: 80px;   /* Для мобильных (по твоим замерам) */
    }
}


/* ========== ИСПРАВЛЕНИЕ ДЛЯ FIREFOX НА МОБИЛЬНЫХ ========== */

@-moz-document url-prefix() {
     @media screen and (max-width: 768px) {
        .district-single-office .district-text-column,
        .district-single-office .district-info,
        .district-single-office p,
        .district-office-address,
        .district-office-description,
        .district-tax-office,
        .district-fszn-office,
        .district-office-title {
            overflow-wrap: break-word !important;
            word-wrap: break-word !important;
            white-space: normal !important;
            max-width: 100% !important;
            width: 100% !important;
            box-sizing: border-box !important;
			flex: 0 0 100% !important;
			max-width: 100% !important;
			min-width: 0 !important;
        }
      }
    }



/* Добавьте это: */
#sidebar .toggle {
    position: relative;
}

#sidebar .toggle:before {
    display: none; /* Отключаем иконку из шрифта */
}

#sidebar .toggle:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 20px;
    background: linear-gradient(
        to bottom,
        #F46B6C 0%, #F46B6C 20%,
        transparent 20%, transparent 40%,
        #F46B6C 40%, #F46B6C 60%,
        transparent 60%, transparent 80%,
        #F46B6C 80%, #F46B6C 100%
    );
}







/* ========== СТИЛИ ДЛЯ НОВОЙ ЗЕЛЕНОЙ КАРТОЧКИ ========== */
.tariff-card.tariff-new {
    border: 2px solid #4CAF50; /* Зеленая обводка */
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3); /* Зеленая тень */
    position: relative;
    overflow: visible; /* Чтобы надпись не обрезалась */
    background: #ffffff;
}

/* Бейдж (надпись) "новым клиентам" */
.tariff-card.tariff-new .new-client-badge {
    position: absolute;
    top: -10px; /* Выдвигаем вверх за границы карточки */
    left: 50%; /* Сдвигаем начало элемента на 50% от родителя */
    transform: translateX(-50%); /* Сдвигаем сам элемент на половину его ширины влево, чтобы центрировать */
    background-color: #4CAF50; /* Зеленый фон */
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 15px;
    border-radius: 20px; /* Скругленные края */
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    white-space: nowrap;
}

/* Небольшая доработка для мобильных версий, чтобы бейдж не уезжал */
@media screen and (max-width: 768px) {
    .tariff-card.tariff-new .new-client-badge {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}


/* ========== ИСПРАВЛЕНИЕ ШИРИНЫ БЛОКОВ РАЙОНОВ ========== */
.district-description-block {
    width: 100%;
          /* max-width: 1400px;  Ограничиваем максимальную ширину */
    margin-left: auto;       /* Центрируем */
    margin-right: auto;      /* Центрируем */
    box-sizing: border-box;
}

