/* assets/css/style.css */

:root {
    --primary: #0f172a; /* Ciemny granat - zaufanie */
    --accent: #e11d48;  /* Czerwony/Różowy - akcja/sprzedaż */
    --bg: #f8fafc;      /* Jasne tło */
    --text: #334155;
    --white: #ffffff;
    --gray: #94a3b8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); padding-bottom: 50px; }

/* --- HEADER --- */
.main-header {
    background: var(--primary);
    color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

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

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

.logo h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -1px; }
.logo span { color: var(--accent); }

.cta-phone { text-align: right; }
.cta-text { font-size: 0.8rem; opacity: 0.8; margin-bottom: 2px; }

.phone-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 0 15px rgba(225, 29, 72, 0.4);
}
.phone-button:hover { background: #be123c; transform: scale(1.05); }

/* --- SEARCH --- */
.search-section { padding: 20px 0; background: #e2e8f0; margin-bottom: 30px; }
#searchInput {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}
#searchInput:focus { border-color: var(--primary); }

/* --- GRID --- */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.car-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.car-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }

.card-image { position: relative; height: 200px; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.car-card:hover .card-image img { transform: scale(1.1); }

.price-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--primary);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: bold;
}

.card-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-content h2 { font-size: 1.25rem; margin-bottom: 10px; color: var(--primary); }
.card-specs {
    list-style: none;
    display: flex;
    gap: 15px;
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.btn-details {
    margin-top: auto;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
    text-transform: uppercase;
}
.btn-details:hover { background: var(--primary); color: var(--white); }

/* --- MODAL --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.8); 
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 50px auto;
    width: 90%;
    max-width: 1000px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn { from {opacity: 0; transform: translateY(-50px);} to {opacity: 1; transform: translateY(0);} }

.close-modal {
    position: absolute; top: 10px; right: 20px;
    font-size: 28px; font-weight: bold; color: #aaa; cursor: pointer; z-index: 1010;
}
.close-modal:hover { color: var(--primary); }

.modal-header-cta {
    background: #fef2f2; /* jasny czerwonawy */
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #fee2e2;
}
.modal-phone { font-size: 1.4rem; font-weight: bold; color: var(--accent); text-decoration: none; }
.modal-promo { font-size: 0.9rem; color: #881337; margin-top: 5px; }

.modal-body { display: flex; flex-direction: column; }
@media(min-width: 768px) {
    .modal-body { flex-direction: row; }
    .modal-gallery { width: 55%; }
    .modal-info { width: 45%; }
}

.modal-gallery { background: #000; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.main-image-container { width: 100%; height: 350px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#modalMainImage { max-width: 100%; max-height: 100%; object-fit: contain; }

.thumbnails-container { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.thumb { width: 80px; height: 60px; object-fit: cover; cursor: pointer; opacity: 0.6; border: 2px solid transparent; transition: 0.2s; }
.thumb:hover, .thumb.active { opacity: 1; border-color: var(--accent); }

.modal-info { padding: 30px; }
.modal-info h2 { font-size: 1.8rem; color: var(--primary); margin-bottom: 10px; }
.modal-price { font-size: 1.5rem; color: var(--accent); margin-bottom: 20px; border-bottom: 2px solid #eee; padding-bottom: 15px; }

.specs-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px;
}
.spec-item { font-size: 0.9rem; border-bottom: 1px solid #f1f5f9; padding: 5px 0; }
.spec-item strong { color: var(--primary); }

.modal-description { background: #f8fafc; padding: 15px; border-radius: 8px; line-height: 1.6; color: #475569; }
.modal-description h4 { margin-bottom: 10px; color: var(--primary); }

/* Responsive adjustments */
@media(max-width: 600px) {
    .header-content { justify-content: center; text-align: center; }
    .cta-phone { text-align: center; width: 100%; }
    .main-image-container { height: 250px; }
}

/* --- LIGHTBOX (POWIĘKSZANIE) --- */
.lightbox {
    display: none; /* Domyślnie ukryte */
    position: fixed;
    z-index: 2000; /* Najwyższa warstwa, nad modalem */
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95); /* Ciemne tło */
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    max-height: 80vh;
    object-fit: contain;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}

.close-lightbox {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-lightbox:hover,
.close-lightbox:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Kursor na głównym zdjęciu w modalu sugerujący powiększenie */
#modalMainImage {
    cursor: zoom-in;
}