html {
    scroll-behavior: smooth;
}
/* --- Загальні стилі --- */
:root {
    --primary-color: #333;
    --accent-color: #ff7f00; /* Помаранчевий */
    --light-bg: #f5f5f5;
    --white: #ffffff;
    --border-color: #e0e0e0;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--primary-color);
    
    /* ФОН САЙТУ */
    background-image: url('images/fon.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Фон стоїть на місці при прокрутці */
    background-repeat: no-repeat;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; }

/* --- Header --- */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 700; font-size: 1.2rem; }
.header-phones { font-weight: bold; font-size: 0.9rem; }
.header-phones a { margin-left: 10px; color: var(--primary-color); }
nav ul { display: flex; gap: 20px; }
.burger-menu { display: none; }

/* --- Hero (Головний екран) --- */
.hero {
    background-color: #333; color: white; padding: 100px 0; text-align: center;
    background-image: url('https://images.unsplash.com/photo-1519003722824-194d4455a60c?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80');
    background-size: cover; background-position: center; position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.hero::before { 
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0.5)); 
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { font-size: 3rem; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.hero .subtitle { font-size: 1.5rem; color: var(--accent-color); margin-bottom: 30px; font-weight: bold; text-transform: uppercase; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }
.btn {
    background: var(--accent-color); color: white; padding: 15px 40px; border-radius: 50px; font-weight: bold; font-size: 1.1rem;
    display: inline-block; transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    text-transform: uppercase; box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(230, 126, 34, 0.6); background-color: #d35400; }


/* --- БЛОК ПОСЛУГИ (З картинками фону) --- */
.main-services {
    padding: 60px 0 20px;
    background-color: rgba(255, 255, 255, 0.95);
}
.main-services h2 { text-align: center; margin-bottom: 30px; }

.overlay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.overlay-card {
    position: relative;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    cursor: default;
    transition: transform 0.3s;
}
.overlay-card:hover { transform: translateY(-5px); }

/* Затемнення на картці послуг */
.overlay-card::before {
    content: '';
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.2));
}

