﻿/* ===== TOPBAR (hlavička) ===== */

.topbar {
    background: var(--bg, #f7f6f2);
    border-bottom: 1px solid var(--line, #eae7e3);
	position: relative;
	z-index: 5000;
}
.topbar.sticky-top{
  z-index: 99999 !important;
  position: sticky; 
  top: 0;
}
/* horní lišta s účtem/košíkem a lupou */
.topbar-upper,
.topbar-lower {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-upper {
    padding: 6px 0;
    color: var(--muted, #6b6b6b);
    font-size: 14px;
}

    .topbar-upper .account {
        display: flex;
        gap: 16px;
        align-items: center;
        margin-left: auto;
    }

    .topbar-upper .link {
        color: var(--text, #3f3f3f);
        text-decoration: none;
    }

        .topbar-upper .link:hover {
            color: var(--brand, #2a9aa5);
        }

.search-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 4px 6px;
}

/* spodní lišta s logem a menu */
.topbar-lower {
    padding: 10px 0;
}

.logo {
    font-size: 48px; /* pokud je to <a>, když je <img>, nevadí */
    color: var(--brand, #2a9aa5);
    text-decoration: none;
    letter-spacing: 2px;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: -30px;
}

.menu {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    align-items: center;
}

    .menu .item {
        letter-spacing: 2px;
        font-size: 14px;
        text-decoration: none;
        color: #4a4a4a;
        padding: 6px 0;
        border-bottom: 2px solid transparent;
    }

        .menu .item:hover {
            color: var(--brand, #2a9aa5);
        }

        .menu .item.active {
            color: var(--accent, #d79a4a);
            border-bottom-color: var(--accent, #d79a4a);
        }

/* ===== VYHLEDÁVÁNÍ (panel pod topbarem) ===== */

.searchbox {
    display: none; /* defaultně schované – otevírá se .open */
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid var(--line, #eae7e3);
}

    .searchbox.open {
        display: flex;
        flex-direction: column; /* dvě řádky pod sebou (pole/tlačítka + volby) */
    }

.search-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    flex: 1;
    min-width: 260px;
    padding: 8px 10px;
    border: 1px solid var(--line, #eae7e3);
    border-radius: 10px;
    background: #fff;
}

.btn-search,
.btn-clear {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--line, #eae7e3);
    cursor: pointer;
    background: #fff;
    font-weight: 500;
}

.btn-search {
    background: var(--brand, #2a9aa5);
    color: #fff;
    border-color: transparent;
}

    .btn-search:hover {
        background: #248992;
    }

.btn-clear:hover {
    background: #fafafa;
}

.advanced-link {
    margin-left: 0; /* už není potřeba auto */
    order: 0;
    color: var(--brand, #2a9aa5);
    font-weight: 600;
    text-decoration: none;
}

    .advanced-link:hover {
        text-decoration: underline;
    }

.search-options {
    font-size: 14px;
    color: var(--muted, #6b6b6b);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    gap: 12px;
}

.keepopen {
    display: flex;
    align-items: center;
    gap: 6px;
    order: 1;
    margin-left: auto; /* pošle checkbox doprava */
}

/* ===== Responsivita topbaru ===== */
@media (max-width:980px) {
    .logo {
        font-size: 36px;
    }

    .menu {
        gap: 18px;
    }
}

@media (max-width:720px) {
    .menu {
        gap: 14px;
    }
}

/* --- dropdown pro Databáze titulů --- */

.menu {
    position: relative;
}

    .menu .has-sub {
        position: relative;
        display: inline-flex;
        align-items: center;
    }

    .menu .item-link {
        letter-spacing: 2px;
        font-size: 14px;
        text-decoration: none;
        color: #4a4a4a;
        padding: 6px 0;
        border-bottom: 2px solid transparent;
    }

    .menu .has-sub:hover .item-link,
    .menu .has-sub:focus-within .item-link {
        color: var(--brand);
    }

    .menu .sub {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 280px;
        background: #fff !important;
        border: 1px solid var(--line);
        border-radius: 10px;
        box-shadow: var(--shadow);
        padding: 8px;
        display: none;
        z-index: 20;
		opacity: 1 !important;
		z-index: 100000 !important;
    }

    .menu .has-sub:hover .sub,
    .menu .has-sub:focus-within .sub {
        display: block;
    }

    .menu .sub-item {
        display: block;
        padding: 10px 12px;
        border-radius: 8px;
        color: var(--text);
        text-decoration: none;
        white-space: nowrap;
    }

        .menu .sub-item:hover {
            background: #faf9f6;
            color: var(--brand);
        }

    /* volitelně: menší mezera mezi hlavními položkami */
    .menu .item {
        margin-right: 28px;
    }

    .menu .has-sub {
        margin-right: 28px;
    }

/* skupina s vnořeným submenu */
.sub-group {
    position: relative;
}

/* Historie objednávek = normální odkaz, jen s šipkou vpravo */
.sub-item-toggle {
    position: relative;
    padding-right: 2.4rem; /* místo pro šipku */
}

    /* šipka vpravo */
    .sub-item-toggle::after {
        content: "▾";
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-size: .8em;
        opacity: .6;
        transition: transform .15s ease;
    }

.sub-group.is-open .sub-item-toggle::after {
    transform: translateY(-50%) rotate(180deg);
}

/* vnořené menu – použije stejné krabicové styly jako ostatní .sub,
   jen se otevírá pod řádkem Historie */
.menu .sub-group .sub {
    top: calc(100% + 8px);
    left: 0;
}

/* zabránit tomu, aby se nested submenu zobrazovalo jen hoverem na OBJEDNÁVKA */
.menu .has-sub:hover .sub.nested,
.menu .has-sub:focus-within .sub.nested {
    display: none;
}

/* zobrazit nested submenu jen když je sub-group otevřený */
.sub-group.is-open > .nested {
    display: block !important;
}

/* odsazení druhé úrovně */
.sub-group .nested-item {
    padding-left: 2.6rem;
    font-size: 0.95em;
}

.cart-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.cart-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: inline-block;
    position: relative;
    top: 2px;
}
