/*
  Produktové novinky - finálny vizuál
  --------------------------------------------------
  Tento súbor nechaj načítaný až PO css/news.css a PO css/news-responsive.css.

  Rozloženie:
  - desktop: 3 produkty
  - tablet: 2 produkty
  - telefón: 1 produkt
*/

.news-section {
  padding: 74px 36px 62px;
  background: var(--white);
  overflow: hidden;
}

.news-container {
  width: min(1560px, 100%);
  margin: 0 auto;
}

.news-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 30px;
}

.news-header h2 {
  max-width: 980px;
  font-size: clamp(52px, 5.7vw, 86px);
  line-height: 0.95;
  letter-spacing: -0.075em;
  font-weight: 900;
}

.news-header p {
  max-width: 900px;
  font-size: clamp(18px, 1.55vw, 23px);
  line-height: 1.45;
}

.news-all-button {
  min-width: 300px;
  padding: 20px 30px;
  border-radius: 8px;
  font-weight: 500;
}

.news-slider {
  position: relative;
  overflow: visible;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.news-viewport {
  position: relative;
  z-index: 1;
  width: calc(100% - 120px);
  margin: 0 auto;
  overflow: hidden;
}

.news-track {
  display: flex;
  align-items: stretch;
  transition: transform 0.35s ease;
  will-change: transform;
}

.news-card {
  box-sizing: border-box;
  flex: 0 0 calc(100% / 3);
  padding: 0 11px;
  min-width: 0;
}

.news-card-inner {
  height: 100%;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 13px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.075);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.news-card-inner:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 61, 0, 0.22);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

.news-image {
  height: 205px;
  padding: 18px 28px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.news-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.news-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 22px 24px;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 32px;
  margin-bottom: 16px;
}

.news-badge {
  min-width: 92px;
  padding: 8px 14px 7px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}

.news-divider {
  width: 1px;
  height: 24px;
  background: #a87358;
  opacity: 0.75;
  flex-shrink: 0;
}

.news-category {
  color: #714021;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-title {
  color: var(--black);
  font-size: clamp(20px, 1.4vw, 23px);
  line-height: 1.12;
  letter-spacing: -0.045em;
  font-weight: 900;
  margin-bottom: 13px;
}

.news-description {
  flex: 1;
  color: #51413d;
  font-size: 15px;
  line-height: 1.45;
  margin-bottom: 20px;
}

.news-detail {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--orange);
  text-decoration: none;
  font-size: 17px;
  font-weight: 500;
}

.news-detail span {
  font-size: 24px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.news-detail:hover span {
  transform: translateX(5px);
}

.news-arrow {
  position: absolute;
  top: 50%;
  z-index: 20;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: var(--orange);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  transform: translateY(-50%);
  opacity: 1;
  visibility: visible;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;
}

.news-arrow:hover {
  background: var(--orange);
  color: var(--white);
  transform: translateY(-50%) scale(1.04);
}

.news-arrow.is-disabled,
.news-arrow:disabled {
  opacity: 0.45;
  cursor: default;
}

.news-arrow.is-disabled:hover {
  background: #ffffff;
  color: var(--orange);
  transform: translateY(-50%);
}

.news-arrow-left {
  left: 0;
}

.news-arrow-right {
  right: 0;
}

.news-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.news-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: min(520px, 100%);
  gap: 12px;
}

.news-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 61, 0, 0.22);
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.news-dot.active {
  background: var(--orange);
  transform: scale(1.12);
}

.news-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  color: #714021;
  background: rgba(255, 61, 0, 0.08);
  border: 1px solid rgba(255, 61, 0, 0.16);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.news-loading,
.news-empty {
  flex: 0 0 100%;
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 44px 20px;
  color: var(--text);
  text-align: center;
  font-size: 18px;
}

/* TABLET: 2 produkty */
@media (max-width: 1200px) {
  .news-section {
    padding: 70px 28px 58px;
  }

  .news-viewport {
    width: calc(100% - 130px);
  }

  .news-card {
    flex-basis: calc(100% / 2);
  }

  .news-image {
    height: 300px;
  }

  .news-title {
    font-size: 24px;
  }
}

