/* Katalog (/katalog/) — dopuna za main.css */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cat { padding-bottom: 96px; }
.cat-hero { background: var(--tint-green); padding: 56px 0 48px; margin-bottom: 32px; }
.cat-hero h1 { font-size: clamp(30px, 4vw, 46px); margin-top: 14px; }
.cat-hero p { margin-top: 14px; max-width: 680px; color: var(--muted); font-size: 17px; }

/* Alati: pretraga, brend, sortiranje */
.cat-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; }
.cat-search { position: relative; display: block; }
.cat-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cat-search input, .cat-select select {
  width: 100%; height: 48px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  font: inherit; font-size: 15px; color: var(--ink);
}
.cat-search input { padding: 0 14px 0 42px; }
.cat-search input:focus, .cat-select select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11, 45, 134, .12); }
.cat-select select { padding: 0 36px 0 14px; cursor: pointer; appearance: none;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B2D86' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; }
.cat-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--navy); white-space: nowrap; cursor: pointer; padding: 0 4px; }
.cat-check input { width: 18px; height: 18px; accent-color: var(--navy); }

/* Grupe */
.cat-groups { display: flex; flex-wrap: nowrap; gap: 6px; margin-top: 20px; overflow-x: auto; scrollbar-width: none; }
.cat-groups::-webkit-scrollbar { display: none; }
.gchip {
  display: inline-flex; flex: none; align-items: center; gap: 6px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  font: inherit; font-size: 13px; font-weight: 600; color: var(--navy); cursor: pointer; white-space: nowrap;
  transition: border-color .15s ease, background .15s ease;
}
.gchip:hover { border-color: var(--navy); }
.gchip small { font-size: 11px; font-weight: 600; color: var(--muted); }
.gchip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.gchip[aria-pressed="true"] small { color: #AEBBDD; }

.cat-count { margin: 24px 0 16px; font-size: 14px; color: var(--muted); }

/* Kartice proizvoda */
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.pcard { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s ease, border-color .2s ease; }
.pcard:hover { box-shadow: var(--shadow); border-color: #C9D3E6; }
.pcard__link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.pcard__media { position: relative; padding: 16px; background: var(--white); }
.pcard__media img, .pcard__media .noimg { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.pcard__media img { transition: transform .3s ease; }
.pcard:hover .pcard__media img { transform: scale(1.04); }
.noimg { display: grid; place-items: center; gap: 8px; width: 100%; height: 100%; background: var(--tint-navy); border-radius: var(--radius); color: #9AA8C7; font-size: 13px; font-weight: 700; text-align: center; align-content: center; }
.noimg svg { width: 44px; height: 44px; }
.badge { position: absolute; top: 12px; left: 12px; padding: 3px 8px; border-radius: 3px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.badge--sale { background: var(--green); color: var(--navy); }
.badge--out { background: #EEF1F6; color: var(--muted); }
.pcard__body { display: flex; flex-direction: column; flex: 1; padding: 4px 18px 0; }
.pcard__brand { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pcard__name { margin-top: 4px; font-size: 13px; font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 18px; margin-top: auto; }
.price { display: flex; flex-direction: column; line-height: 1.2; }
.price b { font-size: 19px; color: #4B5563; white-space: nowrap; }
.price s { font-size: 13px; color: var(--muted); }
.pcard__buy {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: var(--white); transition: background .2s ease, color .2s ease;
}
.pcard__buy svg { width: 20px; height: 20px; }
.pcard__buy:hover { background: var(--green); color: var(--navy); }

.cat-more { display: flex; justify-content: center; margin-top: 40px; }
.cat-empty { grid-column: 1 / -1; padding: 56px 24px; text-align: center; color: var(--muted); background: var(--tint-navy); border-radius: var(--radius); }
.cat-empty b { display: block; color: var(--navy); font-size: 18px; margin-bottom: 6px; }

/* Skeleton dok se učitava */
.pcard--skel { min-height: 380px; background: linear-gradient(100deg, #F3F6FB 30%, #FAFBFD 50%, #F3F6FB 70%) 0 0 / 300% 100%; animation: skel 1.4s ease infinite; border-color: transparent; }
@keyframes skel { to { background-position: -100% 0; } }

/* Detalj proizvoda */
.pdlg { width: min(980px, calc(100% - 32px)); max-height: calc(100% - 48px); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 24px 64px -16px rgba(8, 34, 100, .45); color: var(--ink); }
.pdlg::backdrop { background: rgba(8, 34, 100, .55); }
.pdlg[open] { animation: dlg-in .2s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.pdlg__close { position: absolute; top: 12px; right: 12px; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--tint-navy); color: var(--navy); cursor: pointer; }
.pdlg__close svg { width: 20px; height: 20px; }
.pdlg__close:hover { background: var(--line); }
.pdlg__body { display: grid; grid-template-columns: 1fr 1.15fr; }
/* Slika je vertikalno centrirana u vidljivom dijelu kolone i ostaje na mjestu dok se opis skroluje */
.pdlg__media { background: var(--white); }
.pdlg__stick { position: sticky; top: 0; height: min(100%, calc(100vh - 48px)); display: grid; place-items: center; padding: 40px; }
.pdlg__media img { width: 100%; max-width: 420px; aspect-ratio: 1; object-fit: contain; }
.pdlg__media .noimg { aspect-ratio: 1; max-width: 420px; }
.pdlg__info { padding: 40px 40px 36px; border-left: 1px solid var(--line); }
.pdlg__info h2 { font-size: 24px; margin-top: 6px; padding-right: 32px; }
.pdlg__meta { margin-top: 8px; font-size: 13px; color: var(--muted); }
.pdlg__buy { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 24px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pdlg__buy .price b { font-size: 28px; }
.stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #3C8A00; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.stock--out { color: var(--muted); }
.stock--out::before { background: #B7C0D1; }
.pdlg__cart { margin-left: auto; width: 52px; height: 52px; }
.pdlg__cart svg { width: 24px; height: 24px; }
.pdlg__note { margin-top: 10px; font-size: 13px; color: var(--muted); }
.pdlg__desc { margin-top: 24px; font-size: 15px; line-height: 1.65; color: #3A4458; white-space: pre-line; }
.pdlg__desc.is-clamped { max-height: 10.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.more-link { margin-top: 6px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--navy); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.specs { width: 100%; margin-top: 24px; border-collapse: collapse; font-size: 14px; }
.specs caption { text-align: left; font-weight: 700; color: var(--navy); padding-bottom: 8px; }
.specs th, .specs td { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.specs th { width: 45%; font-weight: 500; color: var(--muted); padding-right: 16px; }

@media (max-width: 1080px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .cat-tools { grid-template-columns: 1fr 1fr; }
  .cat-search { grid-column: 1 / -1; }
  .cat-check { grid-column: 1 / -1; }
  .cat-groups { margin-left: -24px; margin-right: -24px; padding: 0 24px 4px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pdlg__body { grid-template-columns: minmax(0, 1fr); }
  .pdlg__stick { position: static; height: auto; padding: 24px 24px 8px; }
  .pdlg__media img, .pdlg__media .noimg { max-width: 280px; }
  .pdlg__info { padding: 16px 24px 28px; border-left: 0; }
}
@media (max-width: 560px) {
  .cat-hero { padding: 40px 0 32px; }
  .cat-groups { margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; }
  .pcard__media { padding: 10px; }
  .pcard__body { padding: 2px 12px 0; }
  .pcard__foot { padding: 10px 12px 14px; gap: 8px; }
  .price b { font-size: 16px; }
  .pcard__buy { width: 38px; height: 38px; }
  .pcard__buy svg { width: 18px; height: 18px; }
  .pdlg { width: 100%; max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pcard--skel, .pdlg[open] { animation: none; }
  .pcard:hover .pcard__media img { transform: none; }
}
.cat-count b { color: var(--navy); }
.cat-count .more-link { margin: 0; font-size: 14px; }
