/* ═══ Homepage V2 — Brzi filter modela + Nedavno pregledano ═══ */
.hpd-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 18px 14px;
    margin: 0 0 22px;
}
.hpd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.hpd-head__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hpd-bar { width: 4px; height: 22px; border-radius: 3px; background: #6a142c; }
.hpd-title {
    font-family: var(--font-family);
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}
.hpd-nav { display: flex; gap: 6px; }
.hpd-nav-btn {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.hpd-nav-btn:hover { background: #f8fafc; border-color: #6a142c; color: #6a142c; }
.hpd-link-btn {
    background: none; border: 0; padding: 4px 0;
    font-size: .8rem; font-weight: 600; color: #64748b;
    cursor: pointer; text-decoration: underline;
}
.hpd-link-btn:hover { color: #6a142c; }

/* Chips */
.hpd-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 12px;
}
.hpd-chips::-webkit-scrollbar { display: none; }
.hpd-chip {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
    font-family: var(--font-family);
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.hpd-chip:hover { border-color: #6a142c; }
.hpd-chip.is-active { background: #6a142c; border-color: #6a142c; color: #fff; }
.hpd-chip__count {
    font-size: .72rem; font-weight: 700;
    padding: 1px 7px; border-radius: 999px;
    background: rgba(15, 23, 42, .08);
}
.hpd-chip.is-active .hpd-chip__count { background: rgba(255, 255, 255, .22); }

/* Track */
.hpd-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 10px;
    scrollbar-width: none;
}
.hpd-track::-webkit-scrollbar { display: none; }

/* Card (omotač .hpd-item nosi širinu; kartica "Vidi sve" je direktno u traci) */
.hpd-item,
.hpd-track > .hpd-card {
    flex: 0 0 calc(25% - 11px);
    min-width: 220px;
    max-width: 290px;
    scroll-snap-align: start;
}
.hpd-item { position: relative; display: flex; }
.hpd-item > .hpd-card { flex: 1; min-width: 0; }
.hpd-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: #0f172a;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.hpd-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .10);
    border-color: #cbd5e1;
}
.hpd-card__img-wrap {
    position: relative;
    aspect-ratio: 1200 / 792;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    overflow: hidden;
}
.hpd-card__img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.hpd-card__img-wrap img.is-fallback { object-fit: contain; padding: 22%; opacity: .5; }
.hpd-badge {
    position: absolute; top: 10px; left: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .72rem; font-weight: 800;
    color: #fff;
    letter-spacing: .02em;
}
.hpd-badge--action { background: #dc2626; }
.hpd-badge--new { background: #0f172a; }
.hpd-badge--ev { background: var(--color-primary-ev, #001F3F); }
.hpd-card__body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.hpd-card__brand { font-size: .7rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .06em; }
.hpd-card__name {
    font-size: .98rem; font-weight: 800; margin: 0; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hpd-card__meta { font-size: .76rem; color: #64748b; min-height: 1.1em; }
.hpd-card__price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 6px; }
.hpd-card__price { font-size: 1.02rem; font-weight: 800; color: #6a142c; }
.hpd-card__old { font-size: .78rem; color: #94a3b8; }
.hpd-card__lease { font-size: .78rem; color: #334155; }
.hpd-card__lease strong { color: #0f172a; }

/* "Vidi sve" kartica */
.hpd-card--more {
    align-items: center; justify-content: center; text-align: center;
    gap: 8px; padding: 18px;
    background: linear-gradient(160deg, #6a142c 0%, #3f0b1a 100%);
    color: #fff; border-color: transparent;
    min-height: 260px;
}
.hpd-more__num { font-size: 2.2rem; font-weight: 900; line-height: 1; }
.hpd-more__label { font-size: .85rem; opacity: .9; line-height: 1.4; }
.hpd-more__cta {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 6px; padding: 8px 14px;
    border-radius: 999px; background: #fff; color: #6a142c;
    font-size: .82rem; font-weight: 800;
}
.hpd-note { margin: 4px 2px 0; font-size: .72rem; color: #94a3b8; }

/* Nedavno pregledano / Slično — kompaktne kartice */
.hpd-recent .hpd-item { flex-basis: calc(20% - 12px); min-width: 180px; max-width: 230px; }
.hpd-recent .hpd-card__name { font-size: .9rem; }
.hpd-subhead { margin: 10px 0 10px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.hpd-title--sm { font-size: 1rem; }

/* Pojeftinili */
.hpd-bar--green { background: #15803d; }
.hpd-drops .hpd-card__old { color: #64748b; }
.hpd-link {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .82rem; font-weight: 700; color: #6a142c; text-decoration: none;
    white-space: nowrap; flex: 0 0 auto;
}
.hpd-link:hover { text-decoration: underline; }
.hpd-lead { margin: -4px 2px 12px; font-size: .85rem; color: #475569; }

/* Stranica modela — konkurenti ispod glavnog sadržaja */
.hpd-competitors { margin: 28px 0 8px; }

/* ═══ Dugme "+ Uporedi" na kartici ═══ */
.abc-btn {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, .12);
    background: rgba(255, 255, 255, .94);
    color: #0f172a;
    font-family: var(--font-family);
    font-size: .72rem; font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .10);
    transition: background .15s, color .15s, border-color .15s;
}
.abc-btn:hover { border-color: #6a142c; color: #6a142c; }
.abc-btn.is-on { background: #6a142c; border-color: #6a142c; color: #fff; }
.abc-btn.is-on svg { transform: rotate(45deg); }
.abc-btn svg { transition: transform .15s; }

/* ═══ Lepljiva traka za poređenje ═══ */
.abc-tray {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 -6px 24px rgba(15, 23, 42, .25);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    transition: bottom .2s ease;
}
.abc-tray[hidden] { display: none; }
.abc-tray__inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.abc-slots { display: flex; gap: 10px; min-width: 0; flex: 1; }
.abc-slot {
    display: flex; align-items: center; gap: 8px;
    min-width: 0; flex: 0 1 260px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    padding: 5px 6px 5px 5px;
}
.abc-slot img { width: 54px; height: 36px; object-fit: cover; border-radius: 6px; background: #1e293b; flex: 0 0 auto; }
.abc-slot__name { font-size: .82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.abc-slot--empty { justify-content: center; border-style: dashed; color: #94a3b8; font-size: .78rem; min-height: 48px; }
.abc-remove {
    flex: 0 0 auto; width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
}
.abc-remove:hover { background: rgba(255, 255, 255, .25); }
.abc-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.abc-go {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; border-radius: 999px;
    background: #fff; color: #6a142c;
    font-size: .88rem; font-weight: 800; text-decoration: none;
}
.abc-go.is-disabled { background: rgba(255, 255, 255, .15); color: #94a3b8; cursor: default; }
.abc-clear { background: none; border: 0; color: #cbd5e1; font-size: .78rem; font-weight: 600; cursor: pointer; text-decoration: underline; }
.abc-flash {
    position: fixed; left: 50%; bottom: 96px; z-index: 1001;
    transform: translate(-50%, 20px);
    max-width: min(92vw, 520px);
    padding: 10px 16px; border-radius: 10px;
    background: #1e293b; color: #fff; font-size: .84rem; font-weight: 600;
    opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.abc-flash.is-on { opacity: 1; transform: translate(-50%, 0); }
body.abc-open { padding-bottom: 76px; }

@media (max-width: 768px) {
    .hpd-section { padding: 14px 12px 10px; border-radius: 14px; margin-bottom: 18px; }
    .hpd-title { font-size: 1.02rem; }
    .hpd-nav { display: none; }
    .hpd-item,
    .hpd-track > .hpd-card { flex-basis: 72%; min-width: 0; }
    .hpd-recent .hpd-item { flex-basis: 46%; min-width: 0; }
    .hpd-recent .abc-btn span { display: none; }
    .abc-tray { padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
    .abc-tray__inner { gap: 8px; }
    .abc-slots { gap: 6px; }
    .abc-slot { flex-basis: 50%; flex-direction: column; align-items: flex-start; gap: 4px; position: relative; padding: 5px; }
    .abc-slot img { width: 100%; height: 34px; }
    .abc-slot__name { font-size: .72rem; width: 100%; }
    .abc-remove { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; }
    .abc-actions { flex-direction: column; gap: 4px; }
    .abc-go { padding: 9px 14px; font-size: .82rem; }
    body.abc-open { padding-bottom: 96px; }
    .hpd-card--more { min-height: 220px; }
}
