/* =========================================
   HEADER / TOP NAVBAR – SprzedajInstrument
   ========================================= */

.si-header {
    --si-header-field-height: 44px; /* wspólna wysokość inputu i przycisków */
    padding-top: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0;
}

/* Kontener – pełna szerokość viewportu, bez ograniczeń Bootstrap container */
.si-header .container {
    display: flex;
    justify-content: center;
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

/* W środku: pełna szerokość kontenera, max 1296px */
.si-header .header-inner {
    width: 100%;
    max-width: 1296px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

/* Kolumny */

.si-header .header-col {
    display: flex;
    align-items: center;
}

/* Logo */

.si-header .header-col-logo {
    flex: 0 0 auto;
}

.si-header .navbar-brand {
    display: inline-flex;
    align-items: center;
}

/* === LOGO – responsywna szerokość === */

/* Domyślnie: pełny desktop – 300px */
.si-header .navbar-brand img {
    display: block;
    width: 300px !important;   /* pełny desktop */
    max-width: 100%;
    height: auto;
}

/* „Mniejszy” desktop / większy laptop – 200px */
@media (max-width: 1199.98px) and (min-width: 992px) {
    .si-header .navbar-brand img {
        width: 200px !important;
    }
}

/* Tablet poziomy / średnie szerokości – znowu 300px */
@media (max-width: 991.98px) and (min-width: 576px) {
    .si-header .navbar-brand img {
        width: 300px !important;
    }
}

/* Mobile – logo węższe, ~220px, żeby zmieściło się w jednej linii */
@media (max-width: 575.98px) {
    .si-header .navbar-brand img {
        width: 220px !important;
    }
}

/* Środek: wyszukiwarka rozpycha się między logo a prawą stroną */

.si-header .header-col-search {
    flex: 1 1 auto;
    min-width: 0;
}

/* Prawa strona – przyciski */

.si-header .header-col-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 8px;
}

/* ===== WYSZUKIWARKA ===== */

.si-header .header-search-form {
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: 8px;
}

/* Pierwszy element (input) – zajmuje całe dostępne miejsce */
.si-header #searchBar .search-item:first-child {
    flex: 1 1 auto;
}

/* Input jak w AddOrEdit, ale z narzuconą wspólną wysokością */

.si-header .header-search-input {
    background-color: #f2f2f2 !important;
    box-shadow: inset 0 0 0 1000px #f2f2f2 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    padding: 0 16px !important;
    height: var(--si-header-field-height) !important;
    font-size: 1rem !important;
    color: #111 !important;
    outline: none !important;
    width: 100%;
    font-weight: 300;
}

.si-header .header-search-input::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

.si-header .header-search-input:focus {
    box-shadow:
        inset 0 0 0 1000px #f2f2f2,
        0 0 0 3px rgba(168, 63, 31, 0.12) !important;
    border-color: #A83F1F !important;
}

/* Guzik Szukaj – btn-orange zaraz za polem */

.si-header .search-item-button {
    flex: 0 0 auto;
}

.si-header .header-search-button {
    height: var(--si-header-field-height) !important;
    border-radius: 10px !important; /* spójne z inputem */
    padding: 0 18px !important;
    font-size: 0.95rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
}

/* ===== WYSTAW PRZEDMIOT ===== */

.si-header .header-sell-btn {
    white-space: nowrap;
    border-radius: 10px !important; /* jak btn-black */
    height: var(--si-header-field-height) !important;
    padding: 0 20px !important;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
}

/* ===== WYBÓR JĘZYKA ===== */

.si-header .header-lang-form {
    margin: 0;
}

