/* =========================================================================
   DUAL · catalog — breadcrumb, inner-page header, sort bar, gallery,
                    quantity stepper, tabs/accordion, spec tables,
                    related products, solution article. Reuses tokens.
   ========================================================================= */

/* ============ INNER-PAGE HEADER ============ */
/* Smaller than the homepage hero — for pages that aren't the homepage. */

.page {
  padding-top: calc(var(--nav-h-compact) + clamp(2rem, 1rem + 3vw, 4rem));
  padding-bottom: clamp(3rem, 2rem + 3vw, 5rem);
  background: var(--bg);
}

.page-head {
  padding-bottom: clamp(2rem, 1rem + 2vw, 3rem);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(2rem, 1rem + 2vw, 3rem);
  position: relative;
  overflow: hidden;
}

.page-head__title {
  font-size: var(--fs-4xl);
  letter-spacing: -0.03em;
  line-height: 1;
  max-width: 22ch;
  margin-block: var(--s-3) var(--s-4);
}

.page-head__meta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-2);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  color: var(--ink-600);
}
.page-head__meta strong {
  color: var(--ink-900);
  font-weight: 500;
}

.page-head__lead {
  margin-top: var(--s-4);
  color: var(--ink-600);
  font-size: var(--fs-lg);
  max-width: 64ch;
}

.page-head__signal {
  position: absolute;
  inset: auto -10% -60% auto;
  width: 60%;
  max-width: 720px;
  height: 360px;
  z-index: 0;
  opacity: 0.45;
  pointer-events: none;
}
.page-head > *:not(.page-head__signal) { position: relative; z-index: 1; }

/* ============ BREADCRUMB ============ */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-400);
}
.crumbs a {
  color: var(--ink-600);
  transition: color var(--t-fast) var(--ease-out);
}
.crumbs a:hover { color: var(--ink-900); }
.crumbs span[aria-current] { color: var(--blue-700); }
.crumbs .sep { color: var(--ink-400); }

/* ============ SORT BAR ============ */

.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-block: 1px solid var(--line);
  margin-bottom: var(--s-6);
}
.sort-bar__label {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-600);
}
.sort-bar__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.sort-chip {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: #fff;
  color: var(--ink-700);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}
.sort-chip:hover { border-color: var(--ink-400); color: var(--ink-900); }
.sort-chip[aria-pressed="true"] {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #fff;
}

.sort-bar__count {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--ink-400);
}

/* ============ CATALOG INDEX (proizvodi.html) ============ */

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
}
@media (max-width: 1080px) { .catalog-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .catalog-grid { grid-template-columns: 1fr; } }

/* ============ CATEGORY PAGE GRID ============ */

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
}
@media (max-width: 1180px) { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .products-grid { grid-template-columns: 1fr; } }

.products-grid .prod-card { flex: none; }

.products-grid .prod-card[hidden] { display: none !important; }

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--s-7);
}
.load-more-wrap[hidden] { display: none; }

/* Empty state for category with zero products */
.cat-empty {
  text-align: center;
  padding: var(--s-9) var(--s-5);
  border: 1px dashed var(--line);
  border-radius: var(--r-3);
  background: var(--bg-tint);
  color: var(--ink-600);
}

/* ============ PRODUCT DETAIL ============ */

.product-page {
  padding-top: calc(var(--nav-h-compact) + clamp(1.5rem, 1rem + 2vw, 3rem));
  padding-bottom: clamp(3rem, 2rem + 3vw, 6rem);
}

.product-page__top {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 2vw + 1.5rem, 5rem);
  margin-block: var(--s-6) var(--s-9);
}
@media (max-width: 960px) {
  .product-page__top { grid-template-columns: 1fr; }
}

/* ----- Gallery ----- */

.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.gallery__main {
  /* 7:5 product image area, contain on white (Phase 08). */
  aspect-ratio: 7 / 5;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
  isolation: isolate;
}
.gallery__main picture { display: block; width: 100%; height: 100%; }
.gallery__main img {
  width: 100%; height: 100%;
  object-fit: contain;
  transition: transform var(--t-slow) var(--ease-out);
}
.gallery__main:hover img { transform: scale(1.03); }
.gallery__zoom-hint {
  position: absolute;
  bottom: var(--s-3); right: var(--s-3);
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-600);
  background: rgba(255,255,255,0.9);
  padding: 4px 8px;
  border-radius: var(--r-1);
  pointer-events: none;
}

.gallery__thumbs {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  padding-bottom: var(--s-1);
  scrollbar-width: none;
}
.gallery__thumbs::-webkit-scrollbar { display: none; }
.gallery__thumb {
  flex-shrink: 0;
  width: 72px; height: 72px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-tint);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out);
  padding: 0;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumb[aria-selected="true"] { border-color: var(--blue-700); }

