/* ============================================================
   Dealer (Views/Shared/Dealer/_Catalog.cshtml) — mobile-first, prefiks .dl-*
   Kolory tylko z tokenów --g-* (global.css). Zachowania: wwwroot/assets/js/dealer.js.
   ============================================================ */

.dl { overflow-x: hidden; color: var(--g-text); }
.dl [hidden], .dl-sheet [hidden] { display: none !important; }

/* ---------- Podsumowanie ---------- */
.dl-sum {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.7rem;
    padding: 0.6rem 0.85rem; border: 1px solid var(--g-border);
    border-radius: var(--g-radius-lg); background: var(--g-surface);
}
.dl-sum-ico {
    display: inline-flex; flex: none; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px; background: var(--g-green);
    color: var(--g-green-text); font-size: 1.35rem;
}
.dl-sum-main { display: flex; flex: 1; flex-direction: column; min-width: 180px; }
.dl-sum-main b { font-size: 0.95rem; }
.dl-sum-main small { color: var(--g-text-muted); font-size: 0.76rem; }
.dl-sum-main small.dl-pgr { color: var(--g-green-text); }
.dl-stats { display: flex; flex-wrap: wrap; gap: 0.35rem; width: 100%; }
.dl-stat {
    display: inline-flex; align-items: center; gap: 0.3rem; min-height: 32px; padding: 0 0.6rem;
    border: 1px solid var(--g-border); border-radius: 999px; background: var(--g-surface-alt); font-size: 0.82rem;
}
.dl-stat i { color: var(--g-gold); }
@media (min-width: 768px) { .dl-stats { width: auto; } }

/* ---------- Wyszukiwarka + filtr ---------- */
.dl-bar { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.75rem 0; }
.dl-search { position: relative; margin: 0; }
.dl-search i {
    position: absolute; top: 50%; left: 0.75rem; transform: translateY(-50%);
    color: var(--g-text-muted); font-size: 1.1rem; pointer-events: none;
}
.dl-search input {
    width: 100%; min-height: 44px; padding: 0 0.75rem 0 2.3rem; border: 1px solid var(--g-border);
    border-radius: var(--g-radius-lg); background: var(--g-surface-alt); color: var(--g-text); font-size: 16px;
}
.dl-search input:focus { outline: none; border-color: var(--g-green-border); box-shadow: 0 0 0 3px var(--g-green); }
.dl-tabs { display: flex; align-items: center; gap: 0.3rem; overflow-x: auto; scrollbar-width: none; }
.dl-tabs::-webkit-scrollbar { display: none; }
.dl-tab {
    display: inline-flex; flex: none; align-items: center; gap: 0.3rem; min-height: 44px; padding: 0 0.85rem;
    border: 1px solid var(--g-border); border-radius: 999px; background: var(--g-surface);
    color: var(--g-text-muted); font-size: 0.82rem; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.dl-tab span { padding: 0 0.35rem; border-radius: 999px; background: var(--g-gray); font-size: 0.72rem; }
.dl-tab.is-on { border-color: var(--g-green-border); background: var(--g-green); color: var(--g-green-text); }
.dl-sort {
    flex: none; min-height: 44px; margin-left: auto; padding: 0 0.6rem; border: 1px solid var(--g-border);
    border-radius: 999px; background: var(--g-surface); color: var(--g-text); font-size: 0.82rem;
}

/* ---------- Karty ---------- */
.dl-grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 640px) { .dl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .dl-grid { grid-template-columns: repeat(3, 1fr); } }
.dl-card {
    display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--g-border);
    border-radius: var(--g-radius-lg); background: var(--g-surface);
}
.dl-card.is-locked .dl-photo img { opacity: 0.55; filter: grayscale(0.5); }
.dl-photo {
    position: relative; display: block; width: 100%; height: 150px; padding: 0.4rem; border: 0;
    background: var(--g-surface-alt); cursor: zoom-in;
}
.dl-photo img { width: 100%; height: 100%; object-fit: contain; }
.dl-badge {
    position: absolute; padding: 2px 8px; border: 1px solid; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700;
}
.dl-badge-red { top: 8px; right: 8px; background: var(--g-red); border-color: var(--g-red-border); color: var(--g-red-text); }
.dl-badge-amber { top: 8px; left: 8px; background: var(--g-amber); border-color: var(--g-amber-border); color: var(--g-amber-text); }
.dl-badge-teal { top: 8px; left: 8px; background: var(--g-teal); border-color: var(--g-teal-border); color: var(--g-teal-text); }
.dl-badge-gray { bottom: 8px; left: 8px; background: var(--g-gray); border-color: var(--g-gray-border); color: var(--g-gray-text); }
.dl-body { display: flex; flex: 1; flex-direction: column; gap: 0.35rem; padding: 0.7rem 0.85rem 0.85rem; }
.dl-title { margin: 0; font-size: 1.02rem; font-weight: 700; }
.dl-lvl { margin: 0; color: var(--g-green-text); font-size: 0.8rem; font-weight: 600; }
.dl-lvl.is-bad, .is-bad { color: var(--g-red-text); }
.dl-kind { margin-left: 0.4rem; padding: 1px 8px; border: 1px solid var(--g-blue-border); border-radius: 999px; background: var(--g-blue); color: var(--g-blue-text); font-size: 0.72rem; }
.dl-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 0.6rem; margin: 0; padding: 0; list-style: none; font-size: 0.8rem; color: var(--g-text-muted); }
.dl-specs i { color: var(--g-text-subtle); }
.dl-price { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2rem 0.6rem; margin-top: 0.2rem; }
.dl-price b { font-size: 1.15rem; }
.dl-price s { margin-right: 0.35rem; color: var(--g-text-muted); font-size: 0.8rem; }
.dl-pp { color: var(--g-premium-text); font-weight: 700; }
.dl-hint, .dl-note { color: var(--g-text-muted); font-size: 0.76rem; }
.dl-note { margin: 0.6rem 0 0; }
.dl-go { width: 100%; min-height: 44px; margin-top: auto; justify-content: center; }
.dl-go[disabled] { opacity: 0.55; cursor: not-allowed; }
.dl-empty { padding: 1.5rem 0; color: var(--g-text-muted); text-align: center; }

