:root {
    --bg: #f8f6f0;
    --card-bg: #ffffff;
    --primary: #3d2314;
    --primary-hover: #29170d;
    --accent: #8c2a1c;
    --text: #222222;
    --muted: #666666;
    --border: #dcd6cd;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 1. Biztosítjuk, hogy a HTML és a BODY teljes magasságú legyen */
html, body {
    height: 100%;
    margin: 0;
}

/* Alapstílusok és háttér - Sticky Footer Flexbox beállítás */
body {
    background-color: var(--bg);
    background-image: url('/uploads/core/bg.jpg');
    background-repeat: repeat;
    background-position: top left;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Logo mérete állítható magasság */
.brand-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

/* Tartalom konténer, ami kitölti az üres helyet a fejléc és lábléc között */
.site-content {
    flex: 1;
    width: 100%;
}

/* Fejléc */
header {
    background: var(--primary);
    color: #fff;
    padding: 12px 20px;
    border-bottom: 3px solid var(--accent);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* Fontos a lenyíló mobil menü pozicionálásához */
}

.brand {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.brand span {
    color: #e5a93c;
}

/* Navigáció és Reszponzív Mobil Menü stílusok */
.main-nav {
    display: flex;
    align-items: center;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #dfd8cc;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle:hover {
    color: #ffffff;
}

.nav-links {
    display: flex;
    align-items: center;
}

/* Asztali linkek stílusa */
nav a, .user-nav a, .nav-links a {
    color: #dfd8cc;
    text-decoration: none;
    margin-left: 15px;
    font-size: 0.9rem;
    font-weight: 600;
}

nav a:hover, .user-nav a:hover {
    color: #ffffff;
}

/* Kereső Sáv */
.search-section {
    background: #4a2d1d;
    padding: 20px 15px;
    border-bottom: 1px solid var(--border);
    width: 100%;
    box-sizing: border-box;
}

.search-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
}

.search-input, .search-select {
    flex: 1 1 220px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
    outline: none;
    background: #ffffff;
    box-sizing: border-box;
}

.btn-search {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.btn-search:hover {
    background: #702116;
}

/* Horizontális kategória menü stílusai */
.header-category-nav {
    position: relative;
}

.horizontal-cat-menu {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.horizontal-cat-menu li {
    position: relative;
}

.horizontal-cat-menu a {
    color: #dfd8cc;
    text-decoration: none;
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95rem;
    font-weight: 600;
}

.horizontal-cat-menu a:hover {
    color: #ffffff;
}

.horizontal-cat-menu .dropdown-children {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 180px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    list-style: none;
    padding: 5px 0;
    z-index: 100;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.horizontal-cat-menu .dropdown-children .dropdown-children {
    top: 0;
    left: 100%;
}

.horizontal-cat-menu li:hover > .dropdown-children {
    display: block;
}

.dropdown-children li a {
    padding: 8px 15px;
    color: var(--text);
    font-weight: normal;
    white-space: nowrap;
}

.dropdown-children li a:hover {
    background: var(--bg);
    color: var(--accent);
}

.cat-badge {
    background: var(--accent);
    color: #fff;
    padding: 1px 5px;
    border-radius: 10px;
    font-size: 0.7rem;
}

/* Elrendezés */
.container {
    max-width: 1200px;
    margin: 25px auto;
    padding: 0 15px;
}

.content-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Oldalsáv és Kategória menü */
aside {
    width: 240px;
    flex-shrink: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 4px;
}

aside h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent);
}

.cat-list {
    list-style: none;
}

.cat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.9rem;
    text-decoration: none;
    color: inherit;
}

.cat-item:hover {
    color: var(--accent);
}

.cat-count {
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--muted);
}

/* Fő tartalom sáv */
main {
    flex-grow: 1;
    min-width: 0;
    flex: 1;
}

/* Carousel stílusok */
.carousel-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 20px;
    background: #000;
}

.carousel-slide {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide.active {
    display: block;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(61, 35, 20, 0.7);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 3px;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--accent);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    right: 15px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
}

.dot.active {
    background: #fff;
}

/* Hirdetési rács */
.grid-title {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.card-img {
    width: 100%;
    height: 130px;
    background-color: #e0dcd3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.8rem;
}

.card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.card-price {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
    margin-top: auto;
}

.card-meta {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 4px;
}

/* Google AdSense kártya */
.google-ad-card {
    background: #f0ebd9;
    border: 1px dashed #b5a88f;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5px;
    min-height: 180px;
    overflow: hidden;
}

.ad-label {
    font-size: 0.65rem;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.sidebar-ad-box {
    width: 100%;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    margin-top: 15px;
}

.sidebar-ad-box .ad-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.sidebar-ad-box .ad-content {
    font-size: 0.85rem;
    color: #555;
}

/* Lábléc */
footer {
    background: var(--primary);
    color: #c5bcae;
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
    border-top: 3px solid var(--accent);
    margin-top: auto; 
}

/* Reszponzív nézetek és Mobil Menü Logika */
@media (max-width: 1024px) {
    .listings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* Mobil menü gomb megjelenítése */
    .mobile-menu-toggle {
        display: block;
    }

    /* Lenyíló mobil menü doboz */
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        /* MOBIL MENU HATTERSZINE */
        background: #fafade;
        /* MOBIL MENU HATTERSZINE */
        position: absolute;
        top: 100%;
        left: 0;
        padding: 15px 20px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
        border-bottom: 3px solid var(--accent);
        z-index: 1000;
        box-sizing: border-box;
    }

    /* Amikor aktívvá válik (JavaScript toggle), lenyílik */
    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        display: block;
        margin-left: 0;
        padding: 10px 0;
        width: 100%;
/*        color: #dfd8cc !important; */
        color: #ffffff !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        font-size: 1rem;
    }

    .nav-links a:hover {
        color: #ffffff !important;
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .content-wrapper {
        flex-direction: column;
    }
    aside {
        width: 100%;
    }
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    .search-input, .search-select, .btn-search {
        width: 100%;
        flex: none;
    }
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .horizontal-cat-menu {
        flex-wrap: wrap;
    }
}
