/* ========== ОСНОВНЫЕ СТИЛИ ========== */
:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #7209b7;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --orange-gradient: linear-gradient(to bottom, #474746, #e09109);
    --border-radius: 12px;
    --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    overflow-x: hidden; /* Предотвращаем горизонтальный скролл */
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 50%;
    width: 200px;
    height: 200px;
    object-fit: cover; /* Сохраняем пропорции */
}

/* ========== ШАПКА ========== */
header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--orange-gradient);
    border-bottom: 1px solid #ccc;
    flex-wrap: wrap;
    gap: 15px;
}

.logo img {
    width: 150px;
    height: 150px;
}

.navigating {
    display: flex;
    gap: 10px;
    margin-right: 0;
    flex-wrap: wrap;
    justify-content: center;
}

li {
    list-style: none;
}

a {
    margin: 0 8px;
    text-decoration: none;
    color: #191a19;
    font-size: 1.2rem;
    font-weight: 700;
    transition: var(--transition);
    white-space: nowrap;
}

a:hover {
    color: #303130;
}

/* ========== ГЕРОЙ СЕКЦИЯ ========== */
.hero {
    box-sizing: border-box;
    background: linear-gradient(to top, #474746, #e09109);
    padding: 30px 15px;
    text-align: center;
    position: relative;
}

video {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

/* ========== УСЛУГИ ========== */
#services {
    font-size: 1.2em;
    background: var(--orange-gradient);
    padding: 40px 15px;
    text-align: center;
}

.flip {
    perspective: 800px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.services .cards {
    margin-top: 20px;
}

.card {
    box-sizing: border-box;
    width: 100%;
    max-width: 350px;
    height: 250px;
    position: relative;
    background: #d6cbc1;
    padding: 20px;
    border: 1px solid #8b8da7;
    border-bottom-left-radius: 41px;
    transition: transform 1s;
    transform-style: preserve-3d;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    margin: 0 auto 20px;
}

.card:hover {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    backface-visibility: hidden;
    font: 16px/1.5 Arial;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.card-face.back {
    transform: rotateY(180deg);
    background: #dadbcf;
    color: #080808;
    font-size: 14px;
    overflow-y: auto;
}

.card p {
    margin: 0;
}

/* ========== ИНФО БЛОК ========== */
.info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.image {
    flex: 1;
    min-width: 300px;
    height: 400px;
    background-image: url(https://img.freepik.com/premium-vector/diverse-people-working-office_1166262-43.jpg?semt=ais_hybrid&w=740);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border-radius: 10px;
}

/* ========== FOOTER ========== */
footer {
    width: 100%;
    background: var(--orange-gradient);
    padding: 40px 20px;
}

#footer {
    width: 100%;
    background: #2c3e50;
    color: #ecf0f1;
    padding: 40px 20px 20px;
    margin-top: 50px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section {
    padding: 15px;
}

.footer-section h3 {
    color: #3498db;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.contact-info p {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.contact-info a {
    color: #3498db;
    text-decoration: none;
    word-break: break-word;
}

.social-links {
    margin-top: 20px;
}

.social-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #0088cc;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.connection p {
    margin-left: 20px;
    font-weight: 700;
}

.connection p::first-letter {
    font-size: 2em;
    color: red;
}

.contacts_form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-right: 0;
    width: 100%;
}

.callback-form input,
.callback-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #34495e;
    border-radius: 5px;
    background: #34495e;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    font-size: 14px;
}

/* ========== ОСНОВНОЙ КОНТЕЙНЕР ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* ========== ШАПКА СТРАНИЦЫ ========== */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.header h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    margin-bottom: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: var(--gray-color);
}

/* ========== СТАТИСТИКА ========== */
.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    min-width: 120px;
    flex: 1 1 120px;
}

.stat-number {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-color);
}

/* ========== ФОРМА ========== */
.add-review-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
}

.review-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.stars {
    display: flex;
    gap: 5px;
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    flex-wrap: wrap;
    justify-content: center;
}

/* ========== КОНТРОЛЫ ========== */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.filters, .sort {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 8px 12px;
    font-size: clamp(0.85rem, 2vw, 1rem);
    white-space: nowrap;
}