/* ---------- Panel konfiguratora ---------- */
.offcanvas.offcanvas-bottom.dl-sheet {
    height: auto; max-height: 88vh; border-top: 1px solid var(--g-border); border-radius: 18px 18px 0 0;
    background: var(--g-surface-alt); color: var(--g-text); padding-bottom: env(safe-area-inset-bottom);
}
.dl-sheet { --g-sheet-w: 640px; }
@media (max-width: 767.98px) {
    /* nad dolnym paskiem gry (.gl-quick-actions-bar) */
    .offcanvas.offcanvas-bottom.dl-sheet {
        z-index: 1055; bottom: var(--gl-quick-bar-h, 60px);
        max-height: calc(100dvh - var(--gl-quick-bar-h, 60px) - 24px);
    }
    .offcanvas-backdrop { z-index: 1051; }
}
.dl-sheet-grip { width: 40px; height: 4px; margin: 0.5rem auto 0; border-radius: 4px; background: var(--g-border); }
.dl-sheet-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 1rem 0.6rem; border-bottom: 1px solid var(--g-border); }
.dl-sheet-title { flex: 1; min-width: 0; }
.dl-sheet-title h5 { margin: 0; overflow: hidden; font-size: 1rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.dl-sheet-title small { color: var(--g-text-muted); font-size: 0.76rem; }
.dl-back {
    display: inline-flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px;
    border: 1px solid var(--g-border); border-radius: 50%; background: var(--g-surface); color: var(--g-text); font-size: 1.2rem;
}
.dl-sheet-body { padding: 0.7rem 1rem; overflow-y: auto; }
.dl-sheet-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 1rem;
    border-top: 1px solid var(--g-border); background: var(--g-surface-alt);
}
.dl-sheet-foot .g-btn { min-height: 44px; justify-content: center; }
.dl-confirm { width: 100%; }
.dl-foot-info { color: var(--g-text-muted); font-size: 0.82rem; }

.dl-opts { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.dl-opt {
    display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; width: 100%; min-height: 56px;
    padding: 0.5rem 0.75rem; border: 1px solid var(--g-border); border-radius: 12px; background: var(--g-surface);
    color: var(--g-text); text-align: left; cursor: pointer;
}
.dl-opt:hover:not(:disabled) { border-color: var(--g-green-border); background: var(--g-green); }
.dl-opt.is-locked { opacity: 0.6; cursor: not-allowed; }
.dl-opt-main { display: flex; flex-direction: column; min-width: 0; }
.dl-opt-main small { color: var(--g-text-muted); font-size: 0.75rem; }
.dl-opt-price { display: flex; flex: none; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.dl-opt-price small { color: var(--g-premium-text); font-weight: 700; }
.dl-check { gap: 0.6rem; }
.dl-check .form-check-input { flex: none; width: 22px; height: 22px; margin: 0; }
.dl-check .dl-opt-main { flex: 1; }
.dl-pick { display: flex; gap: 0.4rem; margin-bottom: 0.5rem; }
.dl-pick .g-btn { flex: 1; min-height: 44px; justify-content: center; }

.dl-sum-list { margin: 0 0 0.75rem; padding: 0; list-style: none; }
.dl-sum-list li { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.4rem 0; border-bottom: 1px solid var(--g-border); font-size: 0.88rem; }
.dl-sum-list li span:last-child { flex: none; white-space: nowrap; }
.dl-qty { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.dl-qty > div { display: flex; align-items: center; gap: 0.5rem; }
.dl-qty b { min-width: 2ch; text-align: center; font-size: 1.1rem; }
.dl-step {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border: 1px solid var(--g-border); border-radius: 50%; background: var(--g-surface); color: var(--g-text); font-size: 1.2rem;
}
.dl-step:disabled { opacity: 0.4; }
.dl-total {
    display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; padding: 0.65rem 0.75rem;
    border: 1px solid var(--g-green-border); border-radius: 12px; background: var(--g-green);
}
.dl-total b { font-size: 1.2rem; }
.dl-problem {
    margin: 0.6rem 0 0; padding: 0.5rem 0.7rem; border: 1px solid var(--g-red-border);
    border-radius: 10px; background: var(--g-red); color: var(--g-red-text); font-size: 0.85rem;
}

/* ---------- Dofinansowanie ---------- */
.dl-funding {
    display: flex; gap: 0.5rem; width: 100%; margin: 0; padding: 0.5rem 0.65rem; border: 1px solid var(--g-teal-border);
    border-radius: 10px; background: var(--g-teal); color: var(--g-teal-text); font-size: 0.82rem;
}
.dl-funding > i { flex: none; font-size: 1.15rem; }
.dl-sum-list li.dl-sum-funding { color: var(--g-teal-text); font-weight: 600; }

/* ---------- Komunikat strony (np. niedzielna wyprzedaż) ---------- */
.dl-notice {
    display: flex; gap: 0.5rem; width: 100%; margin: 0; padding: 0.5rem 0.65rem; border: 1px solid var(--g-red-border);
    border-radius: 10px; background: var(--g-red); color: var(--g-red-text); font-size: 0.85rem; font-weight: 600;
}
.dl-notice > i { flex: none; font-size: 1.15rem; }
