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

html,
body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial;
    color: #111;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "header" "main" "footer";
    min-height: 100vh;
    display: grid;

}

/* HERO */
#hero {
    grid-area: header;
    height: 100vh;
    background-image: url('kepek/fej.jpg');
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

#hero .hero-content h1 {
    font-size: clamp(2rem, 6vw, 4.5rem);
    text-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* Top bar (hidden initially) */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    transition: height 240ms ease, background-color 240ms ease, box-shadow 240ms ease;
    overflow: hidden;
    z-index: 80;
}

.top-bar .brand {
    font-weight: 700;
    text-align: center;
    margin: auto;
}

.top-bar .mini-nav a {
    text-decoration: none;
    margin-left: 0.75rem;
    color: #222;
}

/* When scrolled, show a compact bar */
.top-bar.show {
    height: 52px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* page content spacing */
main {
    grid-area: main;
    background: #fff;
}

main .page-inner {
    padding: 2rem;
    min-height: 800px;
}

.content-section {
    height: 200vw;
}

footer {
    grid-area: footer;
    padding: 1rem 2rem;
    background: #f8f8f8;
}

/* Grid layout*/
.gridescucc {
    grid-template-areas:
        "header header header" 40vh "main main main" auto
        "footer footer footer" auto;
}

header.header {
    grid-area: header;
}

main.main {
    grid-area: main;
}

footer.footer {
    grid-area: footer;
}

main {
    margin: auto 10% auto 10%;
}

.elsokep {

    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    transition: transform .3s ease, box-shadow .3s ease, filter .3s ease;

}

.kiemelkedik:hover {

    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
    filter: contrast(1.05) saturate(1.05);
    transition: transform .3s ease, box-shadow .3s ease, filter .3s ease;


}

.autok_tabla {
    /* Make sure the wrapper inside a .row behaves like a proper column */
    width: 100%;
    box-sizing: border-box;
}

/* Card styles */
.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: stretch;
}

.card-container .card {
    flex: 1 1 220px;
    /* preferred base width */
    min-width: 200px;
    max-width: 420px;
}

.card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .3s ease, transform .3s ease;
}

.card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    transform: translateY(-4px) scale(1.05);
}

.card-body {
    padding: 1.2rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.7rem;
}

.card-text {
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.card-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: #3395fd;
    margin-top: auto;
}

.card-img-top {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: center;
    border-bottom: 1px solid #eee;
    display: block;
    cursor: zoom-in;
}

/* Selected car display (larger, decorative) */
#selectedCarContainer {
    margin-top: 1rem;
}

#selectedCarDisplay {
    background-color: whitesmoke;
    border: 1px solid rgb(0, 0, 0);
    box-shadow: 0 6px 18px rgba(51, 149, 253, 0.06);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    gap: 1rem;
    padding-left: 0px;
}
@media screen and (max-width: 1200px) {
    #selectedCarDisplay {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }  
    
}
.selected-car-image {
    height: 120px;
    width: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e6eefb;
}

.selected-car-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    white-space: nowrap;
}

.selected-car-details h5 {
    margin: 0;
    font-size: 1.25rem;
}

.selected-car-details .small {
    display: inline-block;
    margin-top: 0;
    color: #556;
    white-space: nowrap;
}

.selectedCarDisplay>img {
    border-radius: 20px;
    border: 1px solid #e6eefb;
}

/* ensure the text doesn't wrap to a second line */
#selectedCarText,
#selectedCarExtra {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-car-details ul {
    margin: 0.25rem 0 0 1rem;
}

/* removed in-form selected summary styles (we use only the top display now) */
/* Form styles */
form {
    margin: 3% auto 3% auto;
}

#overlay {
    position: fixed;
    display: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2;
    cursor: pointer;
}

.btn_berles {
    background-color: white;
    color: #3395fd;
    border: 1px solid #3395fd;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn_berles:hover {
    background-color: #3395fd;
    color: white;
}

.btn_berles span {
    cursor: pointer;
    display: inline-block;
    position: relative;
    transition: 0.5s;
}

.btn_berles span:after {
    content: '\00bb';
    position: absolute;
    opacity: 0;
    /* kicsit feljebb és enyhén nagyobb */
    /* enyhén lejjebb húzva (kisebb vizuális eltolás) */
    top: 45%;
    transform: translateY(-50%) scale(1);
    font-size: 1.1em;
    right: -20px;
    transition: transform 200ms ease, right 200ms ease, opacity 200ms ease;
}

.btn_berles:hover span {
    padding-right: 15px;
}

.btn_berles:hover span:after {
    /* hoverkor a nyíl kicsit nagyobb lesz és beúszik a helyére */
    opacity: 1;
    right: 0;
    transform: translateY(-50%) scale(1.15);
}