/* Popis brendova — tražilica "nađi svoj brod" (renderBrandsFinder u js/boat-brands.js).
   Učitava se samo na boat-brands*.html, uz boat-brands.css. */

.bf [hidden] {
  display: none !important;
}

/* ── Zaglavlje i brojke ── */
.bf-lead {
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.55;
}

.bf-stats {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: clamp(20px, 6vw, 56px);
  padding: 0;
  margin: 26px 0 0;
}

.bf-stats li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.bf-stats strong {
  font-family: var(--font-heading);
  font-size: clamp(1.55rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.bf-stats span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.62);
  letter-spacing: 0.03em;
}

/* ── Pretraga ── */
.bf-search {
  position: relative;
  max-width: 560px;
  margin: 30px auto 16px;
}

.bf-search-ico {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.bf-search-input {
  width: 100%;
  height: 54px;
  padding: 0 10px 0 44px;
  font: inherit;
  font-size: 1rem; /* 16 px: iOS ne zumira stranicu pri fokusu */
  text-overflow: ellipsis;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.bf-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  text-overflow: ellipsis;
}

/* Križić za brisanje upita: zadani je taman i ne vidi se na tamnoj podlozi */
.bf-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='.75' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

.bf-search-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-selected, #0ea5e9);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.28);
}

/* ── Filter po proizvodu ── */
.bf-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.bf-filter-label {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  margin-right: 2px;
}

.bf-chip {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.bf-chip:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.bf-chip:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.bf-chip-active,
.bf-chip-active:hover {
  background: var(--accent-selected, #0ea5e9);
  border-color: var(--accent-selected, #0ea5e9);
  color: #fff;
}

/* ── Sekcije ── */
.bf-section {
  margin-top: 46px;
}

.bf-results > .bf-section:first-child {
  margin-top: 34px;
}

.bf-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.bf-section-title {
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  font-weight: 700;
  margin: 0;
}

.bf-count {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.88rem;
  white-space: nowrap;
}

/* ── Kartice s fotografijom (modeli i brendovi) ── */
.bf-models {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.bf-brands {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.bf-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
  color: #fff;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.bf-card:hover,
.bf-card:focus-visible {
  color: #fff;
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}

.bf-card:focus-visible,
.bf-tile:focus-visible {
  outline: 2px solid var(--accent-selected, #0ea5e9);
  outline-offset: 2px;
}

.bf-card-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0a0f1a;
}

/* Tamni prijelaz na vrhu, da se bijeli logo vidi i na svijetlom nebu */
.bf-card-media::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 64px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.bf-card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.bf-card:hover .bf-card-img {
  transform: scale(1.05);
}

.bf-card-logo {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 12px;
  height: 18px;
  width: auto;
  max-width: 92px;
  object-fit: contain;
  opacity: 0.92;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

.bf-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px 14px;
}

.bf-card-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #38bdf8;
}

.bf-card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.bf-card-meta {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

.bf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.bf-tag {
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.85);
}

/* ── Gusti popis svih brendova (logo, ime, broj modela) ── */
.bf-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.bf-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 14px 8px 11px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.bf-tile:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.36);
}

.bf-tile-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin-bottom: 3px;
}

.bf-tile-logo img {
  max-width: 88%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.bf-tile-letter {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
}

.bf-tile-name {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.bf-tile-meta {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
}

/* ── Rezultati pretrage ── */
.bf-hint {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.6);
}

.bf-empty {
  max-width: 620px;
  margin: 36px auto 0;
  padding: 30px 22px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
}

.bf-empty-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.bf-empty-text {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
  margin: 0 0 20px;
}

/* ── Tablet ── */
@media (max-width: 991.98px) {
  .bf-tiles {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ── Mobitel: modeli i brendovi u vodoravnoj traci, popis u 3–4 stupca ── */
@media (max-width: 767.98px) {
  .bf-section {
    margin-top: 36px;
  }

  /* Filter u jednom retku koji se povlači prstom (umjesto 4 retka chipova) */
  .bf-filter {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    margin: 0 -12px;
    padding: 2px 12px 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .bf-filter::-webkit-scrollbar {
    display: none;
  }

  .bf-filter-label {
    display: none;
  }

  .bf-models--strip,
  .bf-brands {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    margin: 0 -12px;
    padding: 0 12px 8px;
    scroll-snap-type: x mandatory;
    /* bez ovoga scroll-snap "pojede" lijevi padding trake */
    scroll-padding-inline: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .bf-models--strip::-webkit-scrollbar,
  .bf-brands::-webkit-scrollbar {
    display: none;
  }

  .bf-models--strip > .bf-card {
    flex: 0 0 64vw;
    max-width: 270px;
    scroll-snap-align: start;
  }

  .bf-brands > .bf-card {
    flex: 0 0 46vw;
    max-width: 200px;
    scroll-snap-align: start;
  }

  .bf-models--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .bf-models--grid .bf-card-body {
    padding: 10px 11px 12px;
  }

  .bf-models--grid .bf-card-title {
    font-size: 0.98rem;
  }

  .bf-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .bf-tile {
    padding: 12px 6px 10px;
  }

  .bf-tile-logo {
    height: 38px;
  }

  .bf-tile-name {
    font-size: 0.8rem;
  }
}

@media (max-width: 575.98px) {
  .bf-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Uski mobiteli: tekst primjera u polju malo manji, da stane i na duljim jezicima (fr, cs, hu…).
   Upisani tekst ostaje 16 px, pa iOS ne zumira. Križić za brisanje zauzima mjesto i kad se ne vidi. */
@media (max-width: 374.98px) {
  .bf-search-input::placeholder {
    font-size: 0.9rem;
  }
}

/* Najuži mobiteli (320 px): bez ikone povećala */
@media (max-width: 340px) {
  .bf-search-ico {
    display: none;
  }

  .bf-search-input {
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bf-card,
  .bf-card-img,
  .bf-tile,
  .bf-chip,
  .bf-search-input {
    transition: none;
  }

  .bf-card:hover,
  .bf-card:hover .bf-card-img {
    transform: none;
  }
}
