body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ecf0f1;
    overflow-x: hidden;
}

.last {
    display: block;
    text-align: center;
}

header {
    position: relative;
    background-color: #024b20;
    color: #ecf0f1;
    /* Megnövelt padding, hogy kényelmesen elférjen minden */
    padding: 15px 20px; 
    min-height: 100px;
    display: flex;
    align-items: center; /* Függőleges középre igazítás a szövegnek */
    justify-content: center;
    text-align: center;
}

header p {
    margin: 0;
    /* Biztonsági sáv: balról a logónak, jobbról a szűrőnek hagyunk helyet */
    padding: 0 100px; 
    max-width: 800px;
    line-height: 1.4;
    font-size: xx-large;
}

#sorting-buttons {
    text-align: center;
    margin: 20px;
}

.dropdown {
    display: inline-block;
    margin-right: 20px;
}

.dropdown select {
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #2ecc71;
    background-color: #ecf0f1;
    color: #2ecc71;
}

#sorting-buttons button {
    background-color: #2ecc71;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin: 5px;
    outline: none;
}

#sorting-buttons button:hover {
    background-color: #239b58;
}

section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    padding: 20px;
}

#product-container {
    position: relative;
    max-width: 100%;
    margin: auto;
}

.product {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 15px;
    padding: 20px;
    width: calc(25% - 30px);
    /* 25% width with 15px margin on both sides */
    text-align: center;
    display: inline-block;
    transition: transform 0.3s ease-in-out;
    position: relative;
    padding-bottom: 60px;
}

.product img {
    width: 100%;
    height: 200px;
    /* pick a fixed height */
    object-fit: contain;
    /* crops while keeping aspect ratio */
    border-radius: 8px;
    margin-bottom: 15px;
    display: block;
}

.product:hover {
    transform: scale(1.05);
}

button,
a.button {
    display: inline-block;
    background-color: #2ecc71;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    outline: none;
}

button:hover,
a.button:hover {
    background-color: #239b58;
}

#communication-bar {
    background-color: #024b20;
    color: white;
    text-align: center;
    padding: 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
}

#communication-bar p {
    margin: 0;
}

.info-bubble {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: yellow;
    color: white;
    padding: 10px;
    border-radius: 50%;
    transform: skewX(-20deg);
}

.info-text {
    margin: 0;
        color: red;
}

.akcio {
    color: red;
    font-size: large;
}

/* Dark mode styles */
body.dark-mode {
    background-color: #121212;
    color: #f1f1f1;
}



body.dark-mode .product {
    background-color: #1f1f1f;
    border: 1px solid #444;
}



body.dark-mode #sorting-buttons select {
    background-color: #1f1f1f; /* dark background */
    color: #f1f1f1;           /* light text */
    border: 1px solid #555;    /* optional border for visibility */
}
body.dark-mode #sorting-buttons select option {
    background-color: #1f1f1f;
    color: #f1f1f1;
}



/* Toggle switch */
.theme-toggle-container {
    position: absolute;
    bottom: 12px;
    right: 40px; /* Távolság a jobb széltől */
    display: flex;
    align-items: center; /* Függőlegesen középre igazítja a szöveget és a gombot */
    gap: 10px; /* Távolság a felirat és a kapcsoló között */
}

.theme-label {
    font-size: 16px;
    color: #ecf0f1;
}

/* Frissített kapcsoló (kikerült a position: absolute) */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

/* A switch input és slider-round stílusai maradhatnak a régiek */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

        .slider-round {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #bbb;
            border-radius: 34px;
            transition: 0.4s;
        }

        .slider-round:before {
            position: absolute;
            content: "";
            height: 22px;
            width: 22px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            border-radius: 50%;
            transition: 0.4s;
        }

        input:checked+.slider-round {
            background-color: #2ecc71;
        }

        input:checked+.slider-round:before {
            transform: translateX(22px);
        }
