/* branches.css — page styles for pobocky.html (page owner, TASK-6). Builds on base.css primitives.
   Mobile-first. Breakpoints: 768 (tablet: desktop-like rows, wrapping filter bar),
   1024 (desktop: sticky single-line filter bar), 1200 (two country columns). */

/* label variants: design copy differs between the mobile and desktop frames */
.bp-wide { display: none; }
@media (min-width: 768px) {
  .bp-wide { display: inline; }
  .bp-narrow { display: none; }
}

/* ---------- Hero ---------- */
.branches-hero .page-hero__content { padding-inline: 24px; }
.branches-hero .page-hero__sub { line-height: 21px; }
@media (min-width: 1024px) {
  .branches-hero .page-hero__sub { line-height: 1.5; }
}

/* ---------- Filter bar ---------- */
.filter-bar { background: var(--bg); border-bottom: 1px solid var(--border); }
.filter-bar__inner {
  display: flex; flex-direction: column; gap: 14px;
  padding-block: 20px;
}
.filter-bar__locate { order: 1; width: 100%; padding: 15px 16px; font-size: 15px; gap: 8px; }
.filter-bar__locate .icon { width: 16px; height: 16px; }
.filter-bar__locate[aria-busy="true"] { cursor: progress; opacity: .85; }
.filter-bar__locate[aria-busy="true"] .icon { animation: branches-spin 1.2s linear infinite; }
@keyframes branches-spin { to { transform: rotate(360deg); } }
.filter-bar__search { order: 2; }
.filter-bar__pills { order: 3; }
.filter-bar__open { order: 4; }
.filter-bar__pills .pill { padding: 9px 16px; }

/* search field */
.search {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 0 6px 0 18px; border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px var(--border); background: var(--bg);
  transition: box-shadow .2s var(--ease);
}
.search:hover { box-shadow: inset 0 0 0 1px #D9CDBC; }
.search:focus-within { box-shadow: inset 0 0 0 1.5px var(--text-muted); }
.search__icon { width: 16px; height: 16px; color: var(--text-muted); }
.search__input {
  flex: 1 1 auto; min-width: 0; height: 44px; padding: 0;
  border: 0; background: none; outline: none;
  font-size: 14px; line-height: 1.2; color: var(--text-primary);
  -webkit-appearance: none; appearance: none;
}
.search__input::placeholder { color: var(--text-muted); opacity: 1; }
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear {
  display: grid; place-items: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%; color: var(--text-muted);
}
.search__clear:hover { background: var(--surface); color: var(--text-primary); }
.search__clear .icon { width: 16px; height: 16px; }
.search__clear:focus-visible { border-radius: 50%; outline-offset: 0; }

/* "Jen otevřené" switch (native checkbox, role=switch) */
.switch {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 14px; font-weight: 500; line-height: 1.2; cursor: pointer; user-select: none; white-space: nowrap;
  min-height: 24px;
}
.switch__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.switch__label { order: 1; }
.switch__track {
  order: 2; position: relative; flex-shrink: 0;
  width: 40px; height: 24px; padding: 2px; border-radius: var(--radius-pill);
  background: var(--border); transition: background-color .2s var(--ease);
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(28, 22, 19, .12);
  transition: transform .2s var(--ease);
}
.switch:hover .switch__track { background: #DDD2C3; }
.switch__input:checked + .switch__track { background: var(--accent); }
.switch__input:checked + .switch__track::after { transform: translateX(16px); }
.switch__input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 3px; }

/* geolocation message */
.filter-bar__msg-wrap:has(.filter-bar__msg[hidden]) { display: none; }
.filter-bar__msg {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 16px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface); font-size: 14px; line-height: 1.45; color: var(--text-body);
}
.filter-bar__msg .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }
.filter-bar__msg.is-error .icon { color: var(--text-muted); }
.filter-bar__msg button { font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 768px) {
  .filter-bar__inner { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px 12px; padding-block: 24px; }
  .filter-bar__pills { order: 0; flex: 1 1 auto; }
  .filter-bar__locate { order: 1; width: auto; padding: 10px 20px; font-size: 14px; }
  .filter-bar__locate .icon { width: 15px; height: 15px; }
  .filter-bar__open { order: 2; }
  .filter-bar__search { order: 3; flex: 1 1 280px; }
  .switch { justify-content: flex-start; padding-right: 12px; }
  .switch__label { order: 2; }
  .switch__track { order: 1; width: 36px; height: 20px; }
  .switch__track::after { width: 16px; height: 16px; }
  .switch__input:checked + .switch__track::after { transform: translateX(16px); }
  .search__input { height: 36px; }
}
@media (min-width: 1024px) {
  .filter-bar { position: sticky; top: var(--nav-h); z-index: 50; }
  .filter-bar__pills { flex-wrap: nowrap; }
  .filter-bar__pills .pill { padding: 10px 22px; }
  .filter-bar__msg { margin-top: -8px; }
}
@media (min-width: 1200px) {
  .filter-bar__inner { flex-wrap: nowrap; }
  .filter-bar__pills { flex: 1 1 auto; overflow: visible; }
  .filter-bar__search { flex: 0 0 280px; }
}

