body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

/* ================= NAVBAR ================= */
.custom-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, rgba(22, 3, 3, 0.80) 0%, rgba(8, 0, 0, 0.60) 100%);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid rgba(255, 26, 26, 0.12);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    transition: background 0.4s cubic-bezier(.4,0,.2,1), border-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
    z-index: 9999;
}

/* Animowana, świecąca linia na dole navbaru */
.custom-navbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(230, 0, 0, 0.5), rgba(255, 26, 26, 0.85), rgba(230, 0, 0, 0.5), transparent);
    opacity: 0.45;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.custom-navbar.is-scrolled {
    background: linear-gradient(180deg, rgba(13, 0, 0, 0.96) 0%, rgba(9, 0, 0, 0.92) 100%);
    border-bottom-color: rgba(138, 0, 0, 0.7);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
    padding: 7px 0;
}

.custom-navbar.is-scrolled::after { opacity: 1; }

/* ================= INNER ================= */
.nav-inner {
    width: 95%;
    max-width: 1800px;
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ================= LOGO ================= */
.nav-brand img {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.4s ease;
}

@media (min-width: 1600px) {
    .nav-brand img { width: 72px; height: 46px; }
    .nav-inner { gap: 18px; }
}

.nav-brand img:hover {
    transform: scale(1.05);
}
/* ================= 1. NOWY TRIGGER W NAVBARZE ================= */
/* ================= 1. NOWY TRIGGER W NAVBARZE ================= *//* ================= 1. NOWY TRIGGER W NAVBARZE (Poprawione rozmiary) ================= */
.nav-search-trigger {
    display: flex;
    align-items: center;
    gap: 12px; /* Zamiast vw */
    background: rgba(20, 0, 0, 0.6);
    border: 1px solid rgba(255, 26, 26, 0.15); /* Zamiast vw */
    padding: 0 16px; /* Zamiast vw */
    border-radius: 25px; /* Pigułka */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 50px; /* STAŁA WYSOKOŚĆ - to naprawi problem */
    min-width: 250px; /* STAŁA SZEROKOŚĆ */
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Subtelny gradient */
.nav-search-trigger::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, rgba(255, 26, 26, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-search-trigger i {
    color: #FF1A1A;
    font-size: 16px; /* Stały rozmiar lupy */
    z-index: 1;
    transition: transform 0.3s ease;
}

.search-placeholder {
    color: #888;
    font-size: 14px; /* Stały rozmiar tekstu */
    font-weight: 500;
    letter-spacing: 0.5px;
    z-index: 1;
    transition: color 0.3s ease;
}

/* Efekty na Hover */
.nav-search-trigger:hover {
    border-color: #FF1A1A;
    background: rgba(30, 0, 0, 0.8);
    box-shadow: 0 0 15px rgba(255, 26, 26, 0.15), inset 0 0 5px rgba(255, 26, 26, 0.05);
    transform: translateY(-2px);
}

.nav-search-trigger:hover::before {
    opacity: 1;
}

.nav-search-trigger:hover i {
    transform: scale(1.1);
}

.nav-search-trigger:hover .search-placeholder {
    color: #fff;
}
/* ================= 2. MODAL COMMAND PALETTE ================= */
.cmd-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px); /* Mocniejsze rozmycie tła strony */
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 12vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cmd-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Główne okno modala z efektem szkła (Glassmorphism) */
.cmd-modal {
    width: 42vw;
    min-width: 500px;
    background: rgba(13, 0, 0, 0.85); /* Lekko przezroczyste */
    backdrop-filter: blur(15px); /* Rozmycie pod samym oknem */
    border: 1px solid rgba(255, 26, 26, 0.15); /* Subtelna ramka */
    border-radius: 1.5vw; /* Zaokrąglone rogi pasujące do navbaru */
    box-shadow: 0 2vw 5vw rgba(0, 0, 0, 0.9), 0 0 3vw rgba(255, 26, 26, 0.08); /* Miękki, głęboki cień */
    overflow: hidden;
    transform: scale(0.95) translateY(-2vh);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

.cmd-overlay.active .cmd-modal {
    transform: scale(1) translateY(0);
}

/* --- HEADER --- */
.cmd-header {
    display: flex;
    align-items: center;
    padding: 1.2vw 1.5vw;
    border-bottom: 1px solid rgba(255, 26, 26, 0.1); /* Bardzo delikatna linia oddzielająca */
    gap: 1.2vw;
}

.search-icon {
    color: #FF1A1A;
    font-size: 1.3vw;
    filter: drop-shadow(0 0 0.5vw rgba(255, 26, 26, 0.4)); /* Lekkie świecenie lupy */
}

.cmd-header input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1.2vw;
    font-family: 'Poppins', sans-serif;
}

.cmd-header input::placeholder {
    color: #555;
    font-weight: 300;
}

.cmd-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1.2vw;
    width: 2.6vw;
    height: 2.2vw;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cmd-close:hover { 
    background: rgba(255, 26, 26, 0.2);
    color: #FF1A1A; 
}

/* --- BODY --- */
.cmd-body {
    padding: 0.8vw;
    max-height: 55vh;
    overflow-y: auto;
}

/* Ukrycie paska przewijania (dla czystości) */
.cmd-body::-webkit-scrollbar {
    width: 0.4vw;
}
.cmd-body::-webkit-scrollbar-thumb {
    background: rgba(255, 26, 26, 0.2);
    border-radius: 1vw;
}

.cmd-group-title {
    padding: 1vw 1vw 0.5vw;
    color: #555;
    font-size: 0.7vw;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1vw;
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 1.2vw;
    padding: 0.8vw 1.2vw;
    margin-bottom: 0.4vw;
    border-radius: 1vw; /* Mocniej zaokrąglone elementy listy */
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Nowy Hover - lżejszy i bardziej elegancki */
.cmd-item:hover, .cmd-item.selected {
    background: linear-gradient(90deg, rgba(255, 26, 26, 0.08), transparent);
    border-color: rgba(255, 26, 26, 0.1);
    transform: translateX(0.3vw); /* Delikatne przesunięcie w prawo przy najechaniu */
}

.cmd-icon {
    width: 2.5vw;
    height: 2.5vw;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%; /* Okrągłe ikony */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cmd-item:hover .cmd-icon {
    background: rgba(255, 26, 26, 0.15);
    color: #FF1A1A;
    border-color: rgba(255, 26, 26, 0.3);
    box-shadow: 0 0 1vw rgba(255, 26, 26, 0.2);
}

.cmd-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cmd-name {
    color: #eee;
    font-size: 0.95vw;
    font-weight: 500;
}

.cmd-desc {
    color: #666;
    font-size: 0.75vw;
    margin-top: 0.1vw;
}

.cmd-item .arrow {
    color: #FF1A1A;
    font-size: 0.9vw;
    opacity: 0;
    transition: all 0.3s ease;
    transform: translateX(-1vw);
}

.cmd-item:hover .arrow {
    opacity: 1;
    transform: translateX(0);
}

/* --- Podpowiedzi produktów (autocomplete) w palecie wyszukiwania --- */
#cmdResults { display: none; }
.cmd-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.cmd-item.selected .arrow {
    opacity: 1;
    transform: translateX(0);
}
.cmd-empty {
    padding: 1.4vw 1.2vw;
    color: #777;
    font-size: 0.85vw;
    line-height: 1.5;
    text-align: center;
}
.cmd-empty kbd {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 0.3vw;
    padding: 0 0.4vw;
    color: #ccc;
    font-size: 0.8vw;
}

/* === Wyszukiwanie po zdjęciu (camera / reverse image search) === */
.cmd-cam-btn {
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: #aaa;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .2s ease;
    margin-right: 0.4vw;
    font-size: 15px;
}
.cmd-cam-btn:hover {
    color: #FF1A1A;
    border-color: rgba(255,26,26,0.4);
    background: rgba(255,26,26,0.1);
    box-shadow: 0 0 12px rgba(255,26,26,0.25);
}

.cmd-img-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px 6px;
    color: #aaa; font-size: 13px;
}
.cmd-img-head img {
    width: 40px; height: 40px; border-radius: 8px;
    object-fit: cover; border: 1px solid rgba(255,26,26,0.35);
}
.cmd-img-head b { color: #eee; font-weight: 600; }
.cmd-img-head .cih-x { margin-left: auto; cursor: pointer; color: #777; padding: 4px 8px; border-radius: 6px; }
.cmd-img-head .cih-x:hover { color: #FF1A1A; background: rgba(255,26,26,0.08); }

.cmd-imggrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 12px;
    padding: 8px 16px 16px;
}
.cmd-imgcard { text-decoration: none; display: flex; flex-direction: column; gap: 5px; }
.cmd-imgcard-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    transition: box-shadow .25s ease, border-color .25s ease;
}
.cmd-imgcard-thumb > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmd-imgcard:hover .cmd-imgcard-thumb { border-color: rgba(255,26,26,0.35); }
/* karta z trafieniem na pod-zdjęciu (model/QC) — lekko się podświetla */
.cmd-imgcard.has-match .cmd-imgcard-thumb {
    border-color: rgba(255,26,26,0.4);
    box-shadow: 0 0 10px rgba(255,26,26,0.22);
}

/* kwadracik z dopasowanym zdjęciem w prawym dolnym rogu głównego */
.cmd-match-badge {
    position: absolute;
    right: 6%; bottom: 6%;
    width: 44%; height: 44%;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.9);
    animation: cmdMatchGlow 1.9s ease-in-out infinite;
}
.cmd-match-badge > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmd-match-badge .cmb-tag {
    position: absolute; left: 0; right: 0; bottom: 0;
    font-size: 8px; line-height: 1.5; text-align: center;
    background: rgba(255,26,26,0.85); color: #fff; font-weight: 700; letter-spacing: .04em;
}
@keyframes cmdMatchGlow {
    0%,100% { box-shadow: 0 0 0 1px rgba(255,26,26,0.45), 0 0 6px rgba(255,26,26,0.3), 0 2px 6px rgba(0,0,0,0.5); }
    50%     { box-shadow: 0 0 0 1px rgba(255,26,26,0.85), 0 0 15px rgba(255,26,26,0.6), 0 2px 6px rgba(0,0,0,0.5); }
}

.cmd-imgcard-name {
    font-size: 11px; color: #ddd; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cmd-imgcard-meta { font-size: 10.5px; color: #777; }
.cmd-imgcard-meta .pct { color: #FF6B6B; }

.cmd-img-loading { padding: 26px; text-align: center; color: #999; font-size: 13px; }
.cmd-img-loading .spin {
    display: inline-block; width: 22px; height: 22px; margin-bottom: 8px;
    border: 2px solid rgba(255,26,26,0.25); border-top-color: #FF1A1A;
    border-radius: 50%; animation: cmdSpin .8s linear infinite;
}
@keyframes cmdSpin { to { transform: rotate(360deg); } }

/* === Wyraźny aparat przy Ctrl+K (w pasku wyszukiwania) === */
.nav-search-cam {
    flex-shrink: 0;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF2A2A, #c81212);
    color: #fff;
    border: none;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(255, 26, 26, 0.4);
    transition: transform .15s ease, box-shadow .2s ease;
    position: relative;
    z-index: 1;
}
.nav-search-cam:hover { transform: scale(1.12); box-shadow: 0 0 16px rgba(255, 26, 26, 0.65); }
.nav-search-cam:active { transform: scale(0.96); }
.nav-search-cam::after {
    content: '';
    position: absolute; inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(255, 42, 42, 0.55);
    animation: navCamPulse 2.2s ease-out infinite;
    pointer-events: none;
}
@keyframes navCamPulse {
    0%   { transform: scale(0.85); opacity: 0.7; }
    70%  { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}
@media (max-width: 1280px) {
    .nav-search-cam { width: 28px; height: 28px; font-size: 13px; margin-left: 6px; }
    /* Gdy aparat (image-search) jest wstrzyknięty do paska, na telefonie rozwijamy
       trigger w pigułkę zamiast koła — inaczej lupa i aparat nachodzą na siebie
       (koło 35–42px nie mieści obu, a overfl:hidden ucina aparat). */
    .nav-inner .nav-search-trigger:has(.nav-search-cam) {
        width: auto;
        min-width: 42px;
        padding: 0 9px;
        gap: 7px;
        border-radius: 24px;
        overflow: visible;
    }
}

/* === GUI po kliknięciu aparatu: wklej / przeciągnij / wgraj === */
.kf-img-chooser {
    position: fixed;
    z-index: 2147483647;
    width: 264px;
    background: #161011;
    border: 1px solid rgba(255, 42, 42, 0.28);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    color: #eee;
    animation: kfIcIn .14s ease;
}
@keyframes kfIcIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.kf-ic-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 11px;
}
.kf-ic-title svg { color: #FF2A2A; width: 16px; height: 16px; }
.kf-ic-drop {
    border: 1.5px dashed rgba(255, 255, 255, 0.18);
    border-radius: 11px;
    padding: 18px 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
    outline: none;
}
.kf-ic-drop:hover, .kf-ic-drop:focus, .kf-ic-drop.over {
    border-color: rgba(255, 42, 42, 0.65);
    background: rgba(255, 42, 42, 0.07);
}
.kf-ic-drop-ic { color: #FF2A2A; margin-bottom: 7px; display: flex; justify-content: center; }
.kf-ic-drop-ic svg { width: 26px; height: 26px; }
.kf-ic-drop-t { font-size: 13px; color: #ddd; }
.kf-ic-drop-t kbd {
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px; padding: 0 5px; font-size: 11px; color: #fff;
}
.kf-ic-drop-s { font-size: 11px; color: #888; margin-top: 4px; }
.kf-ic-upload {
    width: 100%; margin-top: 11px;
    background: linear-gradient(135deg, #FF2A2A, #c81212);
    color: #fff; border: none; border-radius: 11px; padding: 11px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: filter .15s ease;
}
.kf-ic-upload svg { width: 16px; height: 16px; }
.kf-ic-upload:hover { filter: brightness(1.12); }

/* === Pasek wyników po zdjęciu: Przeglądaj + wyczyść === */
.cmd-img-head { gap: 8px; }
.cmd-img-head .cih-count { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-img-head .cih-browse,
.cmd-img-head .cih-x {
    margin-left: 0; flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 5px;
    cursor: pointer; border-radius: 7px; padding: 5px 9px; font-size: 12px;
    transition: filter .15s ease, background .15s ease, color .15s ease;
}
.cmd-img-head .cih-browse { color: #fff; background: linear-gradient(135deg, #FF2A2A, #c81212); font-weight: 600; }
.cmd-img-head .cih-browse:hover { filter: brightness(1.12); }
.cmd-img-head .cih-browse svg { width: 13px; height: 13px; }
.cmd-img-head .cih-x { color: #888; }
.cmd-img-head .cih-x:hover { color: #FF6B6B; background: rgba(255, 42, 42, 0.08); }

/* === Widok "Przeglądaj": pełnoekranowa galeria (jak spreadsheet) === */
.kf-imgbrowse {
    position: fixed; inset: 0; z-index: 2147483646;
    background: rgba(8, 5, 6, 0.93); backdrop-filter: blur(6px);
    display: flex; flex-direction: column; animation: kfIbIn .2s ease;
}
@keyframes kfIbIn { from { opacity: 0; } to { opacity: 1; } }
.kf-ib-bar {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 22px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.kf-ib-q { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; border: 2px solid rgba(255, 42, 42, 0.5); }
.kf-ib-title { color: #fff; font-size: 18px; font-weight: 700; }
.kf-ib-title b { color: #FF6B6B; }
.kf-ib-hint { color: #888; font-size: 13px; }
.kf-ib-close {
    margin-left: auto; width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ccc; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.kf-ib-close:hover { background: rgba(255, 42, 42, 0.15); color: #fff; border-color: rgba(255, 42, 42, 0.4); }
.kf-ib-close svg { width: 20px; height: 20px; }
.kf-ib-grid {
    flex: 1; overflow-y: auto; align-content: start;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px; padding: 22px;
}
.kf-bcard { text-decoration: none; display: flex; flex-direction: column; gap: 8px; }
.kf-bc-stage {
    position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden;
    background: #1a1414; border: 1px solid rgba(255, 255, 255, 0.07);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.kf-bcard:hover .kf-bc-stage { border-color: rgba(255, 42, 42, 0.4); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
.kf-bc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .4s ease; }
.kf-bc-main { opacity: 1; }
.kf-bc-alt { opacity: 0; }
.kf-bcard.swapped .kf-bc-main { opacity: 0; }
.kf-bcard.swapped .kf-bc-alt { opacity: 1; }
.kf-bc-score {
    position: absolute; top: 8px; left: 8px; z-index: 3;
    background: rgba(0, 0, 0, 0.6); color: #FF8585; font-size: 11px; font-weight: 700;
    padding: 2px 7px; border-radius: 20px;
}
.kf-bc-mini {
    position: absolute; right: 9px; bottom: 9px; z-index: 3;
    width: 38%; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
    border: 2px solid #fff; cursor: pointer;
    box-shadow: 0 0 0 1px rgba(255, 42, 42, 0.5), 0 4px 14px rgba(0, 0, 0, 0.55);
    transition: transform .2s ease, box-shadow .2s ease;
}
.kf-bc-mini:hover { transform: scale(1.06); box-shadow: 0 0 0 2px rgba(255, 42, 42, 0.9), 0 6px 18px rgba(0, 0, 0, 0.6); }
.kf-bc-mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .4s ease; }
.kf-bc-mini-alt { opacity: 1; }
.kf-bc-mini-main { opacity: 0; }
.kf-bcard.swapped .kf-bc-mini-alt { opacity: 0; }
.kf-bcard.swapped .kf-bc-mini-main { opacity: 1; }
.kf-bc-tag {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    background: rgba(255, 42, 42, 0.88); color: #fff; font-size: 9px; font-weight: 700;
    text-align: center; letter-spacing: .04em; line-height: 1.5;
}
.kf-bc-meta { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.kf-bc-name {
    color: #eee; font-size: 13px; line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.kf-bc-sub { color: #888; font-size: 12px; }
@media (max-width: 700px) {
    .kf-ib-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 14px; }
    .kf-ib-hint { display: none; }
}

/* --- FOOTER --- */
.cmd-footer {
    padding: 1vw 1.5vw;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 26, 26, 0.05);
    display: flex;
    gap: 2vw;
}

.cmd-hint {
    color: #666;
    font-size: 0.75vw;
    display: flex;
    align-items: center;
    gap: 0.5vw;
}

.key-hint {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2vw 0.5vw;
    border-radius: 0.4vw;
    color: #aaa;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75vw;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
/* ================= KUPONY I NOWOŚCI - GOLD NAV ITEM ================= */
.nav-qc-btn {
    border-color: rgba(0, 255, 153, 0.45) !important;
    color: #00FF99 !important;
    background: rgba(0, 255, 153, 0.05) !important;
}
.nav-qc-btn i { color: #00FF99 !important; }
.nav-qc-btn:hover {
    background: rgba(0, 255, 153, 0.12) !important;
    border-color: #00FF99 !important;
    color: #66ffbb !important;
}
.nav-qc-btn.active {
    background: rgba(0, 255, 153, 0.18) !important;
    border-color: #00FF99 !important;
    box-shadow: 0 0 12px rgba(0, 255, 153, 0.25);
}

.nav-kupony-btn {
    border-color: rgba(255, 215, 0, 0.55) !important;
    color: #FFD700 !important;
    background: rgba(255, 215, 0, 0.06) !important;
    animation: kuponyGlow 2.8s ease-in-out infinite;
}

.nav-kupony-btn:hover {
    background: rgba(255, 215, 0, 0.14) !important;
    border-color: #FFD700 !important;
    color: #ffe566 !important;
}

.nav-kupony-badge {
    display: inline-flex;
    align-items: center;
    background: #FFD700;
    color: #111;
    font-size: 0.55rem;
    font-weight: 800;
    border-radius: 4px;
    padding: 0 5px;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1;
    height: 1.2vw;
    min-height: 14px;
    animation: kuponyBadgePulse 2.8s ease-in-out infinite;
}

@keyframes kuponyGlow {
    0%, 100% { border-color: rgba(255, 215, 0, 0.55); box-shadow: none; }
    50% { border-color: rgba(255, 215, 0, 0.85); box-shadow: 0 0 10px rgba(255, 215, 0, 0.15); }
}

@keyframes kuponyBadgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* ================= MENU ================= */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
    margin-left: 8px;
    align-items: center;
}

.nav-menu > li { display: flex; align-items: center; }

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #cccccc;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    line-height: 1;
    height: 36px;
    white-space: nowrap;
}

/* Bardzo szerokie ekrany - lekko większy tekst */
@media (min-width: 1600px) {
    .nav-link { font-size: 13px; padding: 9px 12px; height: 38px; gap: 6px; }
    .nav-menu { gap: 5px; margin-left: 10px; }
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(230, 0, 0, 0.10);
    border-color: rgba(255, 26, 26, 0.22);
}

.nav-menu > li > .nav-link.active:not(.nav-qc-btn):not(.nav-kupony-btn) {
    color: #fff;
    background: rgba(230, 0, 0, 0.14);
    border-color: rgba(230, 0, 0, 0.45);
    box-shadow: inset 0 0 14px rgba(230, 0, 0, 0.12), 0 2px 10px rgba(230, 0, 0, 0.15);
}

/* Świecący wskaźnik pod aktywnym linkiem */
.nav-menu > li > .nav-link.active:not(.nav-qc-btn):not(.nav-kupony-btn)::after {
    content: '';
    position: absolute;
    left: 22%;
    right: 22%;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #FF1A1A, transparent);
    box-shadow: 0 0 8px rgba(255, 26, 26, 0.7);
}

.nav-link i {
    font-size: 14px;
    transition: transform 0.3s ease, color 0.3s ease;
    line-height: 1;
}

.nav-link:hover i {
    transform: translateY(-2px) scale(1.05);
    color: #FF1A1A;
}

/* ================= DROPDOWN ================= */
.dropdown { position: relative; }

.dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 20px;
}

.dropdown-menu {
    position: absolute;
    top: 120%;
    left: 0;
    min-width: max-content;
    padding: 8px;
    background: linear-gradient(160deg, rgba(26, 2, 2, 0.97), rgba(13, 0, 0, 0.97));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(138, 0, 0, 0.8);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 26, 26, 0.06);
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(.4,0,.2,1), transform 0.35s cubic-bezier(.4,0,.2,1);
    z-index: 100;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #ddd;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    transition: 0.25s ease;
}

.dropdown-menu a i {
    color: #FF1A1A;
    width: 16px;
    text-align: center;
    transition: transform 0.25s ease;
}

.dropdown-menu a:hover {
    background: linear-gradient(90deg, #8A0000, #6a0000);
    color: white;
    transform: translateX(3px);
}

.dropdown-menu a:hover i {
    color: #fff;
    transform: scale(1.12);
}

.arrow {
    font-size: 9px;
    transition: 0.3s ease;
}

.dropdown:hover .arrow {
    transform: rotate(180deg);
}

/* ================= SETTINGS, FAVS & PREFS ================= */
/* push menu items grupę w lewo, a co po niej (auth, settings, hamburger) w prawo */
.nav-menu {
    margin-right: auto;
}
.nav-auth {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-auth:empty { display: none; }

/* --- STYL PRZYCISKU ULUBIONE (PEŁNE SERCE) --- */
.nav-fav-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #E60000;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-fav-btn i {
    font-size: 18px;
    filter: drop-shadow(0 0 3px rgba(230, 0, 0, 0.3));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-fav-btn:hover {
    background: #140000;
    border-color: #8A0000;
    box-shadow: 0 0 15px rgba(230, 0, 0, 0.4);
    transform: translateY(-1px);
}

.nav-fav-btn:hover i {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.6));
}

/* --- USTAWIENIA (segmentowy kontroler z ikonami) --- */
.nav-settings-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(20, 0, 0, 0.55);
    border: 1px solid rgba(255, 26, 26, 0.16);
    border-radius: 13px;
    padding: 4px;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.nav-settings-trigger:hover {
    border-color: rgba(255, 26, 26, 0.5);
    background: rgba(36, 0, 0, 0.7);
    box-shadow: 0 0 18px rgba(230, 0, 0, 0.22);
}

.nav-prefs {
    display: flex;
    align-items: center;
    gap: 0;
    background: transparent;
    border: none;
    padding: 0;
    color: #d8d8d8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1;
}

/* Segment: ikona + wartość (globus / moneta / sklep) */
.nav-pref-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-pref-item:not(:first-child) {
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.08);
}

.nav-pref-item i {
    font-size: 12px;
    color: #FF1A1A;
    transition: transform 0.25s ease;
}

.nav-pref-item span { color: #ededed; }

.nav-pref-item:hover {
    background: rgba(255, 26, 26, 0.12);
}

.nav-pref-item:hover i {
    transform: scale(1.15);
}

/* Stary separator '|' – ukryty, gdyby JS nie zdążył przebudować */
.nav-prefs-sep { display: none; }

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(160deg, #E60000, #8A0000);
    border: 1px solid rgba(255, 26, 26, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.btn-icon i {
    color: #ffffff;
    font-size: 15px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.nav-settings-trigger:hover .btn-icon {
    box-shadow: 0 0 14px rgba(230, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Zębatka: płynny obrót na hover (zastępuje wieczną pętlę JS — działa na każdej stronie) */
.btn-icon i { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.nav-settings-trigger:hover .btn-icon i { transform: rotate(90deg); }

/* Średnie ekrany (1280–1450px): chowamy etykiety, zostają same ikony */
@media (max-width: 1450px) {
    .nav-pref-item span { display: none; }
    .nav-pref-item { padding: 6px 8px; }
}
/* ==========================================
   MOBILE RESPONSIVENESS (RWD) - NAVBAR
   ========================================== */

/* Domyślnie ukrywamy hamburgera na komputerach */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
    z-index: 10001; /* Zawsze nad menu */
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #fff;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}
/* ==========================================
   IKONA NEWSÓW I DYMEK
   ========================================== */
.nav-news-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-news-btn {
    color: var(--text-main);
    font-size: 1.3rem;
    position: relative;
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
}
.nav-news-btn:hover { color: var(--primary); }

/* Pulsująca kropka powiadomienia */
.news-pulse-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 10px; height: 10px;
    background-color: var(--primary);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}
.news-pulse-dot::after {
    content: '';
    position: absolute;
    top: -2px; left: -2px; width: 10px; height: 10px;
    background-color: var(--primary);
    border-radius: 50%;
    animation: pulseRed 2s infinite;
}
@keyframes pulseRed {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}


.nav-news-btn {
    position: relative;
    color: #fff;
    font-size: 1.4rem;
    transition: 0.3s;
}

.news-pulse-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ff0000;
    border-radius: 50%;
    box-shadow: 0 0 10px #ff0000;
}

/* Styl dymku ze zdjęcia */
.nav-news-bubble {
    position: absolute;
    top: 50px;
    right: -13.4px;
    background: #ff0000; /* Mocna czerwień */
    color: #fff;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 5px 20px rgba(255, 0, 0, 0.4);
    z-index: 999;
    display: none; /* Sterowane przez JS */
    animation: bounce 2s infinite;
}

/* Strzałka dymku */
.nav-news-bubble::after {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 25px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #ff0000 transparent;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
/* Wyskakujący dymek (Tooltip) */
.nav-news-tooltip {
    position: absolute;
    top: 140%;
    right: 50%;
    transform: translateX(50%) translateY(10px);
    background: #E60000;
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(230, 0, 0, 0.4);
    z-index: 100;
    font-family: 'Poppins', sans-serif;
}

/* Trójkącik dymku */
.nav-news-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%; right: 50%;
    transform: translateX(50%);
    border-width: 7px;
    border-style: solid;
    border-color: transparent transparent #E60000 transparent;
}

.nav-news-wrapper:hover .nav-news-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(50%) translateY(0);
}
/* FIX: usunięcie przerwy między dzwonkiem a sercem */
.nav-news-wrapper + .nav-auth {
    margin-left: 0 !important;
}

.nav-news-wrapper {
    margin-right: -0.5vw; /* delikatne "dociśnięcie" */
}

/* Dodatkowo wyrównanie flexa */
.custom-navbar .nav-inner {
    gap: 1.2vw; /* możesz zmniejszyć globalny gap tylko trochę */
}

/* ================= TABLETY I MNIEJSZE (do 1024px) ================= */
@media (max-width: 1280px) {
    .custom-navbar {
        padding: 15px 0; /* Przechodzimy z vw na stałe piksele */
    }

    .nav-inner {
        justify-content: space-between; /* Rozsuwamy elementy na boki */
        width: 95%;
        gap: 15px;
    }

    /* Logo i Ikonki - powiększamy na stałe wartości */
    .nav-brand img {
        width: auto;
        height: 35px;
    }

    /* Wyszukiwarka - chowamy tekst, zostawiamy tylko lupkę jako okrągły przycisk */
   /* Wyszukiwarka (Mobilna) - większa i przesunięta w lewo */
    .nav-search-trigger {
        min-width: unset;
        width: 42px; /* Lekko powiększona */
        height: 42px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        margin-left: 15px; /* Przesuwa w lewo, tuż obok loga */
        margin-right: auto; /* Wypycha resztę elementów (ulubione, zębatkę) do prawej strony */
    }
    
    .nav-search-trigger i {
        font-size: 18px; /* Powiększona ikona lupy */
    }
    
    .search-placeholder {
        display: none; /* Ukrywamy "Szukaj..." */
    }

    /* Ulubione - stały rozmiar */
    .nav-fav-btn {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    .nav-fav-btn i {
        font-size: 18px;
    }

    /* Ustawienia - Chowamy tekst "PL | PLN | Kakobuy", zostawiamy tylko zębatkę */
    .nav-prefs {
        display: none; 
    }
    .btn-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    .btn-icon i {
        font-size: 18px;
    }

    /* Włączamy Hamburgera */
    .hamburger-menu {
        display: flex;
        margin-left: 10px;
    }

    /* Otwarty hamburger (krzyżyk) */
    .hamburger-menu.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
        background-color: #FF1A1A;
    }
    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger-menu.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
        background-color: #FF1A1A;
    }

    /* Boczny Panel Menu (Drawer) */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        max-width: 88vw;
        height: 100vh;
        height: 100dvh;
        background: linear-gradient(180deg, rgba(15,0,0,0.98) 0%, rgba(8,0,0,0.98) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-left: 1px solid rgba(255, 0, 0, 0.25);
        flex-direction: column;
        justify-content: flex-start;
        padding: 90px 22px 30px;
        margin-right: 0;
        transition: right 0.4s cubic-bezier(.4,0,.2,1);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.85);
        overflow-y: auto;
        gap: 4px;
        z-index: 9998;
    }

    .nav-menu.active {
        right: 0;
    }

    /* Scroll styling dla drawera */
    .nav-menu::-webkit-scrollbar { width: 6px; }
    .nav-menu::-webkit-scrollbar-track { background: transparent; }
    .nav-menu::-webkit-scrollbar-thumb { background: rgba(230,0,0,0.3); border-radius: 3px; }

    .nav-link {
        font-size: 16px;
        padding: 14px 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 10px;
        height: auto;
        gap: 14px;
    }
    .nav-link:hover {
        background: rgba(230,0,0,0.08);
    }
    .nav-link.active, .nav-link.nav-qc-btn.active, .nav-link.nav-kupony-btn.active {
        background: rgba(230,0,0,0.15);
        border-color: rgba(230,0,0,0.3);
        color: #fff;
    }

    .nav-link i {
        font-size: 18px;
        width: 24px;
        text-align: center;
    }

    /* Naprawa Dropdownu dla widoku mobilnego */
    .dropdown::after { display: none; }
    
    .dropdown-menu {
        position: relative;
        top: 0;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        background: transparent;
        border: none;
        padding: 10px 0 10px 20px; /* Wcięcie podkategorii */
        display: none; /* Domyślnie zwinięte */
    }

    /* Klasa dodawana przez JS do rozwijania na kliknięcie */
    .dropdown.mobile-open .dropdown-menu {
        display: flex;
        flex-direction: column;
    }
    
    .dropdown.mobile-open .arrow {
        transform: rotate(180deg);
    }

    .dropdown-menu a {
        font-size: 15px;
        padding: 10px 15px;
    }

    /* ================= FIX MODALA CMD WYSZUKIWARKI ================= */
    .cmd-modal {
        width: 90vw;
        min-width: unset; /* Resetujemy min-width z PC */
        border-radius: 20px;
    }
    
    .cmd-header { padding: 15px; }
    .cmd-header input { font-size: 16px; }
    .search-icon { font-size: 18px; }
    .cmd-close { width: 35px; height: 35px; font-size: 18px; }
    
    .cmd-group-title { font-size: 12px; padding: 15px 15px 5px; }
    .cmd-item { padding: 12px; gap: 15px; }
    .cmd-icon { width: 40px; height: 40px; font-size: 16px; }
    .cmd-name { font-size: 15px; }
    .cmd-desc { font-size: 12px; }
    .cmd-footer { display: none; } /* Na telefonie skróty klawiszowe są zbędne */
}

/* ================= TELEFONY (do 480px) ================= */
@media (max-width: 480px) {
    .nav-inner { gap: 10px; }
    .nav-brand img { height: 30px; }
    
    /* Trochę mniejsze ikonki akcji, żeby się zmieściły */
    .nav-search-trigger, .nav-fav-btn, .btn-icon {
        width: 35px; height: 35px; border-radius: 10px;
    }
    .nav-search-trigger i, .nav-fav-btn i, .btn-icon i {
        font-size: 16px;
    }
}
