/* Transkom CENE — store cards redesigned to LIVADA reference; site font tokens only */

body.tk-cene-mounted .entry-header,
body.tk-cene-mounted .page-header,
body.tk-cene-mounted .ast-page-title-bar,
body.tk-cene-mounted .entry-title {
  display: none !important;
}

.tk-cene {
  color: var(--tk-ink, #0f172a);
  font-family: inherit;
}

.tk-cene .tk-page-title,
.tk-cene .tk-page-lead,
.tk-cene .tk-page-kicker,
.tk-cene .tk-cene-meta,
.tk-cene-card,
.tk-cene-input,
.tk-cene-select,
.tk-cene-btn,
.tk-cene-table {
  font-family: inherit;
}

.tk-cene .tk-cene-meta {
  color: var(--tk-muted, #64748b);
  font-size: 0.88rem;
  margin: 0 0 0.85rem;
  font-weight: 500;
}


.tk-cene-warn {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 0.9rem 1.05rem;
  border-radius: var(--tk-radius, 16px);
  margin: 0 0 1.15rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* —— Search / filters —— */
.tk-cene-toolbar {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.tk-cene-toolbar--products {
  grid-template-columns: auto minmax(0, 1fr) minmax(290px, 34%);
  align-items: stretch;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

@media (max-width: 980px) {
  .tk-cene-toolbar--products {
    grid-template-columns: auto minmax(0, 1fr) minmax(260px, 36%);
  }
}

@media (max-width: 780px) {
  .tk-cene-toolbar--products {
    grid-template-columns: 1fr;
  }
}

.tk-cene-ctrl {
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: 3.05rem;
  min-height: 3.05rem;
  border: 1.5px solid rgba(34, 197, 94, 0.28);
  border-radius: 14px;
  background: #fff;
  color: var(--tk-forest, #0f3d26);
  box-shadow: 0 2px 10px rgba(15, 61, 38, 0.04);
}

.tk-cene-ctrl--csv {
  gap: 0.45rem;
  padding: 0 1.15rem;
  text-decoration: none !important;
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.tk-cene-ctrl--csv:hover {
  background: #f7fdf9;
  border-color: rgba(15, 61, 38, 0.28);
  color: var(--tk-forest, #0f3d26) !important;
}

.tk-cene-ctrl--csv .tk-cene-ico {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--tk-brand, #22c55e);
}

.tk-cene-ctrl--search,
.tk-cene-ctrl--select {
  border-color: rgba(15, 61, 38, 0.12);
  padding: 0 0.85rem;
  gap: 0.55rem;
  min-width: 0;
}

.tk-cene-ctrl--select {
  min-width: 290px;
}

.tk-cene-ico--field {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  color: #64748b;
}

.tk-cene-ico--field-end {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: #64748b;
  pointer-events: none;
}

.tk-cene-ctrl .tk-cene-input,
.tk-cene-ctrl .tk-cene-select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--tk-ink, #0f172a);
  -webkit-appearance: none;
  appearance: none;
}

.tk-cene-ctrl .tk-cene-input:focus,
.tk-cene-ctrl .tk-cene-select:focus {
  outline: none;
  box-shadow: none;
}

.tk-cene-ctrl:focus-within {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.tk-cene-ctrl .tk-cene-select {
  cursor: pointer;
  background-image: none;
  padding-right: 0.15rem;
  text-overflow: clip;
  white-space: nowrap;
  overflow: hidden;
}

.tk-cene-ctrl .tk-cene-select option {
  white-space: normal;
}

.tk-cene-input,
.tk-cene-select {
  width: 100%;
  box-sizing: border-box;
  height: 3.05rem;
  min-height: 3.05rem;
  border: 1.5px solid rgba(15, 61, 38, 0.12);
  border-radius: 14px;
  padding: 0 1rem;
  margin: 0;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.25;
  background: #fff;
  color: var(--tk-ink, #0f172a);
  box-shadow: 0 2px 10px rgba(15, 61, 38, 0.04);
  -webkit-appearance: none;
  appearance: none;
}

.tk-cene-input[type='search'] {
  -webkit-appearance: none;
  appearance: none;
}

.tk-cene-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.tk-cene-input:focus,
.tk-cene-select:focus {
  outline: none;
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}


/* —— Store grid: 4 / 2 / 1 —— */
.tk-cene-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .tk-cene-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tk-cene-grid {
    grid-template-columns: 1fr;
  }
}

/* —— Store card (LIVADA reference style, compact grid size) —— */
.tk-cene-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  padding: 1.75rem 1.6rem; /* 28px — escapes header-ready article padding-top:0 */
  border-radius: 22px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  overflow: hidden;
  background: #f7fdf9;
  box-shadow: 0 10px 28px rgba(15, 61, 38, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tk-cene-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 100% 0%, rgba(187, 247, 208, 0.55), transparent 58%),
    linear-gradient(160deg, #ffffff 0%, #f3fdf6 48%, #e8faf0 100%);
}

.tk-cene-card > * {
  position: relative;
  z-index: 1;
}

.tk-cene-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(15, 61, 38, 0.1);
}

.tk-cene-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.tk-cene-card-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--tk-forest, #0f3d26);
  word-break: break-word;
}

.tk-cene-card-addr {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--tk-forest-2, #14532d);
  word-break: break-word;
}

.tk-cene-card-rule {
  display: block;
  width: 100%;
  height: 0;
  margin: 1.05rem 0 0.85rem;
  border: 0;
  border-top: 1px solid rgba(34, 197, 94, 0.28);
}

.tk-cene-card-updated {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.35;
  color: #64748b; /* slate-blue/gray like reference */
  letter-spacing: 0.01em;
}

.tk-cene-card-updated .tk-cene-ico {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  color: #64748b;
}

/* —— Card actions: pinned to bottom, equal across cards —— */
.tk-cene-card .tk-cene-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: auto;
  padding-top: 1rem;
}


.tk-cene-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: var(--tk-radius-sm, 999px);
  padding: 0.55rem 1.05rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
    filter 0.15s ease;
}

.tk-cene-btn--block {
  width: 100%;
  justify-content: space-between;
  padding: 0.72rem 1.05rem;
}

.tk-cene-btn--block .tk-cene-btn-label {
  flex: 1 1 auto;
  text-align: left;
}

.tk-cene-ico {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.tk-cene-ico--chevron {
  width: 1rem;
  height: 1rem;
  opacity: 0.85;
}

.tk-cene-card .tk-cene-btn-primary {
  background: linear-gradient(
    105deg,
    #d9f99d 0%,
    #bef264 28%,
    var(--tk-brand-lime, #84cc16) 58%,
    var(--tk-brand, #22c55e) 100%
  );
  color: var(--tk-forest, #0f3d26) !important;
  box-shadow: 0 8px 18px rgba(132, 204, 22, 0.28);
  font-size: 0.9rem;
  font-weight: 800;
}

.tk-cene-card .tk-cene-btn-primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 10px 22px rgba(132, 204, 22, 0.34);
  color: var(--tk-forest, #0f3d26) !important;
}

.tk-cene-card .tk-cene-btn-ghost {
  background: #fff;
  color: var(--tk-forest, #0f3d26) !important;
  border: 1.5px solid rgba(34, 197, 94, 0.28);
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.58rem 1rem;
}

.tk-cene-card .tk-cene-btn-ghost:hover {
  background: rgba(240, 253, 244, 0.9);
  border-color: rgba(15, 61, 38, 0.28);
  color: var(--tk-forest, #0f3d26) !important;
}

/* —— Detail page —— */
.tk-cene-back {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-family: inherit;
}

.tk-cene-back:hover {
  color: var(--tk-brand-dark, #16a34a);
}

/* —— Detail table (reference 123.png) —— */
.tk-cene-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  background: #ffffff;
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 22px;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 10px 32px rgba(15, 61, 38, 0.06);
}

@media (min-width: 1100px) {
  .tk-cene-table-wrap {
    overflow: hidden;
  }
}

.tk-cene-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  table-layout: fixed;
}

/* min-width samo na desktopu; ispod 1100px tabela staje u ekran (bez horizontalnog skrola cena) */
@media (min-width: 1100px) {
  .tk-cene-table {
    min-width: 1120px;
  }
}

.tk-cene-col-product { width: 22%; }
.tk-cene-col-brand { width: 16%; }
.tk-cene-col-jm { width: 5%; }
.tk-cene-col-cat { width: 18%; }
.tk-cene-col-price { width: 9%; }
.tk-cene-col-jmprice { width: 8%; }
.tk-cene-col-sale { width: 9%; }
.tk-cene-col-period { width: 13%; }

.tk-cene-table th,
.tk-cene-table td {
  padding: 1.05rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid rgba(15, 61, 38, 0.07);
  border-right: 1px solid rgba(15, 61, 38, 0.06);
  vertical-align: middle;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.tk-cene-table th:last-child,
.tk-cene-table td:last-child {
  border-right: 0;
}

.tk-cene-table th {
  background: #eefaf2;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f3d26;
  white-space: nowrap;
  border-bottom: 1px solid rgba(34, 197, 94, 0.16);
  padding: 0.95rem 0.85rem;
}

.tk-cene-table thead th:first-child {
  border-top-left-radius: 21px;
}

.tk-cene-table thead th:last-child {
  border-top-right-radius: 21px;
}

.tk-cene-table tbody tr:nth-child(even) td {
  background: #fbfcfd;
}

.tk-cene-table tbody tr:hover td {
  background: #f3fbf6;
}

.tk-cene-table tbody tr:last-child td {
  border-bottom: 0;
}

.tk-cene-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 21px;
}

.tk-cene-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 21px;
}

.tk-cene-th-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.tk-cene-sort-ico {
  width: 0.65rem;
  height: 0.85rem;
  opacity: 0.35;
  color: #0f3d26;
  flex-shrink: 0;
}

.tk-cene-th.is-sorted .tk-cene-sort-ico {
  opacity: 0.8;
}

.tk-cene-th-jm .tk-cene-th-btn,
.tk-cene-td-jm {
  justify-content: center;
  text-align: center;
  width: 100%;
}

.tk-cene-td-jm {
  white-space: nowrap;
  overflow-wrap: normal;
  color: #0f172a;
  font-weight: 500;
}

.tk-cene-td-product {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.tk-cene-td-brand {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.tk-cene-td-cat {
  font-weight: 500;
  color: #1e293b;
  line-height: 1.35;
  font-size: 0.88rem;
}

.tk-cene-td-price,
.tk-cene-td-jmprice,
.tk-cene-td-sale,
.tk-cene-td-period {
  text-align: center;
}

.tk-cene-table td.num,
.tk-cene-table th.num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow-wrap: normal;
}

.tk-cene-td-jmprice {
  font-weight: 600;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.tk-cene-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 4.25rem;
  padding: 0.38rem 0.7rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.tk-cene-badge--price {
  background: #e8f9ee;
  color: #0f3d26;
}

.tk-cene-badge--sale {
  background: #fff1e6;
  color: #c2410c;
}

.tk-cene-badge--period {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  min-width: 6.5rem;
  padding: 0.45rem 0.7rem;
  background: #fff1e6;
  color: #9a3412;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
}

.tk-cene-period-d {
  display: block;
  white-space: nowrap;
}

.tk-cene-price-old {
  color: #475569; /* kontrast >= 7:1 (bilo #94a3b8, 2.5:1) */
  text-decoration: line-through;
  font-weight: 600;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.tk-cene-dash {
  color: #64748b; /* kontrast >= 4.5:1 (bilo #94a3b8) */
  font-weight: 500;
}

.tk-cene-empty {
  color: var(--tk-muted, #64748b);
  padding: 1.5rem 0.5rem;
  text-align: center;
  font-family: inherit;
}

.tk-cene-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 640px) {
  .tk-cene-card {
    padding: 1.6rem 1.35rem;
  }

  .tk-cene-card-title {
    margin-bottom: 0.7rem;
  }

  .tk-cene-card .tk-cene-actions {
    padding-top: 0.95rem;
  }

  .tk-cene-card .tk-cene-btn--block {
    width: 100%;
  }

  .tk-cene-ctrl--csv {
    width: 100%;
    justify-content: center;
  }

  .tk-cene-ctrl--select {
    min-width: 0;
  }

  .tk-cene-table th,
  .tk-cene-table td {
    padding: 0.9rem 0.75rem;
  }
}

/* Server-render (bez JS) blok za /cenovnici/; cene.js ga zamenjuje pri mount-u. */
.tk-prices-ssr {
  max-width: var(--tk-max, 1200px);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  min-height: 40vh;
  box-sizing: border-box;
}

.tk-prices-ssr-title {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--tk-forest, #0f3d26);
}

/* ===== Responsive cenovnik (S-13/S-14) ===== */

.tk-cene-more-wrap {
  text-align: center;
  margin: 1.25rem 0 0.5rem;
}

.tk-cene-more-wrap button[hidden] {
  display: none !important;
}

/* Tablet 781-1099px: bez kolona Kategorija i Period, automatski raspored, lepljiva prva kolona */
@media (min-width: 781px) and (max-width: 1099px) {
  .tk-cene-table {
    table-layout: auto;
    min-width: 0;
  }

  .tk-cene-col-cat,
  .tk-cene-col-period,
  .tk-cene-table th:nth-child(4),
  .tk-cene-table td:nth-child(4),
  .tk-cene-table th:nth-child(8),
  .tk-cene-table td:nth-child(8) {
    display: none;
  }

  .tk-cene-table th:first-child,
  .tk-cene-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
  }

  .tk-cene-table tbody td:first-child {
    background: #fff;
  }
}

/* Mobilni <= 780px: red tabele postaje kartica; zaglavlje ostaje kao cipovi za sortiranje */
@media (max-width: 780px) {
  .tk-cene-table-wrap {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .tk-cene-table,
  .tk-cene-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .tk-cene-table colgroup {
    display: none;
  }

  .tk-cene-table thead {
    display: block;
    margin-bottom: 0.75rem;
  }

  .tk-cene-table thead tr {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .tk-cene-table thead th,
  .tk-cene-table thead th:first-child,
  .tk-cene-table thead th:last-child {
    display: block;
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 999px;
  }

  .tk-cene-table tbody tr {
    display: flex;
    flex-direction: column;
    margin: 0 0 0.75rem;
    padding: 0.8rem 0.95rem;
    background: #fff;
    border: 1px solid rgba(34, 197, 94, 0.18);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 61, 38, 0.05);
  }

  .tk-cene-table tbody tr:nth-child(even) td,
  .tk-cene-table tbody tr:hover td {
    background: transparent;
  }

  .tk-cene-table tbody td,
  .tk-cene-table tbody tr:last-child td,
  .tk-cene-table tbody tr:last-child td:first-child,
  .tk-cene-table tbody tr:last-child td:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0;
    border: 0;
    border-radius: 0;
    text-align: right;
  }

  .tk-cene-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
    text-align: left;
  }

  .tk-cene-table tbody td:not([data-label])::before,
  .tk-cene-table tbody td.tk-cene-td-product::before {
    content: none;
  }

  .tk-cene-table tbody td.tk-cene-td-product {
    order: 0;
    display: block;
    margin-bottom: 0.3rem;
    font-size: 1rem;
    text-align: left;
  }

  .tk-cene-table tbody td.tk-cene-td-price { order: 1; }
  .tk-cene-table tbody td.tk-cene-td-sale { order: 2; }
  .tk-cene-table tbody td.tk-cene-td-jmprice { order: 3; }
  .tk-cene-table tbody td.tk-cene-td-brand { order: 4; }
  .tk-cene-table tbody td.tk-cene-td-jm { order: 5; width: auto; }
  .tk-cene-table tbody td.tk-cene-td-cat { order: 6; }
  .tk-cene-table tbody td.tk-cene-td-period { order: 7; }

  .tk-cene-table tbody td.tk-cene-td-price .tk-cene-badge,
  .tk-cene-table tbody td.tk-cene-td-sale .tk-cene-badge {
    font-size: 1.05rem;
  }
}

.tk-cene-card-about {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  font-weight: 700;
}

.tk-cene-card-about a {
  color: var(--tk-forest, #0f3d26);
}
