/* Základní nastavení */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    color: #333;
}

/* Hlavní kontejner - fixní šířka pro čistý vzhled */
.container {
    display: grid;
    grid-template-columns: 200px 1fr 180px; /* Levý panel, Střed, Pravý panel */
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Hlavička */
.main-header {
    background-color: #8cc6ec; /* Světle modrá dle obrázku */
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-bottom: 4px solid #f39200; /* Oranžová linka */
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    width: 1200px;
}

.logo {
    font-size: 48px;
    font-weight: 800;
    color: #f58220; /* oranžová TRIATLON */
    letter-spacing: 1px;
}

.logo span {
    color: #2f5d7c; /* tmavší modrá pro "bazar" */
    font-weight: 600;
    margin-left: 10px;
}

.logo a {
    text-decoration: none;   /* odstraní podtržení */
    color: inherit;          /* převezme barvu z .logo */
}
.search-bar {
    position: absolute; 
    left: 50%;
    transform: translateX(-50%);
}

.search-bar form {
    display: inline-flex;
    align-items: center;
    background: #e6eef3;
    padding: 8px 12px;
    border-radius: 3px;
}

.search-bar input[type="text"] {
    border: none;
    background: transparent;
    outline: none;
    width: 250px;
    font-size: 14px;
}

.hledej_button {
    width: 20px;
    height: 20px;
    background: url('/design/search-icon.png') no-repeat center;
    background-size: contain;
    border: none;
    cursor: pointer;
}

.header-graphics {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end; /* zarovnání dolů */
    justify-content: flex-end;
}

.header-graphics img {
    margin-top: 50px;
    max-height: 250px;
}

/* Levý sloupec - Kategorie */
.sidebar-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-new-ad {
    background-color: #f39200;
    color: white;
    border: none;
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

.btn-new-ad a{
    text-decoration: none;
}

.cat-group {
    background: #e8e8e8;
    margin-bottom: 5px;
}

.cat-group h3 {
    background-color: #5b84a2; /* Tmavší modrá pro nadpisy kategorií */
    color: white;
    margin: 0;
    padding: 8px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
}

.cat-group ul {
    list-style: none;
    padding: 5px 10px;
    margin: 0;
    font-size: 0.85em;
}

.cat-group li {
    padding: 3px 0;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

/* Střední část - Reklamní plochy a Inzeráty */
.ad-top-placeholder {
    background: #e0e0e0;
    height: 180px; /* Velký šedý obdélník nahoře */
    margin-bottom: 20px;
}

.listings h2 {
    font-size: 1.1em;
    border-bottom: 2px solid #ccc;
    padding-bottom: 5px;
}

/* Karta inzerátu */
.ad-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    background: #efefef; /* Světle šedý podklad inzerátu */
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
}

.ad-img img {
    width: 100%;
    height: auto;
    border: 1px solid #ccc;
}

.ad-info {
    padding-left: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ad-info h4 { margin: 0; color: #000; }
.ad-info p { font-size: 0.85em; color: #555; }

/* Patička inzerátu s tlačítky */
.ad-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8em;
}

.price {
    background: #2d6da3; /* Modrá plocha pro cenu */
    color: white;
    padding: 4px 10px;
}

.detail {
    background: #87ceeb; /* Světle modrá pro tlačítko detailu */
    border: none;
    color: white;
    padding: 4px 10px;
    cursor: pointer;
}

/* Pravý sloupec - Reklama */
.sidebar-right {
    min-height: 500px;
}



/* HAMBURGER */
.menu-toggle {
    display: none;
    font-size: 28px;
    cursor: pointer;
    padding: 10px;
}

/* základ – karta */
.inzerat {
    border-bottom: 1px solid #ddd;
    padding: 15px 0;
}

.inzerat-link {
    text-decoration: none;
    color: inherit;
}

/* layout */
.inzerat-inner {
    display: flex;
    gap: 15px;
}

.inzerat-image img {
    width: 150px;
    height: auto;
    border-radius: 6px;
}

.inzerat-content {
    flex: 1;
}

.nadpis {
    font-size: 18px;
    margin: 0 0 5px;
}

.cena {
    font-weight: bold;
    color: #f58220;
    font-size: 14px;
    padding: 4px 10px;
}

.popisek {
    font-size: 12px;
    color: #777;
}

/* MOBILE */
@media (max-width: 768px) {

    .menu-toggle {
        display: block;
    }
    
    .main-header {
        height:160px;
    }
    .logo {
        padding-bottom:40px;
    }

    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* skrytí levého menu */
    .sidebar-left {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100%;
        background: #fff;
        z-index: 9999;
        overflow-y: auto;
        transition: 0.3s;
        padding: 20px;
    }

    /* aktivní menu */
    .sidebar-left.active {
        left: 0;
    }

    /* overlay (ztmavení) */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }

    .menu-overlay.active {
        display: block;
    }

    /* layout */
    .container {
        flex-direction: column;
    }

    .sidebar-right {
        display: none; /* optional – doporučuju skrýt */
    }
    .header-graphics{
        display: none;
    }
    .content {
        width: 100%;
    }

    /* search box */
    .search-bar {
        width: 100%;
        margin-top: 10px;
        left: 70%;
        top:110px;
    }
    
    .inzerat {
        border: 1px solid #eee;
        border-radius: 10px;
        padding: 10px;
        margin-bottom: 10px;
        background: #fff;
    }

    .inzerat-inner {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .inzerat-image img {
        width: 90px;
        height: 90px;
        object-fit: cover;
        border-radius: 8px;
    }

    .nadpis {
        font-size: 15px;
        line-height: 1.2;
        margin-bottom: 5px;
    }

    .cena {
        font-size: 14px;
    }

    .popisek {
        font-size: 11px;
        position: relative;
        left: -50%;
    }

    /* ? SKRYJEME POPIS */
    .text_inzeratu {
        display: none;
    }

    /* ? skryjeme staré věci */
    .detail {
        display: none;
    }
    
    .btn-new-ad {
        width:190px;
    }
#paticka {
  margin-left: 0px;
}
}

@media (min-width: 769px) and (max-width: 1024px) {

    /* layout – 2 sloupce */
    .listings {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .inzerat {
        border: 1px solid #eee;
        border-radius: 10px;
        padding: 12px;
        background: #fff;
    }

    .inzerat-inner {
        display: block; /* na tabletu stacked */
    }

    .inzerat-image img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        border-radius: 8px;
        margin-bottom: 10px;
    }

    .nadpis {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .cena {
        font-size: 17px;
    }

    .popisek {
        font-size: 12px;
    }

    /* ? stále skrýt popis (doporučeno) */
    .text_inzeratu {
        display: none;
    }
    
    .header-graphics{
        display: none;
    }

    /* sidebar pryč – víc místa */
    .sidebar-left {
        display: none;
    }

    .sidebar-right {
        display: none;
    }

    .container {
        display: block;
    }

    .content {
        width: 100%;
    }
}
@media (max-width: 1024px) {
    .main-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        
    }
}