/* ----- Lightbox ----- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(14, 16, 32, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease-out);
}
.lightbox[data-open="true"] { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.6);
  background: #fff;
}
.lightbox__close,
.lightbox__nav {
  position: absolute;
  width: 48px; height: 48px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast) var(--ease-out);
}
.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(255,255,255,0.22); }
.lightbox__close { top: var(--s-5); right: var(--s-5); }
.lightbox__nav--prev { left: var(--s-5); top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: var(--s-5); top: 50%; transform: translateY(-50%); }
.lightbox__counter {
  position: absolute;
  bottom: var(--s-5);
  left: 50%; transform: translateX(-50%);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

/* ----- Product info ----- */

.product-info { display: flex; flex-direction: column; gap: var(--s-4); }

.product-info__tags {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
}
.product-info__tag {
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--bg-tint);
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-600);
}

.product-info__sku {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.product-info__title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink-900);
}

.product-info__price {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-2);
  margin-top: var(--s-2);
}
.product-info__price-num {
  font-family: var(--ff-mono);
  font-size: var(--fs-2xl);
  font-weight: 500;
  color: var(--ink-900);
  letter-spacing: -0.005em;
}
.product-info__price-cur {
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  color: var(--ink-600);
  letter-spacing: 0.1em;
}
.product-info__price--ask .product-info__price-num {
  font-family: var(--ff-display);
  font-size: var(--fs-xl);
  color: var(--blue-700);
}

.product-info__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

/* ----- Quantity stepper ----- */

.qty {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
  background: #fff;
}
.qty__btn {
  width: 40px;
  border: 0;
  background: transparent;
  color: var(--ink-700);
  font-family: var(--ff-mono);
  font-size: var(--fs-base);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out);
}
.qty__btn:hover { background: var(--bg-tint); }
.qty__input {
  width: 54px;
  text-align: center;
  border: 0;
  border-inline: 1px solid var(--line);
  background: transparent;
  font: inherit;
  font-family: var(--ff-mono);
  font-size: var(--fs-base);
  color: var(--ink-900);
  -moz-appearance: textfield;
}
.qty__input::-webkit-outer-spin-button,
.qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty__input:focus { outline: 0; background: var(--bg-tint); }

/* ============ TABS / ACCORDIONS ============ */

.tabs {
  margin-top: var(--s-7);
  border-top: 1px solid var(--line);
}

.tabs__list {
  display: flex;
  gap: var(--s-1);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}
.tabs__list::-webkit-scrollbar { display: none; }

.tabs__btn {
  position: relative;
  padding: var(--s-4) var(--s-5);
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: var(--fs-base);
  letter-spacing: -0.005em;
  color: var(--ink-600);
  cursor: pointer;
  white-space: nowrap;
  border: 0;
  background: transparent;
  transition: color var(--t-fast) var(--ease-out);
}
.tabs__btn::after {
  content: "";
  position: absolute;
  left: var(--s-5); right: var(--s-5); bottom: -1px;
  height: 2px;
  background: var(--ink-900);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out);
}
.tabs__btn[aria-selected="true"] {
  color: var(--ink-900);
}
.tabs__btn[aria-selected="true"]::after { opacity: 1; }
.tabs__btn:hover { color: var(--ink-900); }

.tabs__panels {
  padding-block: var(--s-7);
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: tab-fade 280ms var(--ease-out); }

@media (max-width: 720px) {
  /* Stacked accordion on mobile */
  .tabs__list { display: none; }
  .tabs__panels { padding: 0; }
  .tab-panel {
    display: block;
    border-bottom: 1px solid var(--line);
    padding: 0;
  }
  .tab-panel.is-active { animation: none; }
  .tab-panel summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s-4) 0;
    font-family: var(--ff-display);
    font-weight: 600;
    font-size: var(--fs-lg);
    color: var(--ink-900);
  }
  .tab-panel summary::-webkit-details-marker { display: none; }
  .tab-panel summary::after {
    content: "+";
    font-family: var(--ff-mono);
    color: var(--ink-400);
    transition: transform var(--t-fast) var(--ease-out);
  }
  details[open] summary::after { transform: rotate(45deg); }
  .tab-panel__inner { padding-bottom: var(--s-5); }
}

/* Desktop: hide the <summary> inside panels (we use the tabs list instead) */
@media (min-width: 721px) {
  .tab-panel summary { display: none; }
  .tab-panel__inner { padding-bottom: 0; }
}

/* ============ DESCRIPTION CONTENT ============ */

