/* =========================================================
   JMS Elektromateriál – katalógové podstránky
   Súbor: css/katalog.css

   Obsahuje:
   - hero sekciu kategórie
   - filter
   - produktový grid
   - produktové karty
   - väčšie obrázky produktov
   - spodný kontaktný pás
   ========================================================= */

/* ---------- HERO KATEGÓRIE ---------- */

.catalog-hero {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: #ffffff;
  border-bottom: 1px solid var(--border, #e8e8e8);
  position: relative;
  overflow: hidden;
}

.catalog-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 58%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 61, 0, 0.035) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.catalog-hero::after {
  content: "";
  position: absolute;
  top: -20%;
  right: -6%;
  width: 52%;
  height: 140%;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 61, 0, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 61, 0, 0.12) 1px, transparent 1px);
  background-size: 30px 30px;
  transform: skewX(-16deg);
  pointer-events: none;
  z-index: 1;
}

.catalog-hero-content {
  position: relative;
  z-index: 3;
  max-width: 760px;
  padding: 34px 0 42px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.catalog-hero-image {
  position: relative;
  z-index: 2;
  min-height: 330px;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.catalog-hero-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: right center;
  margin: 0;
}

.catalog-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 30px;
  color: var(--muted, #6b7280);
  font-size: 15px;
  font-weight: 500;
}

.catalog-breadcrumb a {
  color: var(--muted, #6b7280);
  text-decoration: none;
  transition: color 0.2s ease;
}

.catalog-breadcrumb a:hover {
  color: var(--orange, #ff3d00);
}

.catalog-breadcrumb strong {
  color: var(--text, #4b5563);
  font-weight: 700;
}

.catalog-eyebrow {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--orange, #ff3d00);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}

.catalog-eyebrow span {
  width: 56px;
  height: 4px;
  background: var(--orange, #ff3d00);
  border-radius: 99px;
}

.catalog-hero h1 {
  color: var(--black, #050505);
  font-size: clamp(48px, 5.2vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.065em;
  font-weight: 900;
  margin: 0 0 22px;
}

.catalog-hero p {
  max-width: 660px;
  color: var(--text, #4b5563);
  font-size: 19px;
  line-height: 1.55;
  margin: 0;
}

/* ---------- HLAVNÝ LAYOUT KATALÓGU ---------- */

.catalog-section {
  padding: 28px 44px 18px;
  background: var(--white, #ffffff);
}

.catalog-layout {
  width: min(1560px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 24px;
  align-items: start;
}

/* ---------- FILTER ---------- */

.catalog-filter {
  position: sticky;
  top: 106px;
  align-self: start;
  padding: 22px;
  background: #ffffff;
  border: 1px solid var(--border, #e8e8e8);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.055);
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.filter-header h2 {
  color: var(--black, #050505);
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 900;
  margin: 0;
}

.filter-header button {
  border: 0;
  background: transparent;
  color: var(--orange, #ff3d00);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.filter-search {
  margin-bottom: 14px;
}

.filter-search input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid #dddddd;
  border-radius: 8px;
  color: var(--black, #050505);
  font-family: inherit;
  font-size: 14px;
  outline: 0;
}

.filter-search input:focus {
  border-color: rgba(255, 61, 0, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 61, 0, 0.08);
}

.filter-group {
  border-top: 1px solid rgba(0, 0, 0, 0.075);
}

.filter-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  color: var(--black, #050505);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.filter-group summary::-webkit-details-marker {
  display: none;
}

.filter-group summary::after {
  content: "⌄";
  color: var(--black, #050505);
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.filter-group[open] summary::after {
  transform: rotate(180deg);
}

.filter-options {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
}

.filter-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text, #4b5563);
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
}

.filter-option input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--orange, #ff3d00);
}

.filter-empty {
  padding: 16px 0 2px;
  color: var(--muted, #6b7280);
  font-size: 14px;
  line-height: 1.45;
}

/* ---------- PRODUKTOVÝ TOOLBAR ---------- */

.products-toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.products-toolbar strong {
  display: block;
  color: var(--black, #050505);
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 3px;
}

.products-toolbar span,
.products-sort span {
  color: var(--muted, #6b7280);
  font-size: 14px;
}

.products-sort {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.products-sort select {
  height: 42px;
  padding: 0 38px 0 13px;
  border: 1px solid #dddddd;
  border-radius: 8px;
  background: #ffffff;
  color: var(--black, #050505);
  font-family: inherit;
  font-weight: 700;
  outline: 0;
}

/* ---------- PRODUKTOVÝ GRID ---------- */

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

/* ---------- PRODUKTOVÁ KARTA ---------- */

.product-card {
  --product-image-zoom: 1.25;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border, #e8e8e8);
  border-radius: 13px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.045);
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 61, 0, 0.18);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
}

.product-image {
  height: 155px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
  transform: scale(var(--product-image-zoom));
  transform-origin: center center;
}

/* Doladenie zoomu podľa kategórie */
body[data-category="kable-a-vodice"] .product-card { --product-image-zoom: 1.35; }
body[data-category="istice-a-chranice"] .product-card { --product-image-zoom: 2.2; }
body[data-category="zasuvky-a-vypinace"] .product-card { --product-image-zoom: 2.2; }
body[data-category="svietidla-a-ziarovky"] .product-card { --product-image-zoom: 2; }
body[data-category="rozvadzace"] .product-card { --product-image-zoom: 1.8; }
body[data-category="instalacny-material"] .product-card { --product-image-zoom: 2.1; }
body[data-category="predlzovacky"] .product-card { --product-image-zoom: 1.7; }
body[data-category="naradie"] .product-card { --product-image-zoom: 2.1; }
body[data-category="baterie"] .product-card { --product-image-zoom: 2.2; }
body[data-category="ostatne"] .product-card { --product-image-zoom: 2; }
body[data-category="meracia-technika"] .product-card { --product-image-zoom: 1.8; }
body[data-category="priemyselne-prislusenstvo"] .product-card { --product-image-zoom: 1.9; }

.product-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 20px 18px;
}

.product-code {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(255, 61, 0, 0.08);
  color: var(--orange, #ff3d00);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
}

.product-title {
  color: var(--black, #050505);
  font-size: 17px;
  line-height: 1.22;
  letter-spacing: -0.035em;
  font-weight: 900;
  margin: 0 0 7px;
}

.product-meta {
  color: var(--text, #4b5563);
  font-size: 14px;
  line-height: 1.35;
  margin: 0 0 8px;
}

.product-stock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  color: #119b25;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
}

.product-stock::before {
  content: "";
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
}

.product-stock.is-unavailable {
  color: #d91f1f;
}

.product-price {
  margin-top: auto;
  color: var(--black, #050505);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.product-price span {
  font-size: 14px;
  font-weight: 800;
}

/* ---------- PRÁZDNY STAV ---------- */

.products-empty {
  margin-top: 18px;
  padding: 44px 20px;
  text-align: center;
  background: #ffffff;
  border: 1px dashed rgba(255, 61, 0, 0.3);
  border-radius: 13px;
}

.products-empty strong {
  display: block;
  color: var(--black, #050505);
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 8px;
}

.products-empty p {
  color: var(--text, #4b5563);
  font-size: 16px;
  margin: 0;
}

/* ---------- SPODNÝ KONTAKTNÝ PÁS ---------- */

.catalog-contact-strip {
  width: min(1560px, calc(100% - 88px));
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #ffffff;
  border: 1px solid var(--border, #e8e8e8);
  border-radius: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.045);
  overflow: hidden;
}

.catalog-contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 18px 24px;
  color: var(--black, #050505);
  text-decoration: none;
}

.catalog-contact-item:first-child {
  border-right: 1px solid var(--border, #e8e8e8);
}

.catalog-contact-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--orange, #ff3d00);
  background: #ffffff;
  border: 2px solid var(--orange, #ff3d00);
  border-radius: 50%;
  flex-shrink: 0;
}

.catalog-contact-icon svg {
  width: 22px;
  height: 22px;
}

.catalog-contact-item strong {
  display: block;
  color: var(--black, #050505);
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 4px;
}

.catalog-contact-item small {
  color: var(--text, #4b5563);
  font-size: 15px;
}

/* ---------- RESPONSIVE ---------- */

@media (min-width: 1500px) {
  .catalog-hero {
    grid-template-columns: minmax(0, 44%) minmax(0, 56%);
  }

  .catalog-hero-content {
    padding-left: 54px;
  }
}

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

@media (max-width: 1200px) {
  .catalog-hero {
    grid-template-columns: minmax(0, 50%) minmax(0, 50%);
    min-height: 310px;
  }

  .catalog-hero-content {
    padding: 30px 0 34px 28px;
  }

  .catalog-hero-image {
    min-height: 310px;
  }
}

@media (max-width: 1100px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-filter {
    position: static;
  }

  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .catalog-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .catalog-hero::before,
  .catalog-hero::after {
    width: 100%;
    right: 0;
    transform: none;
  }

  .catalog-hero-content {
    padding: 28px 18px 12px;
    max-width: none;
  }

  .catalog-hero-image {
    min-height: 210px;
    height: 210px;
    justify-content: center;
  }

  .catalog-hero-image img {
    object-position: center;
  }
}

@media (max-width: 760px) {
  .catalog-section {
    padding: 18px;
  }

  .catalog-breadcrumb {
    margin-bottom: 22px;
    font-size: 14px;
  }

  .catalog-eyebrow {
    gap: 12px;
    font-size: 13px;
  }

  .catalog-eyebrow span {
    width: 42px;
    height: 3px;
  }

  .catalog-hero h1 {
    font-size: clamp(38px, 13vw, 56px);
    line-height: 1.02;
    letter-spacing: -0.06em;
    margin-bottom: 16px;
  }

  .catalog-hero p {
    font-size: 17px;
  }

  .catalog-hero-image {
    min-height: 170px;
    height: 170px;
  }

  .products-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .products-sort,
  .products-sort select {
    width: 100%;
  }

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

  .product-card {
    min-height: 280px;
  }

  .product-image {
    height: 135px;
  }

  .product-content {
    padding: 12px 14px 16px;
  }

  .product-title {
    font-size: 15px;
  }

  .product-meta,
  .product-stock {
    font-size: 13px;
  }

  .product-price {
    font-size: 17px;
  }

  .catalog-contact-strip {
    width: calc(100% - 36px);
    grid-template-columns: 1fr;
  }

  .catalog-contact-item:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--border, #e8e8e8);
  }
}

@media (max-width: 420px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-image {
    height: 145px;
  }
}