body,
header,
.product-container {
    transition: background-color 0.3s, color 0.3s;
}

#main-logo {
    position: fixed; /* Amíg nagy, addig a képernyőhöz rögzül */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    cursor: pointer;
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ecf0f1;
}

/* Lekicsinyített állapot a fejlécben */
#main-logo.shrunk {
    position: absolute; /* Itt már a header-hez képest mozog */
    top: 50%; /* Fejléc függőleges közepe */
    left: 15px;
    transform: translateY(-50%); /* Pontos függőleges középre igazítás */
    width: 80px;
    height: auto;
    background-color: transparent;
    z-index: 100;
}

/* --- Szűrő gomb: Fejléc jobb széle --- */
#filter-toggle-btn {
    position: absolute;
    top: 50%; /* Fejléc függőleges közepe */
    right: 15px;
    transform: translateY(-50%); /* Pontos függőleges középre igazítás */
    
    background-color: rgba(57, 219, 52, 0.2);
    border: 1px solid #2ecc71;
    color: #ecf0f1;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 101;
    white-space: nowrap; /* Ne törje tördeltre a gomb szövegét */
}

/* --- Reszponzív nézet (Mobil) --- */
@media only screen and (max-width: 768px) {
    header {
        /* Mobilon több hely kell, mert a szöveget a gombok alá toljuk */
        flex-direction: column;
        padding-top: 70px; /* Hely a logónak és a szűrőnek felül */
        min-height: 140px;
    }

    header p {
        padding: 0;
        font-size: 15px;
    }

    #main-logo.shrunk {
        top: 20px; /* Mobilon ne középen, hanem fent legyen */
        left: 10px;
        transform: none;
        width: 60px;
    }

    #filter-toggle-btn {
        top: 20px; /* Mobilon ne középen, hanem fent legyen */
        right: 10px;
        transform: none;
        font-size: 12px;
    }
}


/* --- Egyéni számbeviteli mezők stílusai --- */
.custom-filter input[type="number"] {
    padding: 8px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #2ecc71;
    background-color: #ecf0f1;
    color: #024b20;
    width: 80px;
    outline: none;
}

/* Sötét mód */
body.dark-mode .custom-filter input[type="number"] {
    background-color: #1f1f1f;
    color: #f1f1f1;
    border: 1px solid #555;
}

/* Opcionális: Eltüntetjük a böngészők alapértelmezett fel-le nyilait a számmezőkből */
.custom-filter input[type="number"]::-webkit-inner-spin-button,
.custom-filter input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* --- Szűrő választó és csoportok stílusai --- */

.filter-selector {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #bdc3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap; /* Mobilon egymás alá tördeljen */
}

body.dark-mode .filter-selector {
    border-bottom: 1px solid #444;
}

.filter-selector select {
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #2ecc71;
    background-color: #ecf0f1;
    color: #024b20;
    outline: none;
    cursor: pointer;
}

body.dark-mode .filter-selector select {
    background-color: #1f1f1f;
    color: #f1f1f1;
    border: 1px solid #555;
}

/* Törlés gomb (pirosas, hogy kitűnjön) */
#resetFiltersBtn {
    background-color: #e74c3c;
    border: none;
    padding: 10px 15px;
}

#resetFiltersBtn:hover {
    background-color: #c0392b;
}

/* A konkrét szűrőmezők elrejtése alapból */
.filter-group {
    display: none; 
    animation: fadeInDown 0.3s ease-out forwards;
}


/* --- Lebegő Checkbox Menü (Átlátszó, üveg hatású) --- */
#filter-checkbox-menu {
    display: none;
    position: absolute;
    /* A 50% a fejléc közepe, a 22px pedig pont a gomb alja alá tolja */
    top: calc(50% + 22px); 
    right: 15px;
    
    /* Üveg hatás (Glassmorphism) */
    background-color: rgba(255, 255, 255, 0.85); /* 85%-os átlátszóság */
    backdrop-filter: blur(8px); /* Modern elmosás a menü mögött */
    
    color: #024b20;
    border: 1px solid rgba(189, 195, 199, 0.5); /* Finomabb szegély */
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15); /* Kicsit lágyabb, nagyobb árnyék */
    z-index: 1002;
    min-width: 200px;
    text-align: left;
}