/* ---------- Body: map + lists ---------- */
.branches-body {
  display: flex; flex-direction: column; gap: 36px;
  padding-top: 28px; padding-bottom: 56px;
}
.branches-map-block { display: flex; flex-direction: column; gap: 10px; }
.branches-map { height: 240px; }
.branches-map__caption { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 1.3; color: var(--text-muted); }
.branches-map__caption .icon { width: 13px; height: 13px; color: var(--accent); }
@media (min-width: 768px) {
  .branches-map { height: 360px; }
}
@media (min-width: 1024px) {
  .branches-body { gap: 48px; padding-top: 72px; padding-bottom: 96px; }
  .branches-map-block { gap: 12px; }
  .branches-map { height: 440px; }
  .branches-map__caption { gap: 8px; }
  .branches-map__caption .icon { width: 14px; height: 14px; }
}

.branch-list { display: flex; flex-direction: column; gap: 36px; }
.branch-list__side { display: flex; flex-direction: column; gap: 36px; }
@media (min-width: 1024px) {
  .branch-list, .branch-list__side { gap: 48px; }
}
@media (min-width: 1200px) {
  .branch-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 48px 56px; }
}

.country__head { gap: 14px; padding-bottom: 4px; }
.country__title { font-family: var(--font-heading); font-weight: 400; font-size: 26px; line-height: 1.5; color: var(--accent); text-transform: uppercase; white-space: nowrap; }
@media (min-width: 1024px) {
  .country__head { gap: 20px; padding-bottom: 8px; }
  .country__title { font-size: 30px; }
}

