/* ═══════════════════════════════════════════════════
   БЛОК «СИСТЕМА ПРИВИЛЕГИЙ»
   Файл: assets/css/privilege-block.css
   ═══════════════════════════════════════════════════ */

/* ──────────────────────────────────────────
   SECTION
   ────────────────────────────────────────── */
.privilege-section {
  background: rgba(226, 226, 226, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 190px;
  padding: 60px 80px;
  min-height: 260px;
  /* не выходим за рамки сайта */
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  margin-bottom: -7.75rem;
}

/* Без фонового цвета (включается в ACF) */
.privilege-section--no-bg {
  background: transparent;
}

/* ─── Снимаем overflow с секций содержащих блок привилегий ───
   Предотвращает обрезку фона. Для PHP-шаблонов, где блок
   внутри section — добавляется класс has-privilege */
section.has-privilege {
  overflow: visible !important;
}

/* Убираем overflow у внутреннего div тоже */
section.has-privilege>div {
  overflow: visible !important;
}

.privilege-text {
  flex: 0 0 auto;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.privilege-title {
  font-size: 52px;
  font-weight: 400;
  letter-spacing: -0.52px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 1);
  line-height: 1.05;
  margin-bottom: 20px;
}

.privilege-desc {
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
  color: rgba(0, 0, 0, 1);
  margin-bottom: 28px;
}

.privilege-btn {
  display: inline-block;
  padding: 16px 108px;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: rgba(0, 0, 0, 1);
  background: rgba(226, 226, 226, 1);
  border: 1px solid rgba(0, 0, 0, 1);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.privilege-btn:hover {
  background: rgba(0, 0, 0, 1);
  color: #fff;
}

/* На десктопе мобильная кнопка скрыта */
.privilege-btn--mobile {
  display: none;
}

/* ──────────────────────────────────────────
   LOYALTY CARD  (576 × 335)
   ────────────────────────────────────────── */
.privilege-card {
  flex: 0 0 auto;
  width: 576px;
  height: 335px;
  background: #1a1a1a;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
}

/* Фото на всю карточку */
.privilege-card__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Градиент поверх фото — убираем когда есть фото */
.privilege-card .card-overlay-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(26, 26, 26, 0.85) 0%, rgba(26, 26, 26, 0.3) 50%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

/* Когда фото есть — градиент не нужен */
.privilege-card--has-photo .card-overlay-grad {
  display: none;
}

/* Правый тёмный блок (без фото — видна тёмная плашка) */
.privilege-card .card-overlay-dark {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 55%;
  background: linear-gradient(135deg, #2a2a2a 0%, #111 100%);
  overflow: hidden;
  /* Если есть фото — скрываем этот блок */
  z-index: 0;
}

/* Когда фото есть — скрываем тёмную заглушку */
.privilege-card--has-photo .card-overlay-dark {
  display: none;
}

.privilege-card .card-overlay-dark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 60% 40%, rgba(180, 160, 140, .25) 0%, transparent 70%);
}

/* ──────────────────────────────────────────
   POPUP
   ────────────────────────────────────────── */
.privilege-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.privilege-popup-overlay.active {
  display: flex;
}

.privilege-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

.privilege-popup-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 815px;
  width: 100%;
  margin: 0 16px;
}

.privilege-popup-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 10px;
  padding: 4px;
  transition: opacity 0.2s;
  align-self: flex-end;
}

.privilege-popup-close:hover {
  opacity: .7;
}

.privilege-popup-box {
  background: rgba(226, 226, 226, 1);
  padding: 44px 38px;
  width: 100%;
  /* Фиксированная высота попапа 565px */
  min-height: 565px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.privilege-popup-title {
  font-size: 29px;
  font-weight: 400;
  line-height: 34px;
  letter-spacing: -0.52px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 1);
  margin-bottom: 28px;
  font-family: inherit;
}

.privilege-popup-list {
  list-style: none;
  margin-bottom: 2px;
  padding: 0;
  flex: 1;
}

.privilege-popup-list li {
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
  color: rgba(0, 0, 0, 1);
  padding-left: 18px;
  position: relative;
  margin-bottom: 20px;
}

.privilege-popup-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0;
}

.privilege-popup-list li strong {
  font-weight: 700;
}

/* Desktop actions */
.privilege-popup-actions-desktop {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.privilege-popup-phone-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(242, 242, 242, 1);
  padding: 16px 16px;
  flex: 0 0 auto;
}