/* Sötét mód a lebegő menühöz */
body.dark-mode #filter-checkbox-menu {
    background-color: rgba(26, 26, 26, 0.85); /* Sötét, átlátszó */
    border-color: rgba(68, 68, 68, 0.5);
    color: #f1f1f1;
}

#filter-checkbox-menu.show {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease-out;
}

#filter-checkbox-menu .menu-title {
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

body.dark-mode #filter-checkbox-menu .menu-title {
    border-bottom-color: #444;
}

#filter-checkbox-menu label {
    margin: 5px 0;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#filter-checkbox-menu input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

#resetFiltersBtn {
    margin-top: 15px;
    background-color: #e74c3c;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
}

#resetFiltersBtn:hover {
    background-color: #c0392b;
}

/* --- Középső szűrő sáv (A SÁV, AMI ELTŰNIK) --- */
#sorting-buttons {
    display: none; /* ALAPBÓL REJTETT! Csak a JS kapcsolja be. */
    text-align: center;
    padding: 15px 10px;
    background-color: #04964148; /* Halvány háttér, hogy elkülönüljön a monitoroktól */
}

body.dark-mode #sorting-buttons {
    background-color: #013617; /* Sötét módhoz igazítva */
}

.filter-group {
    display: none; 
    margin: 5px 10px;
    animation: fadeInDown 0.3s ease-out forwards;
}

/* Mobilos finomhangolás a pozícióhoz */
@media only screen and (max-width: 768px) {
    #filter-checkbox-menu {
        top: 55px; /* Mobilon kicsit máshogy áll a gomb */
        right: 10px;
    }
}
#filter-checkbox-menu.show {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease-out;
}

/* Sötét mód a lebegő menühöz */
body.dark-mode #filter-checkbox-menu {
    background-color: #1a1a1a;
    color: #f1f1f1;
    border-color: #444;
}

#filter-checkbox-menu .menu-title {
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

body.dark-mode #filter-checkbox-menu .menu-title {
    border-bottom-color: #444;
}

#filter-checkbox-menu label {
    margin: 5px 0;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#filter-checkbox-menu input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

#resetFiltersBtn {
    margin-top: 15px;
    background-color: #e74c3c;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

#resetFiltersBtn:hover {
    background-color: #c0392b;
}



.filter-group {
    display: none; /* Alapból rejtett mindegyik */
    margin: 5px 10px;
    animation: fadeInDown 0.3s ease-out forwards;
}

/* Segédosztály: kikapcsolja az animációt az aloldalakra való visszalépéskor */
.no-transition {
    transition: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media only screen and (max-width: 768px) {
    #filter-checkbox-menu {
        top: 50px;
        right: 10px;
    }
}

@media only screen and (max-width: 600px) {
    .info-bubble {
        font-size: 12px;
        padding: 8px;
    }
}

@media only screen and (max-width: 1200px) {
    .product {
        width: calc(33.33% - 30px);
    }
}

@media only screen and (max-width: 900px) {
    .product {
        width: calc(50% - 30px);
    }
}

@media only screen and (max-width: 600px) {
    .product {
        width: calc(100% - 30px);
    }
}

@media only screen and (max-width: 480px) {

    #sorting-buttons select,
    #sorting-buttons button {
        width: 100%;
    }
}

@media only screen and (min-width: 600px) {
    header {
        font-size: 24px;
    }
}

@media only screen and (max-width: 600px) {
    header {
        font-size: 18px;
    }
}

@media only screen and (max-width: 480px) {
    header {
        font-size: 16px;
    }
}