/* css/popup.css — попап подписки HEBRANTE */

.hb-popup,
.hb-popup *,
.hb-popup *::before,
.hb-popup *::after {
  box-sizing: border-box;
}

.hb-popup {
  /* подставь точные значения из общих переменных проекта */
  --hb-oscuro: #21271B;
  --hb-claro: #F2F2F2;
  --hb-borde: rgba(242, 240, 237, 0.28);
  --hb-error: #d4736a;
  --hb-fondo: rgba(20, 16, 13, 0.55);

  --height-xxl: 12vh;
    --height-xl: 8vh;
    --height-lg: 6vh;
    --height-md: 4vh;
    --height-sm: 3vh;
    --height-xs: 2vh;
    --height-xxs: 1vh;

    --space-xxs: 0.2vw;
    --space-xs: 0.5vw;
	--space-sm: 1vw;
	--space-md: 1.5vw;
	--space-lg: 2vw;
	--space-xl: 4vw;
    --space-xxl: 5vw;

    --text-sm: 0.8vw;
    --text-md: 1vw;
    --text-lg: 1.2vw;
    --h1: 4vw;
    --h2: 2.5vw;
    --h3: 1.8vw;

    --font-main: 'Mohave', sans-serif;

    --radius-lg: 24px;

  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  background: var(--hb-fondo);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.hb-popup.is-visible {
  opacity: 1;
  visibility: visible;
}

body.hb-popup-abierto {
  overflow: hidden;
}

/* ---------- каркас ---------- */

.hb-popup__caja {
  position: relative;
  display: grid;
  grid-template-columns: 300px 1fr;
  width: 100%;
  max-width: 50vw;
  max-height: calc(100vh - 48px);
  background: var(--hb-claro);
  overflow: hidden;
  transform: translateY(16px) scale(0.985);
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.hb-popup.is-visible .hb-popup__caja {
  transform: none;
}

.hb-popup__img {
  overflow: hidden;
  background: #d9d5d0;
}

.hb-popup__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hb-popup__cont {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--space-md);
  overflow-y: auto;
  text-align: center;
}

/* ---------- кнопка закрытия ---------- */

.hb-popup__x {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--hb-oscuro);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.hb-popup__x:hover,
.hb-popup__x:focus-visible {
  opacity: 1;
}

/* ---------- тексты ---------- */

.hb-popup__titulo {
  margin: 0;
  color: var(--hb-oscuro);
  font-family: var(--font-main);
  font-size: var(--text-md);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hb-popup__sub {
  margin: 0;
  color: var(--hb-oscuro);
  font-family: var(--font-main);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}

.hb-popup__desc {
  margin: 6px 0 0;
  color: var(--hb-oscuro);
  font-family: var(--font-main);
  font-size: var(--h1);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
}

.hb-popup__nota {
  margin: 0 0 12px;
  color: var(--hb-oscuro);
  font-family: var(--font-main);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ---------- форма ---------- */

.hb-popup__form {
  display: flex;
  flex-direction: column;
  gap: var(--height-xs);
  text-align: left;
}

.hb-popup__campo {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hb-popup__input,
.hb-popup__select {
  width: 100%;
  height: var(--height-md);
  padding: 0 var(--space-sm);
  border: 1px solid rgba(33, 28, 24, 0.25);
  border-radius: 0;
  background: transparent;
  color: var(--hb-oscuro);
  font-family: var(--font-main);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.hb-popup__input::placeholder {
  color: rgba(33, 28, 24, 0.45);
  text-transform: uppercase;
}

.hb-popup__input:focus,
.hb-popup__select:focus {
  outline: none;
  border-color: var(--hb-oscuro);
}

.hb-popup__input:active,
.hb-popup__select:active {
  outline: none;
  border-color: var(--hb-oscuro);
}

.hb-popup__input.is-error,
.hb-popup__select.is-error {
  border-color: var(--hb-error);
}

.hb-popup__select {
  /* стрелка вместо системной */
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23211c18' stroke-width='1.2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
  cursor: pointer;
}

.hb-popup__cumple {
    width: 100%;
  display: flex;
  flex-direction: row;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
}

.hb-popup__cumple .hb-popup__select {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.hb-popup__cumple .hb-popup__err {
  flex: 0 0 100%;
}

/* honeypot: уводим за экран, а не display:none */
.hb-popup__trampa {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hb-popup__input:-webkit-autofill,
.hb-popup__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--hb-oscuro);
  -webkit-box-shadow: 0 0 0 1000px var(--hb-claro) inset;
}

/* ---------- согласие ---------- */

.hb-popup__consent {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.hb-popup__check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--hb-oscuro);
  font-size: var(--text-sm);
  line-height: 1.45;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.hb-popup__check input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--hb-oscuro);
  cursor: pointer;
}

.hb-popup__legal {
  max-height: 0;
  overflow: hidden;
  color: var(--hb-oscuro);
  font-size: var(--text-sm);
  line-height: 1.3;
  letter-spacing: 0.01em;
  opacity: 0.6;
  transition: max-height 0.3s ease, margin 0.3s ease;
}

.hb-popup__legal.is-abierto {
  max-height: 240px;
  margin-top: 4px;
  overflow-y: auto;
}

.hb-popup__legal p {
  margin: 0 0 6px;
}

.hb-popup__legal a {
  color: inherit;
  text-decoration: underline;
}

.hb-popup__legal-toggle {
  align-self: flex-start;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--hb-oscuro);
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: underline;
  opacity: 0.55;
  cursor: pointer;
}

.hb-popup__legal-toggle:hover {
  opacity: 1;
}

/* ---------- кнопка ---------- */

.hb-popup__btn {
  height: var(--height-md);
  margin-top: 6px;
  border: 0;
  border-radius: 0;
  background: var(--hb-oscuro);
  color: var(--hb-claro);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s ease;
  border-radius: var(--radius-lg);
}

.hb-popup__btn:hover {
  opacity: 0.85;
}

.hb-popup__btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ---------- ошибки ---------- */

.hb-popup__err {
  display: block;
  min-height: 0;
  color: var(--hb-error);
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: 0.04em;
}

.hb-popup__err:empty {
  display: none;
}

.hb-popup__err--general {
  margin: 4px 0 0;
  text-align: center;
  font-size: 10px;
}

.hb-popup__cont--exito {
  justify-content: center;
  gap: 14px;
}

.hb-popup__cont--exito .hb-popup__sub {
  max-width: 34ch;
  margin-inline: auto;
  line-height: 1.6;
  text-transform: none;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

/* ---------- планшет ---------- */

@media (max-width: 860px) {
  .hb-popup__caja {
    grid-template-columns: 240px 1fr;
    max-width: 600px;
  }

  .hb-popup__cont {
    padding: 32px 28px 28px;
  }
}

/* ---------- мобильный: bottom-sheet ---------- */

@media (max-width: 768px) {
  .hb-popup {
    align-items: flex-end;
    padding: 0;
    overflow-x: hidden;
  }

  .hb-popup__caja {
    display: flex;            /* вместо grid */
    flex-direction: column;
    max-width: none;
    max-height: 92svh;
    transform: translateY(100%);
    overflow-y: visible;
  }

  .hb-popup__img {
    flex: 0 0 auto;
    height: 120px;              /* горизонтальная полоса 3:2, обрезается по центру */
  }

  .hb-popup__cont {
    flex: 1 1 auto;
    min-height: 0;            /* ← без этого блок раздувается */
    overflow-y: auto;
    padding: 26px 22px calc(24px + env(safe-area-inset-bottom));
    gap: 6px;
    /* инерционный скролл, чтобы форма пролистывалась под клавиатурой */
    -webkit-overflow-scrolling: touch;
  }

  .hb-popup__x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 44px;
  height: 44px;
  z-index: 3;
  color: var(--hb-claro);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  opacity: 0.9;

  }

  .hb-popup__input,
  .hb-popup__select {
    height: 36px;
    font-size: 12px;           /* меньше 16px — Safari зумит страницу при фокусе */
    letter-spacing: 0.04em;
    padding: 0 12px;
    display: flex;
    align-items: center;
  }

  .hb-popup__select {
  line-height: 1;
}

  .hb-popup__input::placeholder {
    font-size: 12px;
    letter-spacing: 0.08em;
  }

    .hb-popup__select::placeholder {
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .hb-popup__titulo {
  font-size: 20px;
}

.hb-popup__sub {
  font-size: 14px;
}

.hb-popup__desc {
  font-size: 40px;
}

.hb-popup__nota {
  font-size: 14px;
}

.hb-popup__consent {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.hb-popup__check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--hb-oscuro);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.hb-popup__check input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 1px 0 0;
  accent-color: var(--hb-oscuro);
  cursor: pointer;
}

.hb-popup__legal {
  max-height: 0;
  overflow: hidden;
  color: var(--hb-oscuro);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  opacity: 0.6;
  transition: max-height 0.3s ease, margin 0.3s ease;
}

.hb-popup__legal.is-abierto {
  max-height: 140px;
  margin-top: 4px;
  overflow-y: auto;
}

.hb-popup__legal p {
  margin: 0 0 6px;
}

.hb-popup__legal a {
  color: inherit;
  text-decoration: underline;
}

.hb-popup__legal-toggle {
  align-self: flex-start;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--hb-oscuro);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: underline;
  opacity: 0.55;
  cursor: pointer;
}

.hb-popup__legal-toggle:hover {
  opacity: 1;
}


.hb-popup__cumple {
    width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.hb-popup__cumple .hb-popup__select {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.hb-popup__cumple .hb-popup__err {
  flex: 0 0 100%;
  margin-top: -12px;
}

.hb-popup__form {
  gap: 10px;
}

.hb-popup__btn {
  height: 40px;
  margin-top: 4px;
}
  
}

/* очень низкие экраны: прячем картинку, чтобы форма влезла */
@media (max-width: 768px) and (max-height: 620px) {
  .hb-popup__img {
    display: none;
  }

  .hb-popup__x {
    color: var(--hb-oscuro);
    text-shadow: none;
  }
}

/* ---------- доступность ---------- */

.hb-popup button:focus-visible,
.hb-popup a:focus-visible {
  outline: 2px solid var(--hb-oscuro);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .hb-popup,
  .hb-popup__caja,
  .hb-popup__legal {
    transition: none;
  }
}