/* === v1.51 oprema: blok Oprema kao Njuškalova forma "Predaja oglasa" + naslov s izblijeđenim dijelom =========
   Stranica oglasa #/oglas/<id> (app.js renderOglasEquipment / renderOglasTitleMirror). Samo tokeni (tamni način
   dolazi s html.icare tokenima). Postojeće klase (.oglas-equip / .oglas-eq — načini plaćanja) se ne diraju. */

/* --- Oprema: grupe kvačica ------------------------------------------------------------------------------------ */
.oglas-opr {
  display: flex;
  flex-direction: column;
  gap: 14px;
  container: oglasopr / inline-size;
}

.oglas-opr-group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.oglas-opr-title {
  padding: 0;
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.oglas-opr-count {
  font-weight: 500;
  color: var(--ink-3);
}

/* desktop 4 stupca, uže 3 / 2, mobitel 1 (po širini bloka, ne prozora: izbornik koji gura i bočni stupac) */
.oglas-opr-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 12px;
  padding: 5px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

@container oglasopr (max-width: 900px) {
  .oglas-opr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container oglasopr (max-width: 640px) {
  .oglas-opr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container oglasopr (max-width: 420px) {
  .oglas-opr-grid { grid-template-columns: minmax(0, 1fr); }
}

/* cijeli redak je <label>: klik bilo gdje mijenja kvačicu */
.oglas-opr-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 34px;
  padding: 7px 7px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.oglas-opr-item:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.oglas-opr-item.is-on {
  color: var(--ink);
  font-weight: 560;
}

/* prava kvačica ostaje (tipkovnica, čitač ekrana), vidljiv je okvir do nje */
.oglas-opr-input {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.oglas-opr-box {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 0;
  border: 1.5px solid var(--line-hover);
  border-radius: 4px;
  background: var(--surface);
  color: transparent;
  transition: background var(--dur-fast, 0.12s) ease, border-color var(--dur-fast, 0.12s) ease;
}

.oglas-opr-box svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 3;
  fill: none;
}

.oglas-opr-item:hover .oglas-opr-box {
  border-color: var(--brand);
}

.oglas-opr-input:checked + .oglas-opr-box {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--navy-ink);
}

.oglas-opr-input:focus-visible + .oglas-opr-box {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.oglas-opr-label {
  min-width: 0;
  overflow-wrap: break-word;
}

/* --- Zračni jastuci / Klimatizacija / Autoradio ---------------------------------------------------------------- */
.oglas-opr-selects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@container oglasopr (max-width: 640px) {
  .oglas-opr-selects { grid-template-columns: minmax(0, 1fr); }
}

/* --- Ostala oprema (ne ide na Njuškalo), sklopljena ------------------------------------------------------------ */
.oglas-opr-other {
  border-top: 1px dashed var(--line-strong);
  padding-top: 8px;
}

.oglas-opr-other > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px 10px;
  flex-wrap: wrap;
  padding: 5px 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.oglas-opr-other > summary::-webkit-details-marker { display: none; }

.oglas-opr-other > summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.oglas-opr-other > summary:hover .oglas-opr-other-title { color: var(--brand-strong); }

.oglas-opr-chev {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--ink-3);
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform var(--dur-fast, 0.12s) ease;
}

.oglas-opr-other[open] .oglas-opr-chev { transform: rotate(90deg); }

.oglas-opr-other-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 240px;
  min-width: 0;
}

.oglas-opr-other-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.oglas-opr-other-sub {
  font-size: 12px;
  color: var(--ink-3);
}

.oglas-opr-other-on {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 7px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--ink-2);
}

.oglas-opr-other-on strong {
  font-weight: 600;
  color: var(--brand-strong);
}

.oglas-opr-other-on[hidden] { display: none; }

.oglas-opr-other .oglas-opr-grid { margin-top: 8px; }
.oglas-opr-other .oglas-equip-add { margin-top: 10px; }

/* --- Naslov oglasa: dio koji ide na Njuškalo normalno, ostatak izblijeđen -------------------------------------- */
/* Pravo polje je prozirnog teksta iznad zrcalnog sloja s istim tekstom (ista mjera: rub 1 px, 7/9 px, 13.5 px);
   app.js pomiče zrcalo za scrollLeft polja (dugi naslov na mobitelu). */
.oglas-title-mirror {
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  background: var(--surface);
  font: inherit;
  font-size: 13.5px;
  pointer-events: none;
}

.oglas-title-mirror-clip {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.oglas-title-mirror-text {
  white-space: pre;
  color: var(--ink);
}

.oglas-title-mirror-text .is-out {
  position: relative;
  color: color-mix(in srgb, var(--ink) 50%, var(--surface));
}

/* granica Njuškala: tanka crta na mjestu reza (bez utjecaja na raspored slova) */
.oglas-title-mirror-text .is-out::before {
  content: "";
  position: absolute;
  left: 0;
  top: -2px;
  bottom: -2px;
  border-left: 1.5px dashed var(--warn-fill);
}

.oglas-field input.oglas-title-input {
  position: relative;
  z-index: 1;
  background: transparent;
  color: transparent;
  caret-color: var(--ink);
}

.oglas-field input.oglas-title-input::selection {
  color: transparent;
  background: var(--brand-ring);
}

.oglas-field input.oglas-title-input::placeholder { color: var(--ink-3); }

.oglas-title-drop { z-index: 2; }

.oglas-title-meta [data-oglas-title-suggest][hidden] { display: none; }

.oglas-title-status {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-left: auto;
}

.oglas-title-note {
  font-size: 12px;
  color: var(--warn);
}

.oglas-title-note[hidden] { display: none; }

.oglas-counter.is-cut {
  color: var(--warn);
  font-weight: 600;
}

/* Spremnost: savjet (npr. naslov ide skraćen) ne zaustavlja objavu */
.oglas-todo--note { margin-top: 8px; }
.oglas-todo--note .oglas-todo-mark { color: var(--warn); }

/* === v1.51 popravci (fixa): prijedlog opreme dok karton nije spremljen ===========================================
   Predložena stavka (s aukcije / cjenika) ima malu oznaku izvora uz naziv (isti izgled kao oznake izvora polja,
   .oglas-src u styles.css); odznačena predložena stavka oznaku zadrži prigušenu. Napomena iznad grupa. */
.oglas-opr-src {
  margin-left: 4px;
  vertical-align: 1px;
  white-space: nowrap;
}

.oglas-opr-item.is-suggested:not(.is-on) .oglas-opr-src {
  opacity: 0.55;
}

.oglas-opr-suggest-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.4;
}

.oglas-opr-suggest-note svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--brand-strong);
}