.rich-content {
  max-width: 72ch;
  color: var(--ink-700);
  font-size: var(--fs-base);
  line-height: 1.7;
}
.rich-content h1, .rich-content h2 { font-size: var(--fs-xl); margin: var(--s-6) 0 var(--s-3); color: var(--ink-900); }
.rich-content h3, .rich-content h4 { font-size: var(--fs-lg); margin: var(--s-5) 0 var(--s-2); color: var(--ink-900); }
.rich-content p { margin-bottom: var(--s-4); }
.rich-content ul, .rich-content ol { margin: var(--s-3) 0 var(--s-4) 1.2em; list-style: disc; }
.rich-content ol { list-style: decimal; }
.rich-content li { margin-bottom: var(--s-2); }
.rich-content img {
  max-width: 100%;
  height: auto;
  margin: var(--s-5) 0;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
}
.rich-content a {
  color: var(--blue-700);
  border-bottom: 1px solid var(--blue-200);
  transition: border-color var(--t-fast) var(--ease-out);
}
.rich-content a:hover { border-bottom-color: var(--blue-700); }
.rich-content table {
  border-collapse: collapse;
  margin: var(--s-4) 0;
  width: 100%;
}
.rich-content th, .rich-content td {
  border-bottom: 1px solid var(--line);
  padding: var(--s-2) var(--s-3);
  text-align: left;
}
.rich-content strong { color: var(--ink-900); }

/* ============ SPEC TABLES ============ */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-7);
}
@media (max-width: 820px) {
  .spec-grid { grid-template-columns: 1fr; }
}

.spec-block h3 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--ink-900);
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.spec-block h3::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--blue-400);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.spec-table tr {
  border-bottom: 1px solid var(--line);
}
.spec-table th {
  text-align: left;
  padding: var(--s-3) var(--s-3) var(--s-3) 0;
  font-weight: 400;
  color: var(--ink-600);
  font-family: var(--ff-body);
  width: 50%;
  vertical-align: top;
}
.spec-table td {
  text-align: right;
  padding: var(--s-3) 0 var(--s-3) var(--s-3);
  font-family: var(--ff-mono);
  color: var(--ink-900);
  font-weight: 500;
  letter-spacing: -0.005em;
  vertical-align: top;
}

/* ============ DOWNLOADS ============ */

.dl-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
}
.dl-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.dl-list li:last-child { border-bottom: 0; }
.dl-list a {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-700);
  transition: color var(--t-fast) var(--ease-out);
}
.dl-list a:hover { color: var(--red-600); }

/* ============ WARRANTY / SERVICE BLOCK ============ */

.warranty {
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-5);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
}
@media (max-width: 720px) { .warranty { grid-template-columns: 1fr; } }
.warranty h3 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--ink-900);
  margin-bottom: var(--s-2);
}
.warranty p {
  color: var(--ink-600);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.warranty address {
  font-style: normal;
  color: var(--ink-700);
  font-size: var(--fs-sm);
  line-height: 1.7;
}
.warranty .mono { color: var(--ink-900); }

/* ============ RELATED PRODUCTS ============ */

.related {
  margin-top: clamp(3rem, 2vw + 2rem, 5rem);
  padding-top: clamp(2rem, 2vw + 1rem, 3rem);
  border-top: 1px solid var(--line);
}
.related__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
}
.related__title {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: var(--fs-2xl);
  letter-spacing: -0.02em;
  color: var(--ink-900);
}
.related__rail {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.related__row {
  display: flex;
  gap: var(--s-4);
  padding-bottom: var(--s-3);
}
.related__row .prod-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
}

/* "Preporučena kombinacija" strip */
.combo {
  margin-top: var(--s-6);
  padding: var(--s-5);
  border: 1px dashed var(--blue-400);
  border-radius: var(--r-3);
  background: linear-gradient(135deg, rgba(62,64,149,0.04), rgba(127,158,209,0.02));
}
.combo__h {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--ink-900);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.combo__h::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--signal);
}

/* ============ SOLUTION ARTICLE ============ */

.article-page {
  padding-top: calc(var(--nav-h-compact) + clamp(2rem, 1rem + 3vw, 4rem));
}
.article-head {
  max-width: 720px;
  margin-bottom: var(--s-7);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--line);
}
.article-head .page-head__title {
  font-size: var(--fs-4xl);
}
.article-body {
  max-width: 68ch;
  margin-inline: auto;
}
.article-body img { width: 100%; }

/* ============ SOLUTION INDEX CARDS ============ */

.solution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}
@media (max-width: 980px) { .solution-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .solution-grid { grid-template-columns: 1fr; } }
.solution-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: #fff;
  transition: border-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
  text-align: left;
}
.solution-card:hover {
  border-color: var(--blue-400);
  transform: translateY(-2px);
}
.solution-card__eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-700);
}
.solution-card__h {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: var(--fs-lg);
  letter-spacing: -0.015em;
  color: var(--ink-900);
}
.solution-card__sub {
  font-size: var(--fs-sm);
  color: var(--ink-600);
  line-height: 1.55;
}
.solution-card__cta {
  margin-top: auto;
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-700);
}