.overlay-content {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 20px;
    box-sizing: border-box;
    color: white;
    z-index: 1;
}
.overlay-content h3 { margin: 0 0 10px; font-size: 1.5rem; color: var(--accent-color); }
.overlay-content p { margin: 0; font-size: 1rem; line-height: 1.4; color: #eee; }


/* --- АВТОПАРК (Картки з деталями) --- */
.services { 
    padding: 40px 0; 
    background-color: rgba(255, 255, 255, 0.92); 
    backdrop-filter: blur(3px); 
}
.services h2 { text-align: center; margin-bottom: 30px; }
.mt-50 { margin-top: 60px; text-align: center; }

/* Підказка "Гортайте вбік" (прихована за замовчуванням) */
.mobile-hint { display: none; text-align: center; color: #777; margin-bottom: 10px; }

.grid-container {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px;
}

.card {
    background: var(--white); border-radius: 12px; overflow: hidden; position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); cursor: pointer; transition: transform 0.2s; height: 400px;
    -webkit-tap-highlight-color: transparent;
}
.badge {
    position: absolute; top: 15px; right: 15px; background: var(--accent-color); color: white;
    padding: 5px 10px; border-radius: 4px; font-weight: bold; z-index: 10; font-size: 0.8rem;
}
.card-inner { position: relative; height: 100%; width: 100%; display: flex; flex-direction: column; }
.card-img {
    height: 240px; width: 100%; display: flex; align-items: center; justify-content: center;
    padding: 20px; box-sizing: border-box; transition: transform 0.3s ease, opacity 0.3s ease;
}
.card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card-simple-title { text-align: center; padding: 10px; transition: opacity 0.3s; }
.card-simple-title h3 { margin: 0; font-size: 1.4rem; }
.tap-hint { font-size: 0.8rem; color: #999; margin-top: 5px; }

/* Виїжджаюча панель */
.details-panel {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 85%;
    background: var(--white); transform: translateY(110%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1); border-top-left-radius: 15px; border-top-right-radius: 15px;
    padding: 15px; box-sizing: border-box; display: flex; flex-direction: column; z-index: 20;
}
/* Логіка наведення та кліку */
@media (hover: hover) {
    .card:hover .details-panel { transform: translateY(0); }
    .card:hover .card-img { transform: scale(0.9) translateY(-30px); opacity: 0.6; }
    .card:hover .details-header i { transform: rotate(0deg); }
}
.card.active .details-panel { transform: translateY(0); }
.card.active .card-img { transform: scale(0.9) translateY(-30px); opacity: 0.6; }
.card.active .details-header i { transform: rotate(0deg); }

.details-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.details-header h3 { font-size: 1.1rem; margin: 0; }
.details-header i { transform: rotate(180deg); color: #888; transition: transform 0.3s; }
.price-bar {
    background-color: var(--accent-color); color: white; font-weight: bold; font-size: 1.1rem;
    padding: 10px 15px; border-radius: 8px; margin-bottom: 15px; box-shadow: 0 2px 5px rgba(255, 127, 0, 0.3);
}
.info-table { background-color: var(--light-bg); border-radius: 8px; padding: 5px 10px; flex-grow: 1; overflow-y: auto; }
.info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: #555; }
.info-row .value { font-weight: bold; color: #000; text-align: right; }

/* --- ЧОМУ МИ --- */
.why-us { padding: 60px 0; background-color: rgba(255, 255, 255, 0.9); text-align: center; }
.why-us h2 { font-size: 2.5rem; margin-bottom: 40px; color: var(--primary-color); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }

.feature-card {
    background: #fff; border: 1px solid #eee; border-radius: 15px; padding: 30px 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: transform 0.3s;
    display: flex; flex-direction: column; align-items: center;
}
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.icon-circle {
    width: 70px; height: 70px; background-color: var(--primary-color); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 30px; margin-bottom: 20px;
}
.feature-card:hover .icon-circle { background-color: var(--accent-color); transition: background-color 0.3s; }
.feature-card h3 { font-size: 1.2rem; margin-bottom: 15px; font-weight: bold; color: #333; }
.feature-card p { font-size: 0.95rem; color: #666; line-height: 1.5; margin: 0; }

/* --- КОНТАКТИ --- */
.contacts-section {
    padding: 60px 0; background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white; text-align: center;
}
.contacts-wrapper { max-width: 600px; margin: 0 auto; }
.contacts-section h2 { font-size: 2.5rem; margin-bottom: 10px; color: white; }
.contacts-section p { font-size: 1.1rem; margin-bottom: 40px; color: #bdc3c7; }
.contact-buttons { display: flex; flex-direction: column; gap: 20px; align-items: center; }
.main-phone-btn, .secondary-phone-btn {
    display: flex; align-items: center; background: white; color: #333;
    padding: 15px 25px; border-radius: 50px; text-decoration: none;
    width: 100%; max-width: 350px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s; position: relative; overflow: hidden;
}
.main-phone-btn:hover, .secondary-phone-btn:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.main-phone-btn { border: 2px solid var(--accent-color); }
.icon-box {
    background: var(--accent-color); color: white; width: 50px; height: 50px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-right: 20px;
}
.secondary-phone-btn .icon-box { background: #2980b9; }
.text-box { display: flex; flex-direction: column; align-items: flex-start; }
.operator { font-size: 0.8rem; text-transform: uppercase; color: #777; font-weight: bold; }
.number { font-size: 1.5rem; font-weight: 700; color: #333; }
.main-phone-btn::after {
    content: ''; position: absolute; width: 100%; height: 100%; top: 0; left: 0;
    border-radius: 50px; box-shadow: 0 0 0 0 rgba(255, 127, 0, 0.7);
    animation: pulse-orange 2s infinite; z-index: -1;
}
@keyframes pulse-orange {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 127, 0, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(255, 127, 0, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 127, 0, 0); }
}

footer { background: #222; color: #999; text-align: center; padding: 20px; margin-top: 40px; }

/* --- Mobile Adaptation (Мобільна версія) --- */
@media (max-width: 768px) {
    /* Навігація */
    nav {
        display: none; position: absolute; top: 100%; left: 0; width: 100%;
        background-color: #ffffff; box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        padding: 20px 0; border-top: 1px solid #eee; z-index: 999;
    }
    nav ul { display: flex; flex-direction: column; align-items: center; gap: 25px; margin: 0; }
    nav a { font-size: 1.2rem; display: block; padding: 5px 0; }
    .burger-menu { display: block; font-size: 26px; cursor: pointer; color: var(--primary-color); padding: 10px; }
    .header-phones { display: none; }
    .hero h1 { font-size: 2rem; }
    
    /* Показуємо підказку тільки для блоку послуг */
    .mobile-hint { display: none; }
    #main-services .mobile-hint { display: block; text-align: center; color: #777; margin-bottom: 10px; }

    /* --- 1. ГОРИЗОНТАЛЬНИЙ СКРОЛ (ТІЛЬКИ ДЛЯ БЛОКУ ПОСЛУГИ) --- */
    .overlay-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 15px;
        padding-bottom: 20px;
        scrollbar-width: none;
    }
    .overlay-grid::-webkit-scrollbar { display: none; }

    .overlay-card {
        min-width: 85vw; /* Картка займає 85% ширини екрану */
        flex: 0 0 85vw;
        scroll-snap-align: center;
        height: 350px;
    }

    /* --- 2. ВЕРТИКАЛЬНИЙ СПИСОК (ДЛЯ АВТОПАРКУ ТА ІНШИХ) --- */
    /* Повертаємо звичайну сітку в одну колонку */
    .grid-container, 
    .features-grid {
        display: grid;
        grid-template-columns: 1fr; 
        gap: 20px;
        overflow-x: visible; 
        padding-bottom: 0;
    }

    /* Скидаємо стилі скролу для карток автопарку */
    .card {
        width: 100%;
        min-width: 0; /* Прибираємо фіксовану ширину */
        height: 420px;
        margin-bottom: 0;
    }
    
    /* Скидаємо стилі для карток "Чому ми" */
    .feature-card {
        width: 100%;
        min-width: 0;
        height: auto; 
        min-height: unset;
    }
}