/*
 * Główne style dla strony Auto Serwis Test.
 * Projekt wykorzystuje nowoczesne podejście oparte na Flexboxie i CSS Grid,
 * dzięki czemu witryna jest responsywna i czytelna na każdym urządzeniu.
 * Kolorystyka nawiązuje do logotypu firmy (czerwień i czerń) i zapewnia
 * wysoki kontrast oraz profesjonalny wygląd.
 */

:root {
    --primary-color: #e40c28;       /* jaskrawa czerwień z logotypu */
    --secondary-color: #111111;     /* ciemna czerń dla nagłówka i stopki */
    --accent-color: #f5f5f5;        /* delikatne tło sekcji */
    --text-color: #333333;          /* neutralny kolor tekstu */
    --light-text: #fdfdfd;          /* jasny tekst na ciemnych tłach */
    --link-color: #e40c28;          /* kolor linków */
    --link-hover: #b80a1a;          /* ciemniejszy odcień czerwieni dla hover */
    --max-width: 1200px;            /* maksymalna szerokość treści */
}

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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--accent-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Nawigacja */
header {
    background: var(--secondary-color);
    color: var(--light-text);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
}

header .container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    display: flex;
    align-items: center;
}

header .logo img {
    height: 60px;
    width: auto;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

nav li {
    margin-left: 1.5rem;
}

nav a {
    color: var(--light-text);
    font-weight: bold;
    transition: color 0.2s ease-in-out;
}

nav a:hover {
    color: var(--primary-color);
}

/* Mobilny przełącznik menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    height: 3px;
    width: 25px;
    background: var(--light-text);
    margin-bottom: 4px;
    transition: 0.3s;
}

@media (max-width: 768px) {
    nav ul {
        position: absolute;
        top: 100%;
        right: 0;
        background: var(--secondary-color);
        flex-direction: column;
        width: 200px;
        display: none;
    }
    nav li {
        margin: 0;
    }
    nav li a {
        padding: 1rem;
        display: block;
    }
    .menu-toggle {
        display: flex;
    }
    nav ul.show {
        display: flex;
    }
}

/* Sekcja główna (hero) */
.hero {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light-text);
}

.hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
}

.hero .content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 1rem;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.cta-btn {
    background: var(--primary-color);
    color: #fff;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}

.cta-btn:hover {
    background: var(--link-hover);
}

/* Sekcje ogólne */
section {
    padding: 3rem 1rem;
    background: var(--accent-color);
}

section.dark {
    background: var(--secondary-color);
    color: var(--light-text);
}

section .container {
    max-width: var(--max-width);
    margin: 0 auto;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-transform: uppercase;
}

/* Karty usług */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: transform 0.2s;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card .icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

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

.service-card p {
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Tabela usług */
.table-wrapper {
    overflow-x: auto;
    margin-top: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--secondary-color);
    color: var(--light-text);
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

tbody tr:hover {
    background: #f1f1f1;
}

th.sortable {
    cursor: pointer;
    position: relative;
}

th.sortable::after {
    content: '\25B2\25BC'; /* strzałki sortowania */
    font-size: 0.6rem;
    position: absolute;
    right: 8px;
    color: var(--light-text);
    opacity: 0.6;
}

/* Galeria zdjęć */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-grid img:hover {
    transform: scale(1.02);
}

/* Modal do galerii */
#modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 6px;
}

/* Formularz kontaktowy */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

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

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

form input, form textarea {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

form button {
    align-self: flex-start;
    background: var(--primary-color);
    color: #fff;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

form button:hover {
    background: var(--link-hover);
}

/* Stopka */
footer {
    background: var(--secondary-color);
    color: var(--light-text);
    padding: 2rem 1rem;
}

footer .container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

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

footer ul {
    list-style: none;
    line-height: 1.8;
}

footer ul li a {
    color: var(--light-text);
    transition: color 0.2s;
}

footer ul li a:hover {
    color: var(--primary-color);
}

footer .social-icons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

footer .social-icons a {
    color: var(--light-text);
    font-size: 1.4rem;
    transition: color 0.2s;
}

footer .social-icons a:hover {
    color: var(--primary-color);
}

/* Otwarcie modal (domyślnie ukryty) */
.show-modal {
    display: flex !important;
}