@media (max-width: 560px) {
    .header-img .header-img-overlay{
        width: 100%;
    }
}

@media (max-width: 885px) {
    header .navbar-search{
        display: none !important;
    }

    .header-img .header-img-overlay{
        width: 70%;
    }
}

@media (max-width: 768px) {
    .how-to-start .text-content .content, .how-to-start .text-content .title{
        text-align: center;
    }
}

@media (max-width: 1200px) {
    header .start-menu,
    header #desktop-menu{
        display: none !important;
    }
    header #mobile-menu{
        display: block !important;
    }

    .navbar-search{
        display: none;
    }
}

@media (max-width: 767.98px) {
    .header-img .header-img-overlay .description,
    .header-img .header-img-overlay .buttons{
        display: none;
    }

    /* Kezdőlap: a slider alatti hírkártyák egymás alatt, teljes szélességben
       (a Bootstrap .w-50 !important-ját kell felülírni) */
    .main-news .news-card {
        width: 100% !important;
    }

    /* Kezdőlap: terméklisták (Friss ajánlatok, Fedezd fel) egy oszlopban */
    .bestseller-list .row-cols-2 > * {
        width: 100%;
    }

    /* Footer: a két menü egymás alatt, a menüpontok blokként */
    footer .footer-top .footer-top-content .footer-menu-content {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
        padding-left: 20px;
    }

    footer .footer-top .footer-top-content .footer-menu li {
        display: block;
        margin-right: 0;
    }

    /* a „Kövess minket” felirat külön sorba, az ikonok alatta egy sorban */
    footer .footer-top .footer-top-content .footer-social-menu li:first-child {
        display: block;
        margin-bottom: 6px;
    }

    /* Piactér: a cím és a kereső egymás alatt, a kereső teljes szélességű */
    .products-title .products-title-row {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }

    .products-title .input-group {
        max-width: none;
        width: 100%;
    }

    /* Piactér szűrősáv: a gombok (Szűrés, Hirdetés feladása) külön sorban,
       teljes szélességben; a lapozás és a rendezés egy sorban, ha nem fér, tördel */
    .products-filter .products-filter-bar {
        flex-wrap: wrap;
        gap: 12px;
    }

    .products-filter .products-filter-actions {
        display: contents !important; /* a Bootstrap .d-flex !important-ját kell felülírni */
    }

    .products-filter .products-filter-actions > .btn {
        order: -1;
        width: 100%;
        justify-content: center !important;
    }

    /* Lapozó: saját sor, középre igazítva, nagyobb térközzel és érintőfelülettel */
    .products-filter .list-pagination {
        width: 100%;
        justify-content: center;
        padding: 14px 0;
    }

    .products-filter .list-pagination a,
    .products-filter .list-pagination .text-muted {
        padding: 8px 12px;
    }

    .products-filter .list-orders {
        flex: 1 1 auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
    }

    .products-filter .list-orders .list-page-items label {
        padding-left: 0;
    }

    /* Kiadvány részletes oldal: a borítókép az adatlista alá kerül, középre */
    .product-info-card .album-header {
        flex-direction: column;
    }

    .product-info-card .album-header .album-img {
        order: 2;
        margin: 15px auto 0;
    }

    /* Kiadvány / hirdetés oldal: az egymás alá kerülő gombok között térköz */
    .product-info-card .product-info-actions > .col-md-6 + .col-md-6 {
        margin-top: 10px;
    }

    /* Profil morzsamenü: több sorba tördelve is középre igazítva */
    .main-banner .breadcrumb {
        justify-content: center;
        text-align: center;
        padding: 0 16px;
    }

    /* Profil almenü: két oszlopos rács, egyforma keretes menüpontok;
       a lenyílók a helyükön nyílnak ki, nem lebegnek a többi menüpont fölé */
    .main-banner .profile-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 16px;
    }

    .main-banner .profile-nav .nav-item {
        width: 100%;
    }

    .main-banner .profile-nav .nav-link {
        display: block;
        width: 100%;
        margin-bottom: 0;
        padding: 8px 6px;
        text-align: center;
        border: 1px solid rgba(255, 255, 255, 0.35);
        border-radius: 6px;
    }

    .main-banner .profile-nav .nav-link.active {
        border-color: #fff;
    }

    .main-banner .profile-nav .dropdown-menu {
        position: static !important; /* a Popper inline stílusát kell felülírni */
        inset: auto !important;
        transform: none !important;
        width: 100%;
        margin-top: 4px !important;
    }

    .main-banner .profile-nav .dropdown-item {
        white-space: normal;
        text-align: center;
    }

    /* Új hirdetés lépés-fülei: két oszlopba tördelve, nem lógnak ki a kártyából */
    .listing-steps {
        flex-wrap: wrap;
        gap: 4px;
    }

    .listing-steps > .btn {
        flex: 1 1 calc(50% - 4px);
        margin-left: 0 !important;
        border-radius: 4px !important;
    }

    /* Szállítási irányelv űrlap: kisebb belső margók, hogy több hely jusson
       a mezőknek; a sorok tördelnek, nem lógnak ki a kártyából */
    .shipping-policy-page .card-body.p-5 {
        padding: 1rem !important;
    }

    .shipping-policy-page .card-body.p-4 {
        padding: 0.75rem !important;
    }

    .shipping-policy-page .shipping-method {
        padding: 0.75rem !important;
    }

    .shipping-policy-page .country-section-head,
    .shipping-policy-page .shipping-methods-head,
    .shipping-policy-page .delivery-days-row,
    .shipping-policy-page .add-range-row,
    .shipping-policy-page .range-item {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .shipping-policy-page .range-item > * {
        white-space: nowrap;
    }

    /* Országok két oszlopban */
    .shipping-policy-page .country-list > [class*="col-"] {
        width: 50%;
    }

    /* Info oldalak: a cím és a kereső egymás alatt, a kereső teljes szélességű */
    .info-header-container {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }

    .info-header-container form {
        width: 100%;
    }

    .info-header-container .info-search-group {
        max-width: none;
    }

    /* Kosár: kisebb belső margók az egymásba ágyazott kártyákban */
    .seller-cart-block .card-body {
        padding: 0.75rem;
    }

    /* Kosár tétel-sor: táblázat helyett rács – kép balra, mellette a cím,
       alatta egy sorban az ár, a mennyiség és a törlés gomb */
    .policy-cart-block .table-responsive {
        overflow: visible;
    }

    .policy-cart-block .table,
    .policy-cart-block .table > tbody {
        display: block;
        width: 100%;
    }

    .policy-cart-block .table > tbody > tr {
        display: grid;
        grid-template-columns: 70px 1fr auto auto;
        grid-template-areas:
            "img title title title"
            "img price qty del";
        column-gap: 8px;
        row-gap: 6px;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid var(--bs-border-color);
    }

    .policy-cart-block .table > tbody > tr:last-child {
        border-bottom: 0;
    }

    .policy-cart-block .table > tbody > tr > td {
        display: block;
        width: auto !important; /* a cellák inline szélességét kell felülírni */
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .policy-cart-block .table > tbody > tr > td:nth-child(1) { grid-area: img; }
    .policy-cart-block .table > tbody > tr > td:nth-child(2) { grid-area: title; }
    .policy-cart-block .table > tbody > tr > td:nth-child(3) { grid-area: price; text-align: left !important; white-space: nowrap; }
    .policy-cart-block .table > tbody > tr > td:nth-child(4) { grid-area: qty; }
    .policy-cart-block .table > tbody > tr > td:nth-child(5) { grid-area: del; }

    .policy-cart-block .table > tbody > tr > td .input-group {
        width: auto;
        flex-wrap: nowrap;
    }
}

/* ===== Mobil és tablet közös szabályok (1199.98 px-ig): táblázatok ===== */
@media (max-width: 1199.98px) {
    /* Profil-listák táblázatai: minimális szélesség, hogy az oszlopok ne
       préselődjenek össze; vízszintesen görgethető, a sáv mindig látszik */
    .profile-content .table-responsive > .table {
        min-width: 640px;
    }

    /* A rövid cellák (ár, mennyiség, dátum, státusz) ne tördeljenek; csak a
       cím-cellák (félkövér cím, link, több soros blokk) törhetnek több sorba */
    .profile-content .table-responsive > .table th,
    .profile-content .table-responsive > .table td {
        white-space: nowrap;
    }

    .profile-content .table-responsive > .table td:not(:has(.btn, .bg-light, > img)):has(> strong, > a, > div, > span.fw-medium) {
        white-space: normal;
        min-width: 200px;
    }

    /* A borítókép cellája ne nyomódjon össze (a bélyegkép max-width: 100%-os) */
    .profile-content .table-responsive > .table td:has(> img, > .bg-light) {
        min-width: 80px;
    }

    /* Piactér táblázat: a leírás oszlop ne préselődjön össze,
       és a vízszintes görgetősáv mindig látszódjon */
    .products-table .product-info {
        min-width: 260px;
    }

    /* Csak a ::-webkit-scrollbar szabályok kényszerítik ki a mindig látható sávot;
       ha scrollbar-width / scrollbar-color is meg van adva, a Chrome ezeket
       figyelmen kívül hagyja, és az átlapoló sáv elrejtőzik. */
    .products-table-wrap,
    .profile-content .table-responsive {
        overflow-x: scroll;
    }

    .products-table-wrap::-webkit-scrollbar,
    .profile-content .table-responsive::-webkit-scrollbar {
        height: 8px;
    }

    .products-table-wrap::-webkit-scrollbar-track,
    .profile-content .table-responsive::-webkit-scrollbar-track {
        background: #e5e5e5;
        border-radius: 4px;
    }

    .products-table-wrap::-webkit-scrollbar-thumb,
    .profile-content .table-responsive::-webkit-scrollbar-thumb {
        background: #8a8a8a;
        border-radius: 4px;
    }
}

/* ===== Tablet (768–1199.98 px) ===== */
@media (min-width: 768px) and (max-width: 1199.98px) {
    /* Kiadvány / hirdetés oldal: a Statisztika és az Állapot/Eladó blokk két
       oszlopa egymás alá kerül, mert a keskeny jobb oldali kártyában szavanként tördelt */
    .product-info-card .product-info-stat-table > .col-md-6 {
        width: 100%;
    }

    /* Kezdőlap terméklisták: három oszlop, hogy a kártyák szélesebbek legyenek
       (a Bootstrap row-cols-lg-4 992-től négyet adna) */
    .bestseller-list .row-cols-lg-4 > * {
        width: 33.3333%;
    }

    /* Kiadvány / hirdetés oldal: a gombpár teljes szélességű, egymás alatt,
       mert a keskeny jobb oldali kártyában eltérő magasságúra tördeltek */
    .product-info-card .product-info-actions > .col-md-6 {
        width: 100%;
    }

    .product-info-card .product-info-actions > .col-md-6 + .col-md-6 {
        margin-top: 10px;
    }

    /* Footer: kisebb bal margó, és a két menü tördelhet, térközzel, hogy a GYIK
       és a „Kövess minket” ne érjen össze */
    footer .footer-top .footer-top-content .footer-menu-content {
        padding-left: 30px;
        flex-wrap: wrap;
        gap: 10px 32px;
    }
}
