/* Početna strana — koristi tokene iz main.css */
.hm {
    max-width: 1320px;
    margin: 0 auto;
    padding: 2.5rem clamp(1rem, 3vw, 2.5rem) 0;
}
.hm > :last-child { margin-bottom: 0; }

/* ---------- Hero ---------- */
.hm-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
    margin-bottom: 3.5rem;
}
.hm-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.1rem, 4vw, 3.2rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--ink-strong);
    margin: 0 0 1rem;
    max-width: 19ch;
}
.hm-lede { font-size: 1.1rem; color: var(--ink-muted); max-width: 52ch; margin: 0 0 1.75rem; line-height: 1.6; }

.hm-search {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 620px;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.35rem;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.hm-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.hm-search > i { position: absolute; left: 1.1rem; color: var(--ink-faint); }
.hm-search .form-control {
    border: 0;
    background: transparent;
    box-shadow: none;
    height: 48px;
    padding-left: 2.6rem;
    font-size: 1.02rem;
    color: var(--ink);
}
.hm-search .form-control:focus { box-shadow: none; background: transparent; }
.hm-search .btn { height: 48px; padding: 0 1.4rem; border-radius: calc(var(--radius) - 4px); font-weight: 700; }

.hm-quick { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; max-width: 620px; }
.hm-quick a {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}
.hm-quick a:hover { background: var(--accent-soft); color: var(--accent); }
.hm-quick a.is-all { background: transparent; color: var(--accent); }

/* Najava konfiguratora: glavni element početne */
.hm-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    color: var(--ink);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}
.hm-builder:hover { border-color: var(--accent); color: var(--ink); }
.hm-builder:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 3px; }
.hm-builder-title { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--ink-strong); letter-spacing: -0.01em; }
.hm-builder-sub { display: block; color: var(--ink-muted); font-size: 0.92rem; margin-top: 0.25rem; }
.hm-slots { display: flex; flex-direction: column; }
.hm-slot {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.55rem 0;
    border-top: 1px dashed var(--border-strong);
}
.hm-slot:first-child { border-top: 0; }
.hm-slot-img { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.hm-slot-img img { width: 100%; height: 100%; object-fit: cover; }
.hm-slot-label { font-weight: 600; color: var(--ink); }
.hm-slot-price { color: var(--ink-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-builder-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 0.25rem; }
.hm-builder-foot > span:first-child { color: var(--ink-muted); font-size: 0.86rem; }
.hm-builder-foot i { color: #1A8A4C; }
[data-bs-theme="dark"] .hm-builder-foot i { color: #4CC584; }

/* ---------- Sekcije ---------- */
.hm-section { margin-bottom: 3.25rem; }
.hm-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.hm-h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.4rem, 2.4vw, 1.75rem); letter-spacing: -0.02em; color: var(--ink-strong); margin: 0; }
.hm-section-sub { margin: 0; color: var(--ink-muted); flex-basis: 100%; }
.hm-more { font-weight: 700; color: var(--accent); text-decoration: none; }
.hm-more:hover { text-decoration: underline; }

/* Kategorije */
.hm-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.85rem; }
.hm-cat {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    transition: border-color .15s ease;
}
.hm-cat:hover { border-color: var(--accent); }
.hm-cat-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.hm-cat-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.hm-cat:hover .hm-cat-img img { transform: scale(1.04); }
.hm-cat-name { padding: 0.7rem 0.85rem 0; font-weight: 700; color: var(--ink-strong); }
.hm-cat-count { padding: 0 0.85rem 0.75rem; color: var(--ink-faint); font-size: 0.85rem; }

/* Proizvodi: kartice su u shop.css (.sh-card) */
.hm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }

/* Kako kupujete */
.hm-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.4rem;
    margin-bottom: 3.25rem;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
}
.hm-fact { display: flex; gap: 0.85rem; align-items: flex-start; }
.hm-fact > i {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--surface);
    color: var(--accent);
}
.hm-fact strong { display: block; color: var(--ink-strong); }
.hm-fact span { color: var(--ink-muted); font-size: 0.9rem; }

/* Magazin */
.hm-posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.hm-post { display: flex; flex-direction: column; text-decoration: none; }
.hm-post-img { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); margin-bottom: 0.7rem; }
.hm-post-img img { width: 100%; height: 100%; object-fit: cover; }
.hm-post-date { color: var(--ink-faint); font-size: 0.82rem; }
.hm-post-title { font-weight: 700; color: var(--ink-strong); line-height: 1.35; }
.hm-post:hover .hm-post-title { color: var(--accent); }

/* ---------- Tablet / telefon ---------- */
@media (max-width: 991.98px) {
    .hm-hero { grid-template-columns: minmax(0, 1fr); }
    .hm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hm-facts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .hm { padding-top: 1.5rem; }
    .hm-hero { margin-bottom: 2.5rem; }
    .hm-lede { font-size: 1rem; }
    .hm-search .btn { padding: 0 1rem; }
    .hm-quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -1rem; padding-right: 1rem; }
    .hm-quick::-webkit-scrollbar { display: none; }
    .hm-quick a { flex: none; }
    .hm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
    .hm-cats {
        display: flex;
        gap: 0.6rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        margin-right: -1rem;
        padding-right: 1rem;
    }
    .hm-cats::-webkit-scrollbar { display: none; }
    .hm-cat { flex: 0 0 136px; scroll-snap-align: start; }
    .hm-cat-name { padding: 0.55rem 0.7rem 0; font-size: 0.92rem; }
    .hm-cat-count { padding: 0 0.7rem 0.6rem; font-size: 0.8rem; }
    .hm-posts { grid-template-columns: minmax(0, 1fr); }
    .hm-builder { padding: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .hm-cat-img img { transition: none; }
}