/* ---------- Branch Row (ut4xq desktop / d50LS mobile) ---------- */
.branch-rows { margin: 0; }
.branch-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 18px;
  grid-template-areas: "city nav chev" "name nav chev" "addr nav chev" "hours nav chev" "dist nav chev";
  column-gap: 12px; row-gap: 6px; align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  transition: background-color .25s var(--ease), box-shadow .25s var(--ease);
}
.branch-row:not(:has(.branch-row__distance:not([hidden]))) { grid-template-areas: "city nav chev" "name nav chev" "addr nav chev" "hours nav chev"; }
.branch-row__city { grid-area: city; font-size: 11.5px; font-weight: 500; letter-spacing: 2px; line-height: 1.2; text-transform: uppercase; color: var(--text-muted); }
.branch-row__name { grid-area: name; font-family: var(--font-heading); font-weight: 400; font-size: 20px; line-height: 1.5; text-transform: uppercase; color: var(--text-primary); }
.branch-row__link { color: inherit; }
.branch-row__link::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.branch-row__link:focus-visible { outline: none; }
.branch-row:has(.branch-row__link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.branch-row__address { grid-area: addr; font-size: 13.5px; line-height: 19px; color: var(--text-muted); }
.branch-row__hours { grid-area: hours; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; padding-top: 2px; }
.branch-row__hours .status { gap: 7px; }
.branch-row__time { font-size: 13px; line-height: 1.2; color: var(--text-muted); }
.branch-row__time--wide, .branch-row__when--wide { display: none; }
.branch-row__distance { grid-area: dist; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; line-height: 1.2; color: var(--accent); }
.branch-row__distance .icon { width: 14px; height: 14px; }
.branch-row__nav { grid-area: nav; position: relative; z-index: 1; width: 44px; height: 44px; background: var(--bg); }
.branch-row__nav .icon { width: 17px; height: 17px; }
.branch-row__chev { grid-area: chev; width: 18px; height: 18px; color: var(--text-muted); transition: transform .2s var(--ease), color .2s var(--ease); }
.branch-row:hover .branch-row__name { color: var(--accent); }
.branch-row:hover .branch-row__chev { color: var(--accent); transform: translateX(2px); }

/* highlighted (nearest / selected on the map) */
.branch-row.is-highlight {
  background: var(--surface);
  box-shadow: -12px 0 0 var(--surface), 12px 0 0 var(--surface), inset 3px 0 0 var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .branch-row.is-flash { animation: branches-flash 1.4s var(--ease); }
}
@keyframes branches-flash { 0%, 30% { background: #F2E6D6; } 100% { background: var(--surface); } }

@media (min-width: 768px) {
  .branch-row {
    grid-template-columns: 110px minmax(0, 1fr) auto 40px 18px;
    grid-template-areas: "city name hours nav chev" "city addr hours nav chev" "city dist hours nav chev";
    grid-template-rows: auto auto auto;
    column-gap: 16px; row-gap: 6px;
    padding: 22px 0;
  }
  .branch-row:not(:has(.branch-row__distance:not([hidden]))) { grid-template-areas: "city name hours nav chev" "city addr hours nav chev"; grid-template-rows: auto auto; }
  .branch-row__city { font-size: 12.5px; line-height: 1.2; }
  .branch-row:not(.is-group-start) .branch-row__city { visibility: hidden; }
  .branch-row__name { font-size: 22px; }
  .branch-row__address { font-size: 14px; line-height: 1.2; }
  .branch-row__hours { flex-direction: column; flex-wrap: nowrap; align-items: flex-end; gap: 6px; padding-top: 0; text-align: right; }
  .branch-row__time--narrow { display: none; }
  .branch-row__time--wide { display: block; font-size: 14px; font-weight: 500; color: var(--text-primary); white-space: nowrap; }
  .branch-row__when--wide { display: inline; }
  .branch-row__nav { width: 40px; height: 40px; }
  .branch-row__nav .icon { width: 16px; height: 16px; }
}

/* ---------- Empty state ---------- */
.branch-empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 28px 24px; border-radius: var(--radius); background: var(--surface);
}
.branch-empty__icon { width: 24px; height: 24px; color: var(--accent); }
.branch-empty__title { font-family: var(--font-heading); font-weight: 400; font-size: 26px; line-height: 1.2; text-transform: uppercase; }
.branch-empty__text { font-size: 15px; line-height: 1.5; color: var(--text-muted); }
.branch-empty .btn { margin-top: 4px; }
@media (min-width: 1024px) {
  .branch-empty { padding: 40px; }
  .branch-empty__title { font-size: 30px; }
}

/* ---------- Franchise card ---------- */
.franchise {
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
  padding: 24px; border-radius: var(--radius);
  background: var(--dark); color: #fff;
}
.franchise__eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; letter-spacing: 3px; line-height: 1.2; text-transform: uppercase; color: var(--accent-on-dark); }
.franchise__eyebrow .icon { width: 16px; height: 16px; }
.franchise__title { font-family: var(--font-heading); font-weight: 400; font-size: 30px; line-height: 36px; text-transform: uppercase; }
.franchise__text { font-size: 15px; line-height: 24px; color: var(--text-on-dark); }
.franchise__btn { padding: 14px 28px; font-size: 15px; gap: 8px; }
.franchise__btn .icon { width: 16px; height: 16px; }
.franchise__btn:focus-visible { outline-color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .franchise__btn .icon { transition: transform .2s var(--ease); }
  .franchise__btn:hover .icon { transform: translateX(3px); }
}
@media (min-width: 1024px) {
  .franchise { padding: 32px; }
}
