/* Přehled zboží: značky, řady, tabulky (web) / karty (mobil), dialog dotazu. */

.top-action {
  right: var(--bar-offset);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 3px 12px;
  color: rgba(247, 251, 255, 0.86);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.top-action input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s ease, background 0.2s ease;
}

.top-action input:checked + .switch {
  background: var(--sun);
}

.top-action input:checked + .switch::after {
  background: #1b1205;
  transform: translateX(16px);
}

.top-action:focus-within {
  outline: 2px solid var(--sun);
  outline-offset: 2px;
}

.catalog-page {
  touch-action: pan-y;
  -webkit-touch-callout: none;
}

body.is-holding {
  -webkit-user-select: none;
  user-select: none;
}

.brand-tabs {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 4px;
  margin-top: clamp(22px, 4vw, 34px);
  padding: 4px;
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.brand-tabs button,
.section-chips button {
  border: 0;
  color: rgba(247, 251, 255, 0.78);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.brand-tabs button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 7px;
  font-size: 1rem;
  white-space: nowrap;
}

.brand-tabs button:hover,
.section-chips button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.brand-tabs button[aria-selected="true"] {
  color: #1b1205;
  background: var(--sun);
}

.section-chips {
  display: flex;
  gap: 8px;
  margin: 14px 0 0;
  padding: 2px 0 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.section-chips::-webkit-scrollbar {
  display: none;
}

.section-chips button {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 0.95rem;
}

.section-chips button[aria-selected="true"] {
  color: var(--sun);
  border-color: rgba(255, 194, 74, 0.6);
  background: rgba(255, 194, 74, 0.12);
}

.catalog-view.slide-next {
  animation: slide-next 0.28s ease-out;
}

.catalog-view.slide-prev {
  animation: slide-prev 0.28s ease-out;
}

@keyframes slide-next {
  from { opacity: 0; transform: translateX(36px); }
  to { opacity: 1; transform: none; }
}

@keyframes slide-prev {
  from { opacity: 0; transform: translateX(-36px); }
  to { opacity: 1; transform: none; }
}

.series-intro {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: clamp(16px, 3vw, 28px);
  align-items: center;
  margin-top: 18px;
  padding: clamp(14px, 2.4vw, 22px);
  border: 1px solid rgba(255, 194, 74, 0.17);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.045));
}

.series-logo {
  display: grid;
  place-items: center;
  height: 100px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.series-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.series-logo.is-dark {
  height: auto;
  min-height: 64px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.series-logo.is-dark img {
  width: 100%;
  max-height: 64px;
}

.series-intro.has-wide-logo {
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
}

.series-intro.no-logo {
  grid-template-columns: minmax(0, 1fr);
}

.series-tagline {
  margin: 0;
  color: var(--sun);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.series-name {
  margin: 2px 0 0;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  line-height: 1.05;
  font-weight: 800;
}

.series-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 500;
}

.series-features {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 500;
}

.series-features summary {
  width: max-content;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.series-features ul {
  margin: 8px 0 0;
  padding-left: 20px;
  line-height: 1.35;
}

.group-title {
  margin: clamp(26px, 4vw, 38px) 0 10px;
  color: var(--sun);
  font-size: clamp(1.3rem, 2.6vw, 1.65rem);
  line-height: 1.1;
  font-weight: 800;
}

.group-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.product-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 1rem;
}

.product-table th,
.product-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.product-table th {
  color: rgba(255, 194, 74, 0.9);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.product-table tbody tr:last-child td {
  border-bottom: 0;
}

.product-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.product-table .cell-name {
  font-weight: 700;
}

.product-table .cell-param {
  white-space: nowrap;
}

.product-table.is-dense {
  font-size: 0.9rem;
}

.product-table.is-dense th,
.product-table.is-dense td {
  padding: 8px;
}

.product-table.is-dense th {
  white-space: normal;
  font-size: 0.78rem;
}

.norm-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 7px;
  border: 1px solid rgba(68, 214, 198, 0.6);
  border-radius: 999px;
  color: var(--aqua);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.5;
  vertical-align: 1px;
  white-space: nowrap;
}

.product-table .cell-action {
  width: 1%;
  text-align: right;
}

.stock-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 9px;
  border-radius: 999px;
  color: #04231f;
  background: var(--aqua);
  font-size: 0.78rem;
  font-weight: 800;
  vertical-align: 1px;
}

.price {
  font-weight: 800;
  color: var(--text);
}

.on-request {
  color: rgba(190, 208, 220, 0.7);
  font-weight: 600;
}

.inquiry-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 194, 74, 0.4);
  border-radius: 8px;
  color: var(--sun);
  background: rgba(255, 194, 74, 0.08);
  cursor: pointer;
  transition: background 0.2s ease;
}