.sort-select {
    width: 100%;
    max-width: 200px;
    padding: 10px;
}

/* ========== ОТЗЫВЫ ========== */
.reviews-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.review-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    border-left: 4px solid var(--primary-color);
    position: relative;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.review-author {
    font-weight: 700;
    font-size: 1rem;
    word-break: break-word;
}

.review-date {
    font-size: 0.85rem;
}

.review-stars {
    font-size: 1.2rem;
}

.review-text {
    word-break: break-word;
    overflow-wrap: break-word;
}

.rating-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* ========== ПАГИНАЦИЯ ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 14px;
    min-width: 40px;
    font-size: 0.95rem;
}

/* ========== FAQ ========== */
.faq {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 30px;
}

.faq-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
}

.faq-question {
    font-size: 1rem;
}

/* ========== ИНФОРМАЦИЯ ========== */
.inform {
    font-size: clamp(11px, 3vw, 12px);
}

.inform p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

/* ========== МЕДИА ЗАПРОСЫ ========== */

/* Планшеты (до 768px) */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .navigating {
        justify-content: center;
        width: 100%;
    }

    a {
        font-size: 1rem;
        margin: 0 5px;
    }

    .logo img {
        width: 120px;
        height: 120px;
    }

    .card {
        max-width: 300px;
        height: 220px;
    }

    .card-face {
        font-size: 14px;
    }

    .info {
        flex-direction: column;
    }

    .image {
        min-width: auto;
        height: 300px;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }

    .footer-section {
        text-align: center;
    }

    .contact-info p {
        justify-content: center;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .sort {
        justify-content: center;
    }

    .sort-select {
        max-width: 100%;
    }

    .reviews-container {
        grid-template-columns: 1fr;
    }

    .stats {
        gap: 10px;
    }

    .stat-item {
        min-width: 100px;
    }
}

/* Мобильные телефоны (до 480px) */
@media (max-width: 480px) {
    header {
        padding: 10px;
    }

    .navigating {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    a {
        font-size: 1.1rem;
        white-space: normal;
    }

    .logo img {
        width: 100px;
        height: 100px;
    }

    .card {
        max-width: 100%;
        height: 200px;
    }

    .card-face {
        font-size: 13px;
        padding: 10px;
    }

    .image {
        height: 200px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .form-group {
        flex: 1 1 100%;
    }

    .filter-buttons {
        justify-content: center;
    }

    .filter-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .star {
        font-size: 1.8rem;
    }

    .review-card {
        padding: 15px;
    }

    .rating-badge {
        position: static;
        display: inline-block;
        margin-bottom: 10px;
    }

    .review-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-section {
        padding: 10px;
    }

    .footer-section h3 {
        font-size: 1.1rem;
    }

    .contact-info p {
        font-size: 0.9rem;
    }

    .social-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .submit-btn {
        padding: 10px;
        font-size: 0.95rem;
    }

    .page-btn {
        padding: 6px 10px;
        min-width: 35px;
        font-size: 0.85rem;
    }
}

/* Маленькие телефоны (до 320px) */
@media (max-width: 320px) {
    .logo img {
        width: 80px;
        height: 80px;
    }

    a {
        font-size: 0.95rem;
    }

    .card {
        height: 180px;
    }

    .card-face {
        font-size: 12px;
    }

    .filter-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .star {
        font-size: 1.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}

/* Промежуточные размеры для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 20px;
    }

    .reviews-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .card {
        max-width: 300px;
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Промежуточные размеры для больших планшетов */
@media (min-width: 1025px) and (max-width: 1200px) {
    .container {
        max-width: 960px;
    }

    .reviews-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========== ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ ========== */
.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
}

/* ========== АНИМАЦИИ ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.review-card {
    animation: fadeIn 0.5s ease-out;
}

/* ========== УТИЛИТЫ ДЛЯ ТЕКСТА ========== */
.word-break {
    word-break: break-word;
    overflow-wrap: break-word;
}

.no-wrap {
    white-space: nowrap;
}

@media (max-width: 480px) {
    .no-wrap {
        white-space: normal;
    }
}