/**
 * Главная: блок «Акции и скидки» — сетка вместо Owl Carousel (#discount-slider).
 */
/* Компактнее только эта секция: база .discount-section в style_2min — 60px 0 80px */
section#discount .discount-section {
  padding-top: 20px;
  padding-bottom: 60px;
}

/* Ещё −20px сверху заголовка, без сдвига стыка с блоком выше (не трогаем padding секции) */
section#discount .sec-head-container {
  margin-top: 80px;
}

/*
 * /akczii/: чанк «Akcii» (pdoResources + заголовок) подключается внутри шаблонного .white-bg > .container.
 * Второй .sec-head-container оказывается прямым ребёнком .container — ширина ~max-width BS.
 * Full-bleed без правки всех шаблонов MODX.
 */
.white-bg > .container > .sec-head-container {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  box-sizing: border-box;
}

#discount-slider.pgt-discount-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem 1rem;
  align-items: stretch;
  width: 100%;
  margin: 0;
}

#discount-slider.pgt-discount-grid > .item {
  float: none;
  clear: both;
  width: auto;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
}

/* Ссылка только на превью — не тянуть на высоту строки (ломало поток с h3/p) */
#discount-slider.pgt-discount-grid > .item > a.clients-logo {
  display: block;
  flex: 0 0 auto;
  max-width: 100%;
}

#discount-slider.pgt-discount-grid > .item > a.clients-logo img,
#discount-slider.pgt-discount-grid > .item > a img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
}

#discount-slider.pgt-discount-grid > .item > h3 {
  flex: 0 0 auto;
  margin: 0.75rem 0 0.35rem;
  font-size: 1.05rem;
  line-height: 1.35;
}

#discount-slider.pgt-discount-grid > .item > h3 a {
  color: #000;
  font-weight: 700;
  text-decoration: none;
}

#discount-slider.pgt-discount-grid > .item > h3 a:hover {
  color: var(--pgt-hero-accent, #00c1b2);
  text-decoration: none;
}

#discount-slider.pgt-discount-grid > .item > h3 a:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

#discount-slider.pgt-discount-grid > .item > p {
  flex: 1 1 auto;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #555;
}

/* Если в шаблоне когда-нибудь обернут весь блок в одну ссылку (не .clients-logo) */
#discount-slider.pgt-discount-grid > .item > a:not(.clients-logo) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  text-decoration: none;
  color: inherit;
}

/**
 * Категории акций (плитки с картинкой): сетка с gap, заголовок по центру изображения.
 * Разметка: см. partials/promo-categories-grid.example.html
 */
.pgt-promo-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

@media (max-width: 767.98px) {
  .pgt-promo-categories {
    grid-template-columns: 1fr;
  }
}

a.akcii {
  position: relative;
  display: block;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  box-sizing: border-box;
}

a.akcii:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

a.akcii img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

a.akcii .a-title {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  padding: 0.75rem 1rem 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.9),
    0 0 14px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  transition:
    color 0.22s ease,
    transform 0.22s ease;
}

a.akcii:hover .a-title,
a.akcii:focus-visible .a-title {
  color: var(--pgt-hero-accent, #00c1b2);
  transform: translateY(-4px);
}

/**
 * Та же вёрстка без смены MODX: float-колонки → grid с gap внутри .col-md-12.
 * Селектор с :has() — только блоки с плитками .akcii.
 */
.row > .col-md-12:has(> .nopad.col-md-6 > .akcii) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.row > .col-md-12:has(> .nopad.col-md-6 > .akcii) > .nopad.col-md-6 {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

@media (max-width: 767.98px) {
  .row > .col-md-12:has(> .nopad.col-md-6 > .akcii) {
    grid-template-columns: 1fr;
  }
}

div.akcii {
  position: relative;
  display: block;
  overflow: hidden;
  box-sizing: border-box;
}

div.akcii > a:first-of-type {
  position: relative;
  z-index: 0;
  display: block;
}

div.akcii > a:first-of-type img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

div.akcii > .a-title {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  padding: 0.75rem 1rem 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.9),
    0 0 14px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  pointer-events: none;
}

div.akcii > .a-title a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  pointer-events: auto;
  transition:
    color 0.22s ease,
    transform 0.22s ease;
}

div.akcii:hover > .a-title a,
div.akcii:focus-within > .a-title a {
  color: var(--pgt-hero-accent, #00c1b2);
  transform: translateY(-4px);
}

div.akcii > a:first-of-type:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

div.akcii > .a-title a:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  a.akcii .a-title,
  div.akcii > .a-title a {
    transition: none;
  }

  a.akcii:hover .a-title,
  a.akcii:focus-visible .a-title,
  div.akcii:hover > .a-title a,
  div.akcii:focus-within > .a-title a {
    transform: none;
  }
}