.inquiry-button:hover,
.inquiry-button:focus-visible {
  background: rgba(255, 194, 74, 0.22);
}

.inquiry-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stock-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.retry-button {
  margin-top: 12px;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #1b1205;
  background: var(--sun);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* Přepínač značek při dlouhém stisknutí (mobil) */
.brand-switch {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  padding: calc(var(--bar-offset) + 4px) var(--bar-offset) 16px;
  background: linear-gradient(180deg, rgba(7, 16, 22, 0.97) 70%, rgba(7, 16, 22, 0));
  pointer-events: none;
}

.brand-switch[hidden] {
  display: none;
}

.brand-switch span {
  padding: 4px 2px;
  color: rgba(247, 251, 255, 0.6);
  font-size: calc(1rem - 1px);
  font-weight: 800;
}

.brand-switch .bs-prev {
  justify-self: start;
}

.brand-switch .bs-current {
  justify-self: center;
}

.brand-switch .bs-next {
  justify-self: end;
}

.brand-switch .is-active {
  color: #1b1205;
  background: var(--sun);
}

/* Dialog dotazu */
.inquiry {
  width: min(92vw, 460px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: var(--text);
  background: #0d1f27;
  font-family: inherit;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.inquiry::backdrop {
  background: rgba(3, 8, 11, 0.7);
  backdrop-filter: blur(3px);
}

.inquiry form {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.inquiry h2 {
  margin: 0;
  color: var(--sun);
  font-size: 1.5rem;
  line-height: 1.1;
  font-weight: 800;
}

.inquiry-product {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
  line-height: 1.3;
}

.inquiry-product small {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.inquiry label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.inquiry input,
.inquiry textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
}

.inquiry textarea {
  min-height: 96px;
  resize: vertical;
}

.inquiry input:focus,
.inquiry textarea:focus {
  outline: 2px solid var(--sun);
  outline-offset: 1px;
}

.inquiry-to {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.inquiry-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.inquiry-actions button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.inquiry-actions .primary {
  border-color: transparent;
  color: #1b1205;
  background: var(--sun);
}

@media (max-width: 720px) {
  .brand-tabs {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .brand-tabs button {
    padding: 0 6px;
    font-size: 0.92rem;
  }

  .series-intro {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .series-intro > div:not(.series-logo) {
    display: contents;
  }

  .series-intro.has-wide-logo {
    grid-template-columns: minmax(0, 1fr);
  }

  .series-intro.has-wide-logo .series-logo {
    grid-row: auto;
    justify-self: start;
    width: min(100%, 260px);
    min-height: 0;
    height: auto;
  }

  .series-intro.has-wide-logo .series-tagline,
  .series-intro.has-wide-logo .series-name {
    grid-column: 1;
  }

  .series-logo {
    grid-row: 1 / span 2;
    height: 64px;
    padding: 6px 8px;
  }

  .series-tagline,
  .series-name {
    grid-column: 2;
  }

  .series-tagline {
    align-self: end;
    font-size: 0.8rem;
  }

  .series-name {
    align-self: start;
    font-size: 1.4rem;
  }

  .series-features,
  .series-text {
    grid-column: 1 / -1;
    margin-top: 0;
  }
}

/* Karty (mobil/tablet) se zobrazují místo tabulky; desktop zobrazuje jen tabulku. */
.product-cards {
  display: none;
}

@media (max-width: 1023px) {
  .product-table {
    display: none;
  }

  .product-cards {
    display: grid;
    gap: 10px;
  }

  .p-card {
    padding: 12px 14px;
    border: 1px solid rgba(255, 194, 74, 0.17);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.045));
  }

  .p-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .p-title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .p-name {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
  }

  /* Obj. číslo vlevo, štítek normy 0,3 vpravo na jednom řádku (stejná velikost písma). */
  .p-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 3px;
    font-size: 0.92rem;
  }

  .p-art {
    color: var(--muted);
    font-weight: 500;
  }

  .p-meta .norm-badge {
    margin-left: 0;
    font-size: inherit;
    line-height: 1.4;
  }

  .p-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
  }

  /* Štítek se roztahuje na celý řádek (poslední řádek vyrovnává settleChipRows v catalog.js). */
  .p-chip {
    flex: 1 1 auto;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(var(--chip, 255, 255, 255), 0.16);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
  }

  .p-label {
    color: var(--muted);
    font-weight: 500;
  }

  .p-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 3px 0;
  }

  /* Poslední řádek karty: "Dostupnost: …" vlevo, ikona dotazu vpravo. */
  .p-stock {
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .p-stock .p-label {
    margin-right: -2px;
  }

  .p-stock .inquiry-button {
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-view.slide-next,
  .catalog-view.slide-prev {
    animation: none;
  }
}
