.layout {
    display: flex;
}

.main-layout {
    flex: 1;
}

/* === SIDEBAR STYLING === */

.sidebar {
    width: 14vw;
    min-width: 200px;
    background: #f9f9f9; /* světle šedé pozadí */
    border-right: 1px solid #ddd;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    border-radius: 0 10px 10px 0;
    justify-content: flex-start;
}

.sidebar h3 {
    font-size: 18px;
    margin-bottom: 10px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 4px;
}

.filter_container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
}

.filter_container label {
    font-size: 14px;
    font-weight: 500;
}

.filter_container input[type="number"] {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.brand, .param {
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand label, .param label {
    cursor: pointer;
    font-size: 14px;
}

input[type="checkbox"] {
    transform: scale(1.2);
    accent-color: #14f304; /* barva checkboxu (moderní CSS vlastnost) */
    cursor: pointer;
}

/* === Search bar === */
.search-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    max-width: 500px;
    margin: 20px auto;
    padding: 8px 12px;

    background-color: #f8f8f8;
    border: 1px solid #ccc;
    border-radius: 6px;

    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-bar input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar input[type="text"]:focus {
    border-color: #f0a500;
    box-shadow: 0 0 3px rgba(245, 165, 0, 0.4);
}

.search-bar button {
    background-color: #333;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.search-bar button:hover {
    background-color: #f0a500;
}

.search-bar button:active {
    transform: scale(0.97);
}

/* Products style */

.products_container {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.product {
    display: flex;
    flex-direction: column;
    width: 250px;

    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    box-sizing: border-box;

    text-align: center;
    justify-content: space-between;
}

.product a {
    text-decoration: none;
    color: black;
}

.product img {
    max-width: 100%;
    border-radius: 8px;
    height: 100px;
    object-fit: contain;

}

.price {
    font-weight: bold;
    color: #e44d26;
}

.description {
    max-height: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.read-more {
    color: gray;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
}

.stock {
    margin-top: 10px;
    color: green;
}

.product button {
    background-color: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    margin-top: 2px;
}

.product button:hover {
    background-color: #f0a500;
    transition: 0.2s;
    cursor: pointer;
}

@media (max-width: 768px) {

    /* === Layout === */
    .layout {
        flex-direction: column;
    }

    /* === Sidebar === */
    .sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid #ddd;
        border-radius: 0;
        padding: 10px;
        margin-bottom: 15px;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        align-items: center; /* zarovnání na střed */
        gap: 15px;
    }

    .filter_container {
        width: 100%;
        max-width: 300px;
        display: flex;
        flex-direction: column;
        align-items: center; /* zarovnání vnitřních prvků na střed */
        gap: 6px;
        padding: 5px 0;
    }

    .filter_container h3 {
        font-size: 16px;
        margin-bottom: 6px;
        text-align: center;
        width: 100%;
    }

    .filter_container label,
    .brand label {
        font-size: 13px;
        margin-bottom: 2px;
    }

    .filter_container .price-range {
        display: flex;
        gap: 8px;
        justify-content: center; /* Od - Do vedle sebe na střed */
        align-items: center;
        width: 100%;
    }

    .filter_container input[type="number"] {
        flex: 1;
        font-size: 13px;
        padding: 6px;
    }

    .brand {
        display: flex;
        gap: 4px;
        font-size: 13px;
        align-items: center;
        justify-content: center; /* checkboxy na střed */
    }

    input[type="checkbox"] {
        transform: scale(1.1);
    }

    /* === Search bar === */
    .search-bar {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
        gap: 10px;
        align-items: center;
    }

    .search-bar input[type="text"] {
        width: 100%;
        font-size: 14px;
    }

    .search-bar button {
        width: 100%;
        font-size: 16px;
        padding: 10px;
    }

    /* === Produkty === */
    .products_container {
        justify-content: center;
        gap: 12px;
    }

    .product {
        width: 100%;
        max-width: 340px;
        margin: 0 auto;
        padding: 14px;
    }

    .product img {
        height: 140px;
    }

    .product h2 {
        font-size: 18px;
    }

    .description {
        max-height: 80px;
        font-size: 14px;
    }

    .price {
        font-size: 18px;
    }

    .stock {
        font-size: 14px;
    }

    .product button {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }

    /* === Header === */
    header {
        flex-direction: row; /* nechává prvky vedle sebe */
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
    }

    .logo h1 a {
        font-size: 22px;
        margin: 0;
    }

    nav ul {
        flex-direction: row;
        gap: 10px;
    }

    nav ul li a {
        font-size: 14px;
        padding: 6px 4px;
    }

    /* User menu */
    .user-menu .user-icon img {
        width: 26px;
        height: 26px;
    }

    #cart-count {
        font-size: 16px;
        margin-left: 4px;
    }

    .user-menu .dropdown {
        right: 0;
        width: 160px;
    }
}
