/* =========================================
   VARIABLES & THEME (Randomized: Royal Dark & Vibrant Mint)
   ========================================= */
:root {
    --color-bg: #0f172a;
    /* Dark Blue Slate */
    --color-bg-alt: #1e293b;
    /* Slightly lighter slate */
    --color-text: #f8fafc;
    /* Off-white text */
    --color-text-muted: #94a3b8;
    --color-primary: #2dd4bf;
    /* Teal / Mint */
    --color-primary-dark: #14b8a6;
    --color-accent: #f43f5e;
    /* Rose Red for CTAs */

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Roboto', sans-serif;

    --radius-card: 1rem;
    /* 2xl ~ 16px */
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   RESET & BASE
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

/* =========================================
   UTILITIES & TYPOGRAPHY
   ========================================= */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-text);
}

.section {
    padding: 4rem 0;
}

.section__header {
    text-align: center;
    margin-bottom: 3rem;
}

.section__title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.section__subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-bg);
}

.btn--primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
}

.btn--outline {
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    margin-left: 1rem;
}

.btn--outline:hover {
    background: var(--color-primary);
    color: var(--color-bg);
}

.btn--full {
    width: 100%;
}

/* Badge */
.badge {
    display: inline-block;
    background: rgba(45, 212, 191, 0.1);
    color: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    border: 1px solid var(--color-primary);
}

/* =========================================
   HEADER
   ========================================= */
.header {
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

/* Nav & Burger */
.nav__list {
    display: flex;
    gap: 2rem;
}

.nav__link:hover {
    color: var(--color-primary);
}

.nav__close {
    display: none;
}

.burger {
    display: none;
    background: transparent;
    flex-direction: column;
    gap: 6px;
}

.burger span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-text);
    transition: var(--transition);
}

@media (max-width: 1024px) {
    .burger {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--color-bg-alt);
        padding: 4rem 2rem;
        transition: 0.4s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav.active {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        gap: 1.5rem;
        font-size: 1.2rem;
    }

    .nav__close {
        display: block;
        position: absolute;
        top: 1rem;
        right: 1.5rem;
        font-size: 2rem;
        color: var(--color-text);
        background: none;
    }
}

/* =========================================
   HERO SECTION (Split Layout)
   ========================================= */
.hero {
    margin-top: 80px;
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.hero__title {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero__subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.hero__image-wrapper {
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.8), transparent);
}

@media (max-width: 768px) {
    .hero__container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero__title {
        font-size: 2.2rem;
    }

    .hero__actions {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .btn--outline {
        margin-left: 0;
    }
}

/* =========================================
   ABOUT (Grid Features)
   ========================================= */
.about__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--color-bg-alt);
    padding: 2rem;
    border-radius: var(--radius-card);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-card:hover {
    transform: translateY(-10px);
    background: #252f45;
}

.feature-card__icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

/* =========================================
   SERVICES (Grid / Masonry-ish)
   ========================================= */
.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--color-bg-alt);
    border-radius: var(--radius-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.service-card--large {
    grid-column: span 2;
}

/* Masonry effect if space allows */
@media (max-width: 768px) {
    .service-card--large {
        grid-column: span 1;
    }
}

.service-card__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.service-card__content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-card h3 {
    margin-bottom: 0.5rem;
}

.service-card p {
    flex-grow: 1;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.link-arrow {
    color: var(--color-primary);
    font-weight: bold;
    font-size: 0.9rem;
}

/* =========================================
   REVIEWS (Responsive Grid / Rubber Layout)
   ========================================= */
.reviews__slider {
    display: grid;
    /* Магія "гумовості": створює колонки автоматично. 
       Якщо місця мало (<300px) — 1 колонка, якщо багато — ділить на рівні частини (1fr) */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding-bottom: 1rem;
    /* Відключаємо старий скрол */
    overflow-x: visible;
    scroll-snap-type: none;
}

.review-card {
    /* Прибираємо фіксовану ширину, тепер картка займає весь простір своєї комірки */
    min-width: auto;
    width: 100%;

    background: var(--color-bg-alt);
    padding: 2rem;
    border-radius: var(--radius-card);
    border: 1px solid var(--color-primary);

    /* Щоб висота карток була однаковою і контент виглядав гарно */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    transition: var(--transition);
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
}

.review-card__text {
    font-style: italic;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    /* Текст розтягується, штовхаючи автора вниз */
}

.review-card__author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
}

.review-card__author img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 2px solid var(--color-primary);
}

/* =========================================
   CONTACT
   ========================================= */
.contact__wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact__info ul li {
    margin-top: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form {
    background: var(--color-bg-alt);
    padding: 2rem;
    border-radius: var(--radius-card);
}

.form__group {
    margin-bottom: 1.2rem;
}

.form__label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form__input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--color-text);
    font-family: inherit;
}

.form__input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.error-msg {
    color: #ff4757;
    font-size: 0.8rem;
    display: block;
    margin-top: 5px;
    min-height: 1.2em;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.link-btn {
    background: none;
    color: var(--color-primary);
    text-decoration: underline;
    font-size: inherit;
    padding: 0;
}

.form-status {
    margin-top: 1rem;
    text-align: center;
    font-weight: bold;
}

@media (max-width: 768px) {
    .contact__wrapper {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    background: #020617;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer h4 {
    margin-bottom: 1.2rem;
    color: var(--color-primary);
}

.footer ul li {
    margin-bottom: 0.8rem;
}

.footer-link {
    background: none;
    color: var(--color-text-muted);
    text-align: left;
    transition: var(--transition);
    padding: 0;
}

.footer-link:hover,
.footer a:hover {
    color: var(--color-primary);
}

.footer__bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #64748b;
    font-size: 0.9rem;
}

/* =========================================
   COOKIE POPUP (FIXED)
   ========================================= */
.cookie-popup {
    position: fixed;
    bottom: -200px;
    /* Сховано за межами екрану */
    left: 20px;
    max-width: 400px;
    width: calc(100% - 40px);
    /* Адаптивність для мобільних */
    background: var(--color-bg-alt);
    /* Темний фон блоку */
    padding: 1.5rem;
    border-radius: var(--radius-card);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    /* Глибока тінь для відокремлення */
    z-index: 9999;
    /* Найвищий пріоритет (поверх всього) */
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Плавна анімація */
    border: 1px solid var(--color-primary);
    /* Рамка в колір бренду */
}

/* Клас для показу */
.cookie-popup.show {
    bottom: 20px;
}

.cookie-content p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text);
}

.link-text {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.btn--small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* =========================================
   MODALS
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-bg);
    padding: 2rem;
    border-radius: var(--radius-card);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    display: none;
    /* Controlled by JS */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal.active {
    display: block;
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    background: none;
    color: var(--color-text);
}

.modal h2 {
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.modal h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
    font-size: 1.1rem;
}

.modal p,
.modal li {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .cookie-popup {
        left: 10px;
        width: calc(100% - 20px);
        bottom: -250px;
        padding: 1.2rem;
    }

    .cookie-popup.show {
        bottom: 10px;
    }

    .cookie-buttons {
        width: 100%;
    }

    .cookie-buttons .btn {
        flex: 1;
        /* Кнопки на всю ширину */
    }
}