/* TELEFÓN A MENŠÍ TABLET: 1 produkt */
@media (max-width: 900px) {
  .news-section {
    padding: 58px 18px 48px;
  }

  .news-header {
    display: block;
    margin-bottom: 24px;
  }

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

  .section-eyebrow span {
    width: 42px;
  }

  .news-header h2 {
    font-size: clamp(38px, 12vw, 58px);
    letter-spacing: -0.065em;
  }

  .news-header p {
    font-size: 17px;
  }

  .news-all-button {
    width: 100%;
    min-width: 0;
    margin-top: 20px;
    padding: 17px 20px;
    font-size: 17px;
  }

  .news-viewport {
    width: calc(100% - 92px);
  }

  .news-card {
    flex-basis: 100%;
    padding: 0 8px;
  }

  .news-card-inner {
    min-height: 0;
  }

  .news-image {
    height: 290px;
    padding: 18px 26px 10px;
  }

  .news-content {
    padding: 12px 22px 26px;
  }

  .news-meta {
    gap: 12px;
    margin-bottom: 17px;
  }

  .news-badge {
    min-width: auto;
    padding: 9px 14px 8px;
    font-size: 12px;
  }

  .news-category {
    font-size: 15px;
  }

  .news-title {
    font-size: 23px;
  }

  .news-description {
    font-size: 16px;
  }

  .news-detail {
    font-size: 18px;
  }

  .news-arrow {
    width: 54px;
    height: 54px;
    font-size: 30px;
  }

  .news-bottom {
    gap: 10px;
  }

  .news-dots {
    display: flex;
    gap: 12px;
  }

  .news-counter {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    font-size: 14px;
  }
}

@media (max-width: 520px) {
  .news-section {
    padding: 58px 18px;
  }

  .news-viewport {
    width: 100%;
  }

  .news-slider {
    padding-bottom: 72px;
  }

  .news-arrow {
    top: auto;
    bottom: 0;
    transform: none;
  }

  .news-arrow:hover {
    transform: scale(1.04);
  }

  .news-arrow.is-disabled:hover {
    transform: none;
  }

  .news-arrow-left {
    left: calc(50% - 70px);
  }

  .news-arrow-right {
    right: calc(50% - 70px);
  }

  .news-image {
    height: 245px;
    padding: 20px;
  }

  .news-content {
    padding: 12px 20px 26px;
  }
}

@media (max-width: 380px) {
  .news-header h2 {
    font-size: 38px;
  }

  .news-image {
    height: 220px;
  }
}


/* Fix: šípky zostanú vždy viditeľné a klikateľné, keď sú produkty načítané */
.news-slider .news-arrow {
  pointer-events: auto;
  z-index: 50;
}

.news-slider .news-arrow:not(:disabled) {
  opacity: 1;
  cursor: pointer;
}


/* Doladenie menších news kariet */
@media (max-width: 1200px) {
  .news-slider {
    max-width: 980px;
  }

  .news-viewport {
    width: calc(100% - 110px);
  }

  .news-card-inner {
    min-height: 410px;
  }

  .news-image {
    height: 190px;
  }
}

@media (max-width: 900px) {
  .news-slider {
    max-width: 100%;
  }

  .news-card-inner {
    min-height: 0;
  }

  .news-image {
    height: 250px;
  }
}

@media (max-width: 520px) {
  .news-image {
    height: 220px;
  }
}

/* Popup detail produktu */
.news-more-button {
  width: fit-content;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.news-modal-open {
  overflow: hidden;
}

.news-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.news-modal.is-open {
  display: flex;
}

.news-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.62);
  backdrop-filter: blur(4px);
}

.news-modal-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  overflow: auto;
  background: var(--white);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.news-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--black);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.news-modal-close:hover {
  background: var(--orange);
  color: var(--white);
  transform: scale(1.04);
}

.news-modal-grid {
  display: grid;
  grid-template-columns: minmax(280px, 42%) 1fr;
  gap: 0;
}

.news-modal-image-wrap {
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px 32px;
  background: #ffffff;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.news-modal-image {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
}

.news-modal-content {
  padding: 58px 46px 46px;
  display: flex;
  flex-direction: column;
}

.news-modal-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.news-modal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px 9px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--white);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.news-modal-category {
  color: #714021;
  font-size: 16px;
  font-weight: 700;
}

.news-modal-title {
  color: var(--black);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.06em;
  font-weight: 900;
  margin-bottom: 22px;
}

.news-modal-description {
  color: #51413d;
  font-size: 18px;
  line-height: 1.65;
  white-space: pre-line;
  margin-bottom: 30px;
}

.news-modal-link {
  width: fit-content;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  border-radius: 10px;
  background: var(--orange);
  color: var(--white);
  text-decoration: none;
  font-size: 17px;
  font-weight: 800;
  transition: background 0.2s ease, transform 0.2s ease;
}

.news-modal-link:hover {
  background: var(--orange-dark);
  transform: translateY(-2px);
}

.news-modal-link span {
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 760px) {
  .news-modal {
    padding: 16px;
  }

  .news-modal-panel {
    max-height: calc(100vh - 32px);
    border-radius: 14px;
  }

  .news-modal-grid {
    grid-template-columns: 1fr;
  }

  .news-modal-image-wrap {
    min-height: 260px;
    padding: 54px 24px 22px;
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .news-modal-image {
    max-height: 240px;
  }

  .news-modal-content {
    padding: 28px 24px 30px;
  }

  .news-modal-description {
    font-size: 16px;
  }

  .news-modal-link {
    width: 100%;
    justify-content: center;
  }
}
