/* FILE: style.css
   PROJECT: Вільний Майстер Черкаси
*/

/* --- 1. ОСНОВНІ ПАРАМЕТРИ ТА ЗМІННІ --- */
:root {
    --primary: #2563eb;
    --accent: #f97316;
    --dark: #111827;
    --gray: #4b5563;
    --light: #f3f4f6;
    --success: #16a34a;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--dark);
    background: #fff;
    line-height: 1.6;
}

h1, h2, h3 { font-family: 'Manrope', sans-serif; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.section-padding { padding: 80px 0; }
.text-center { text-align: center; }
section { scroll-margin-top: 80px; }

/* --- 2. ШАПКА ТА НАВІГАЦІЯ --- */
header {
    background: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.4rem; font-weight: 800; color: var(--primary); text-decoration: none; z-index: 1001; }
.logo span { color: var(--accent); }

.nav-wrapper { display: flex; align-items: center; gap: 20px; }
.nav-menu { display: flex; gap: 20px; list-style: none; }
.nav-menu a { text-decoration: none; color: var(--dark); font-weight: 500; transition: 0.3s; }
.nav-menu a:hover { color: var(--primary); }


.lang-switcher { display: flex; gap: 10px; margin-left: 20px; font-weight: 700; font-size: 0.9rem; }
.lang-switcher a { text-decoration: none; color: var(--gray); padding: 2px 8px; border-radius: 4px; }
.lang-switcher a.active { color: #fff; background: var(--primary); }

.header-right { text-align: right; }
.phone-link { font-size: 1.2rem; font-weight: 700; color: var(--dark); text-decoration: none; }
.work-status { font-size: 0.8rem; color: var(--success); display: block; font-weight: 600; }

.burger { display: none; cursor: pointer; flex-direction: column; gap: 5px; z-index: 1001; background: none; border: none; padding: 5px; }
.burger span { width: 25px; height: 3px; background: var(--dark); border-radius: 3px; transition: 0.3s; }

/* --- 3. HERO СЕКЦІЯ ТА КНОПКИ --- */
.hero {
    color: white;
    padding: 100px 0 120px;
    background: linear-gradient(rgba(17, 24, 39, 0.8), rgba(17, 24, 39, 0.6)),
                 url('../images/master-on-call-cozy-apartment.webp') center/cover no-repeat;
    background-attachment: fixed;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 20px; line-height: 1.1; }
.hero p { font-size: 1.2rem; margin-bottom: 35px; opacity: 0.95; max-width: 650px; }

.cta-form { display: flex; flex-wrap: wrap; gap: 15px; max-width: 600px; }
.cta-form input { flex: 1; min-width: 250px; padding: 18px 25px; border-radius: 12px; border: none; font-size: 1rem; }

.btn { padding: 18px 35px; border-radius: 12px; font-weight: 700; cursor: pointer; transition: 0.3s; border: none; text-decoration: none; display: inline-block; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #ea580c; transform: translateY(-2px); }

.btn-telegram { background: #0088cc; color: white; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 18px 35px; border-radius: 12px; font-weight: 700; margin-top: 15px; }
.btn-telegram:hover { background: #0077b5; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 136, 204, 0.3); }
.tg-icon { width: 24px; height: 24px; fill: currentColor; }

/* --- 4. ПОСЛУГИ ТА ЦІНИ --- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 40px; }
.service-item { background: #fff; padding: 30px; border-radius: 20px; border: 1px solid #e5e7eb; transition: 0.3s; display: flex; flex-direction: column; gap: 15px; }
.service-item:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-5px); }
.service-icon { font-size: 2.5rem; background: var(--light); width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; border-radius: 15px; }
.price-badge { background:#dcfce7; color:var(--success); padding:5px 10px; border-radius:8px; width:fit-content; font-weight:700; }

.price-section { background: var(--light); }
.price-table-wrapper { overflow-x: auto; background: #fff; border-radius: 15px; box-shadow: var(--shadow); }
.price-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.price-table tr { border-bottom: 1px solid #eee; }
.price-table td { padding: 18px 25px; }
.price-table td:last-child { text-align: right; font-weight: 700; color: var(--primary); }
.price-table tr:hover { background: #f9fafb; }

/* --- 5. МОДАЛЬНІ ВІКНА ТА FAQ --- */
.faq-item { background: #fff; margin-bottom: 15px; border-radius: 12px; border: 1px solid #e5e7eb; padding: 20px; cursor: pointer; }
.faq-question { font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.faq-answer { margin-top: 10px; color: var(--gray); display: none; }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); z-index: 2000; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal-content { background: white; padding: 30px; border-radius: 20px; max-width: 400px; width: 100%; text-align: center; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2); }

/* --- 6. КУКІ-БАНЕР --- */
.cookie-overlay {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    
    /* Ефект матового скла */
    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border-radius: 12px;
    z-index: 10001;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

/* Налаштування для ПК (Desktop) */
@media (min-width: 768px) {
    .cookie-overlay {
        right: auto;
        width: 400px;
    }
}

.cookie-container {
    padding: 25px 20px 20px 20px; /* Трохи більше відступу зверху через смужку */
    position: relative;
    
    /* Центрування всього контенту всередині */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Контейнер смужки */
.cookie-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
}

/* Сама смужка заповнення на 5 секунд */
#cookie-progress-fill {
    height: 100%;
    width: 100%;
    background: #4caf50; /* Або var(--accent) */
    transform-origin: left;
    animation: cookie-timer 4s linear forwards;
}

@keyframes cookie-timer {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.cookie-text {
    font-size: 14px;
    margin-bottom: 20px;
    color: #222;
    line-height: 1.5;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    justify-content: center; /* Центрування кнопок */
    width: 100%;
}

.btn-cookie {
    flex: 1; /* Кнопки будуть однакової ширини */
    max-width: 150px; /* Обмежуємо ширину кнопок, щоб не були занадто довгими */
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: transform 0.2s, filter 0.2s;
}

.btn-cookie:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-accept {
    background: #4caf50;
    color: white;
}

.btn-reject {
    background: rgba(0, 0, 0, 0.08); /* Світла нейтральна кнопка */
    color: #444;
}

/* --- 7. ПЛАВАЮЧІ КНОПКИ --- */
.floating-call, .floating-tg { position: fixed; right: 25px; width: 65px; height: 65px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; z-index: 999; text-decoration: none; }
.floating-call { bottom: 30px; background: var(--accent); color: white; animation: pulse 2s infinite; display: none; }
.floating-tg { bottom: 110px; background: #0088cc; color: white; box-shadow: 0 10px 25px rgba(0, 136, 204, 0.4); transition: 0.3s; }
.floating-tg:hover { transform: scale(1.1); }

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(249,115,22,0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(249,115,22,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(249,115,22,0); }
}

/* --- 8. АДАПТИВНІСТЬ (MEDIA QUERIES) --- */
.mobile-view { display: none; }
.desktop-view { display: block; }

@media (max-width: 992px) {
    .nav-menu, .lang-switcher { display: none; }
    .burger { display: flex; }
    .nav-active {
        display: flex !important; flex-direction: column; position: fixed;
        top: 0; right: 0; bottom: 0; left: 0; background: white;
        padding-top: 100px; align-items: center; gap: 30px; font-size: 1.5rem; z-index: 1000;
    }
    .nav-active .lang-switcher { display: flex; margin-left: 0; background: var(--light); padding: 5px; border-radius: 10px; }
}


@media (max-width: 768px) {
    .hero { text-align: center; padding: 60px 0 80px; }
    .cta-form { flex-direction: column; }
    .header-right, .desktop-view { display: none; }
    .mobile-view, .floating-call { display: flex; }
    .floating-tg { width: 55px; height: 55px; bottom: 100px; right: 20px; font-size: 24px; }
    .floating-call { width: 55px; height: 55px; bottom: 30px; right: 20px; }
    
    .price-cards-mobile { flex-direction: column; gap: 10px; }
    .price-card-item { background: #fff; padding: 15px 20px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #e5e7eb; }
    .price-card-item strong { color: var(--primary); white-space: nowrap; }
}

@media (max-width: 600px) {
    .cookie-container { flex-direction: column; text-align: center; }
    .btn-cookie { width: 100%; }
}

/* =============================================
        Steps
    ============================================= */
    .steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; margin-top: 50px; }
    .step-card { text-align: center; }
    .step-number { width: 50px; height: 50px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-weight: 800; font-size: 1.2rem; }


    /* =============================================
        Cities Section
    ============================================= */
    .cities-section { background: #fff; }
    .cities-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin-top: 30px; }
    .city-card { 
      padding: 15px 30px; 
      background: var(--light); 
      border-radius: 12px; 
      text-decoration: none; 
      color: var(--dark); 
      font-weight: 700; 
      transition: 0.3s;
      border: 1px solid transparent;
    }
    .city-card:hover { border-color: var(--primary); color: var(--primary); background: #fff; transform: translateY(-3px); box-shadow: var(--shadow); }


    /* =============================================
        Why Us Section
    ============================================= */
    .why-us-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 25px;
      margin-top: 40px;
    }
    .why-us-card {
      background: #fff;
      padding: 30px;
      border-radius: 20px;
      border: 1px solid #e5e7eb;
      transition: 0.3s;
    }
    .why-us-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
    .why-us-card h3 { font-size: 1.25rem; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
    .why-us-card p { color: var(--gray); font-size: 0.95rem; }

    /* --- Секція Про нас --- */
.about-section {
    background: #ffffff;
    overflow: hidden;
    margin-top: 50px; 
    border-radius: 20px;
}

.about-header {
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.2rem;
    color: var(--dark);
    margin-bottom: 10px;
    font-weight: 800;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 600;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.05rem;
    color: var(--gray);
    line-height: 1.8;
}

/* Міні-переваги всередині тексту */
.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
    padding: 25px;
    background: var(--light);
    border-radius: 15px;
    border: 1px solid var(--primary);
}

.feature-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.feature-icon {
    font-size: 1.5rem;
}

/* Блок заклику до дії внизу тексту */
.about-cta-box {
    margin-top: 40px;
    padding: 40px 30px;
    background: #f8fafc; /* Дуже світлий сіро-блакитний відтінок */
    border: 2px solid var(--light); /* Ледь помітна рамка */
    border-radius: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Додамо декоративний елемент для професійного вигляду */
.about-cta-box {
    margin-top: 40px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    border-radius: 24px;
    background: #f8fafc; /* Колір всередині блоку */
    z-index: 1;
    overflow: hidden; /* Щоб анімація не виходила за межі */
    box-shadow: 0 15px 30px -10px rgba(37, 99, 235, 0.1);
}

/* Створюємо шар з градієнтом, який буде обертатися */
.about-cta-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    /* Градієнт, який буде "крутитися" */
    background: conic-gradient(
        transparent, 
        var(--primary), 
        var(--accent), 
        transparent 30%
    );
    animation: rotate-border 5s linear infinite;
    z-index: -2;
}

/* Створюємо "маску", щоб градієнт був лише тонкою лінією (рамкою) */
.about-cta-box::after {
    content: '';
    position: absolute;
    inset: 3px; /* Товщина рамки */
    background: #f8fafc; /* Має збігатися з фоном блоку */
    border-radius: 21px; /* Трохи менше за основний радіус */
    z-index: -1;
}

/* Анімація обертання */
@keyframes rotate-border {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}


.about-cta-box p {
    color: var(--gray);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.about-cta-box strong {
    display: block;
    color: var(--dark);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.about-phone-link {
    display: inline-block;
    font-size: 2.2rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 800;
    margin: 10px 0;
    transition: all 0.3s ease;
}

.about-phone-link:hover {
    color: var(--accent);
    transform: scale(1.02);
}

.work-now {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--success);
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Пульсуюча крапка для статусу */
.work-now::before {
    content: "";
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .about-phone-link { font-size: 1.7rem; }
    .about-cta-box { padding: 30px 20px; }
}

/* Контейнер для форми та кнопок */
.cta-wrapper {
    max-width: 500px;
    margin: 30px auto 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Стиль інпуту */
.phone-input-style {
    flex: 1;
    width: 100%;
    padding: 16px 20px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #fff;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    transition: all 0.3s ease;
    text-align: center;
}

.phone-input-style:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Вирівнювання форми */
.cta-form-about {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Розділювач "або" */
.cta-divider {
    font-size: 0.9rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.6;
}
.cta-divider::before, .cta-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Кнопка Telegram (адаптована під блок) */
.btn-telegram-about {
    background: #0088cc;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    transition: 0.3s ease;
}

.btn-telegram-about:hover {
    background: #0077b5;
    transform: translateY(-2px);
}

/* Адаптивність для десктопа (в один рядок) */
@media (min-width: 600px) {
    .cta-form-about {
        flex-direction: row;
    }
    .phone-input-style {
        text-align: left;
    }
}


.cta-form-about {
    display: flex;
    gap: 10px;
    justify-content: center;
}

@media (max-width: 600px) {
    .cta-form-about {
        flex-direction: column;
    }
}


/* Флаги для мовних версій */
.lang-flag {
    width: 20px;         /* Ширина прапорця */
    height: auto;        /* Пропорційна висота */
    margin-right: 8px;   /* Відступ від тексту */
    vertical-align: middle; /* Вирівнювання по центру рядка */
    border-radius: 2px;  /* Трохи закруглені кути */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); /* Легка тінь, щоб прапор не зливався з фоном */
}

.section-label {
    display: flex;       /* Використовуємо flex для ідеального вирівнювання */
    align-items: center; 
}


/* Стилі для прапорців у меню */
.lang-switcher a {
    display: inline-flex;
    align-items: center;
    gap: 5px; /* Відступ між прапором і текстом */
    text-decoration: none;
    font-weight: 600;
}

.nav-flag {
    width: 18px;      /* Трохи менше, ніж у карті сайту, для акуратності */
    height: 13px;     /* Фіксована висота для однакового вигляду */
    object-fit: cover; /* Щоб картинка не деформувалася */
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 2. Ефект при наведенні курсору */
.lang-switcher a:hover {
    opacity: 1;
    background-color: rgba(37, 99, 235, 0.1); /* Легкий блакитний фон при наведенні */
    color: #2563eb !important;
}

/* 3. Стиль для АКТИВНОЇ мови (яка зараз обрана) */
.lang-switcher a.active {
    color: #ffffff !important;      /* Білий текст */
    background-color: #2563eb;    /* Яскраво-синій фон */
    opacity: 1 !important;         /* Повна яскравість */
    filter: brightness(1.2); /* Робить колір трохи яскравішим за основний */
    pointer-events: none;          /* Вимикаємо клік */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* обільниі прапорці*/
@media (max-width: 768px) {
    .lang-switcher {
        display: flex;
        gap: 15px;
        padding: 10px 0;
    }
}

/* Галерея */
.works-grid {
    display: grid;
    /* Masonry-подібна сітка: автоматично підбирає кількість колонок */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    align-items: start; /* Важливо: картки не будуть розтягуватися по висоті сусіда */
}

.work-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.work-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

.work-img-wrapper {
    width: 100%;
    /* Встановлюємо фіксовану висоту. 
       Для вертикальних фото краще 350px-400px, для квадратних 300px */
    height: 350px; 
    overflow: hidden;
    position: relative;
    line-height: 0;
}


.work-img-wrapper img {
    width: 100%;
    height: 100%; /* Фото тепер розтягується на всю висоту контейнера */
    display: block;
    /* Ця властивість — магія: вона масштабує фото, щоб воно заповнило блок, 
       не розтягуючи його, і обрізає зайве по краях */
    object-fit: cover; 
    
    /* Центрування: фото завжди буде зафіксоване по центру */
    object-position: center; 
    
    transition: transform 0.5s ease;
}
.work-card:hover .work-img-wrapper img {
    transform: scale(1.1); /* Ефект наближення при наведенні */
}


.work-info {
    padding: 18px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.work-info p {
    margin: 0;
    font-weight: 600;
    font-size: 15px;
    color: #333;
    line-height: 1.4;
    text-align: center;
}