.si-header .language-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-width: 48px;
    max-width: 72px;
    height: var(--si-header-field-height) !important;
    padding: 0 14px !important;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    font-size: 1.05rem;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 12px -8px rgba(15, 23, 42, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.si-header .language-select::-ms-expand {
    display: none;
}

.si-header .language-select option {
    font-size: 0.95rem;
}

/* ===== Logowanie / Rejestracja ===== */

.si-header .header-login {
    margin-left: 4px;
}

.si-header .header-login a {
    font-size: 0.95rem;
    font-weight: 300;
}

.dropdown-item {
    text-align: center;
}


/* ===== RESPONSYWNOŚĆ ===== */

/* Tablet / węższe – logo + prawa strona w pierwszym rzędzie, search pod spodem */

@media (max-width: 991.98px) {
    .si-header .header-inner {
        flex-wrap: wrap;
        align-items: flex-start;
        row-gap: 8px;
        max-width: 100%;
    }

    .si-header .header-col-logo {
        order: 1;
    }

    .si-header .header-col-actions {
        order: 2;
        margin-left: auto;
    }

    .si-header .header-col-search {
        flex: 0 0 100%;
        order: 3;
    }

    .si-header .header-search-form {
        width: 100%;
    }
}

/* Małe telefony – logo węższe, pasek na pełną szerokość jak inne .container */

@media (max-width: 575.98px) {
    .si-header .header-inner {
        flex-wrap: wrap;
        row-gap: 8px;
        justify-content: space-between;
        align-items: center;
    }

    .si-header .header-col-logo {
        order: 1;
        display: flex;
        align-items: center;
        max-width: 50vw;
    }

    .si-header .header-col-actions {
        order: 2;
        margin-left: auto;
    }

    .si-header .header-col-search {
        order: 3;
        flex: 0 0 100%;
    }

    .si-header .header-sell-btn {
        display: none !important;
    }

    .si-header .nav-item-register {
        display: none;
    }

    .si-header .navbar-brand {
        display: flex;
        align-items: center;
        line-height: 1;
    }

 .si-header .container {
        justify-content: flex-start;
    }

    .si-header .navbar-brand img {
        vertical-align: middle;
    }
}


/* =========================================
   SECONDARY NAV – główne kategorie + linki info
   ========================================= */

.si-main-nav {
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 0.9rem;
    font-weight: 300;
}

.si-main-nav .container {
    display: flex;
    justify-content: center;
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

.si-main-nav-inner {
    width: 100%;
    max-width: 1296px;
    margin: 0 auto;
    padding: 4px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Lewa i prawa strona jako listy w jednej linii */

.si-main-nav-left,
.si-main-nav-right {
    display: flex;
    align-items: center;
    gap: 24px; /* większe odstępy między kategoriami */
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Lewa strona rozpycha się, prawa trzyma się prawej krawędzi */

.si-main-nav-left {
    flex: 1 1 auto;
    min-width: 0;
}

.si-main-nav-right {
    flex: 0 0 auto;
}

/* Linki */

.si-main-nav a {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    color: #111111;
    font-weight: 300;
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.si-main-nav a:hover {
    color: #A83F1F;
}

.nav-more {
    position: relative;
}

.nav-more-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 6px 0;
    box-shadow: 0 12px 32px -20px rgba(0,0,0,.25);
    display: none;
    z-index: 100;
}

.nav-more:hover .nav-more-dropdown {
    display: block;
}

.nav-more-dropdown li {
    list-style: none;
}

.nav-more-dropdown a {
    display: block;
    padding: 6px 14px;
    white-space: nowrap;
}

/* Na tabletach (576–992px): kategorie scrollują poziomo, linki info zostają po prawej */

@media (max-width: 991.98px) and (min-width: 576px) {
    .si-main-nav {
        display: block;
    }

    /* Inner: nie scrolluje cały pasek – tylko lewa lista */
    .si-main-nav-inner {
        gap: 0;
        padding: 2px 0;
        overflow: hidden; /* zapobiega overflow całości */
    }

    /* LEWA – kategorie: scroll poziomy, zajmuje dostępne miejsce */
    .si-main-nav-left {
        flex: 1 1 0;
        min-width: 0;           /* pozwala na kurczenie się */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;  /* Firefox */
        gap: 18px;
        padding: 2px 0;
        mask-image: linear-gradient(to right, transparent 0%, black 4%, black 92%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 92%, transparent 100%);
    }

    .si-main-nav-left::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    /* PRAWA – linki info: nie scrolluje, przyklejona do prawej krawędzi */
    .si-main-nav-right {
        flex: 0 0 auto;
        gap: 14px;
        padding: 2px 0 2px 12px;
        border-left: 1px solid #e5e7eb;
        margin-left: 8px;
    }

    /* Ukryj "Więcej ▾" – scroll zastępuje dropdown */
    .nav-more {
        display: none;
    }
}

/* Na małych telefonach (< 576px): chowamy cały pasek */
@media (max-width: 575.98px) {
    .si-main-nav {
        display: none;
    }
}

@media (max-width: 900px) {

    .nav-item.dropdown > .dropdown-menu {
        display: none;
        position: static !important;
        width: 100%;
        border: none;
        box-shadow: none;
        margin-top: 6px;
        transform: none !important;
        inset: auto !important;
    }

    .nav-item.dropdown.is-open > .dropdown-menu {
        display: block !important;
    }
}