.privilege-popup-phone-link {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: rgba(0, 0, 0, 1);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.privilege-popup-btns-row {
  display: flex;
  gap: 12px;
  flex: 1;
}

.privilege-popup-btn {
  flex: 1;
  padding: 16px 16px;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: rgba(0, 0, 0, 1);
  background: rgba(226, 226, 226, 1);
  border: 1px solid rgba(0, 0, 0, 1);
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.privilege-popup-btn:hover {
  background: rgba(0, 0, 0, 1);
  color: #fff;
}

/* Mobile actions — скрыты по умолчанию */
.privilege-popup-actions-mobile {
  display: none;
}

/* ──────────────────────────────────────────
   MOB-BR — перенос только на мобиле
   Использование: <br class="mob-br">
   ────────────────────────────────────────── */
br.mob-br {
  display: none;
}

br.desc-br {
  display: block;
}

/* ──────────────────────────────────────────
   MOBILE
   ────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Мобильный перенос — включаем */
  br.mob-br {
    display: block;
  }
  
  /* Мобильный перенос — включаем */
  br.desc-br {
    display: none;
  }

  /* Section — строго вписываемся в ширину экрана */
  .privilege-section {
    flex-direction: column;
    gap: 0;
    padding: 32px 40px;
    align-items: stretch;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0rem;
  }

  /* Padding только на главной — на других страницах есть свой контейнер */
  body.home .privilege-section {
    padding: 32px 40px;
  }

  
  
  .privilege-text {
    order: 0;
    margin-bottom: 20px;
    max-width: 100%;
  }

  .privilege-title {
    font-size: 28px;
    line-height: 28px;
    letter-spacing: -0.28px;
    margin-bottom: 12px;
  }

  .privilege-desc {
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    margin-bottom: 0;
  }

  /* Скрываем десктопную кнопку */
  .privilege-btn--desktop {
    display: none !important;
  }

  /* Карточка — полная ширина */
  .privilege-card {
    order: 1;
    width: 100%;
    max-width: 100%;
    height: 190px;
    border-radius: 10px;
    margin-bottom: 16px;
    box-sizing: border-box;
  }

  /* Мобильная кнопка под карточкой */
  .privilege-btn--mobile {
    display: block;
    order: 2;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    width: 100%;
    text-align: center;
    padding: 16px 20px;
    box-sizing: border-box;
  }

  /* Popup mobile: 334px × 605px */
  .privilege-popup-wrapper {
    max-width: 334px;
    width: 100%;
    margin: 0 auto;
    align-items: stretch;
    padding: 0;
  }

  .privilege-popup-close {
    position: absolute;
    top: -42px;
    right: 0;
    margin-bottom: 0;
  }

  .privilege-popup-box {
    padding: 32px 27px;
    min-height: 605px;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    justify-content: flex-start;
    gap: 0;
  }

  .privilege-popup-title {
    font-size: 16px;
    font-weight: 400;
    line-height: 120%;
    letter-spacing: 0;
    margin-bottom: 16px;
    text-align: center;
  }

  .privilege-popup-list li {
    font-size: 14px;
    font-weight: 400;
    line-height: 130%;
    margin-bottom: 15px;
  }

  /* Переключаем группы кнопок */
  .privilege-popup-actions-desktop {
    display: none;
  }

  .privilege-popup-actions-mobile {
    display: block;
  }

  .privilege-mob-phone-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
  }

  .privilege-mob-phone-link {
    font-size: 20px;
    line-height: 28px;
    color: rgba(0, 0, 0, 1);
    text-decoration: underline;
    text-decoration-color: rgba(126, 126, 126, 1);
    text-decoration-style: solid;
    font-family: inherit;
  }

  .privilege-mob-icons {
    display: flex;
    gap: 25px;
    align-items: center;
  }

  .privilege-mob-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .privilege-mob-btn {
    width: 100%;
    padding: 16px 16px;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: rgba(0, 0, 0, 1);
    background: rgba(226, 226, 226, 1);
    border: 1px solid rgba(0, 0, 0, 1);
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
    text-decoration: none;
    display: block;
    box-sizing: border-box;
  }

  .privilege-mob-btn:hover {
    background: rgba(0, 0, 0, 1);
    color: #fff;
  }
}