/*
Theme Name: Dolchester Promo
Theme URI: https://www.promoscigarrillos.com
Description: Landing de promoción "Ganá un iPhone 17 Pro" para Dolchester Black. Tema autónomo, mismo esquema que piermundial.com (tema propio + assets locales).
Author: —
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: dolchester-promo
*/

/* ============================================================
   1. RESET Y BASE
   ============================================================ */

html, body { margin: 0; padding: 0; }

* { box-sizing: border-box; }

body.dolch-body {
  background: #150a02;
  background-image: url(assets/images/bg-page.png);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  font-family: Mulish, "proxima-nova", system-ui, sans-serif;
  color: #2a2a2a;
  -webkit-font-smoothing: antialiased;
}

body.dolch-locked { overflow: hidden; }

a { color: #e8843d; text-decoration: none; }
a:hover { color: #ffa864; text-decoration: underline; }

img { border: 0; }

.dolch-visually-hidden {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

/* ============================================================
   2. ESTRUCTURA
   ============================================================ */

.dolch-shell {
  max-width: 1080px;
  margin: 0 auto;
  position: relative;
}

.dolch-hero {
  position: relative;
  container-type: inline-size;
}

.dolch-hero__dark,
.dolch-hero__orange {
  position: absolute;
  left: 0;
  right: 0;
  background-size: 100% 100%;
  background-position: center;
  pointer-events: none;
}

/* 472px de canvas + 168px de banda oscura = 640/1080 = 59.26cqw */
.dolch-hero__dark {
  top: 0;
  height: 59.26cqw;
  background-image: url(assets/images/bg-hero-dark.png);
}

.dolch-hero__orange {
  top: 59.26cqw;
  bottom: 0;
  background-image: url(assets/images/bg-hero-orange.png);
}

/* ============================================================
   3. HERO DESKTOP — lienzo de 1080x472 escalado por container queries
   ============================================================ */

.dolch-hero__canvas {
  position: relative;
  z-index: 1;
  aspect-ratio: 1080 / 472;
  overflow: hidden;
}

.dolch-header {
  height: 8.889cqw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4.63cqw 0 3.241cqw;
}

.dolch-header__logo {
  height: 3.333cqw;
  width: auto;
  display: block;
}

.dolch-badge {
  border: 1px solid #b78f4d;
  background: #000;
  padding: 0.741cqw 2.037cqw;
  font-family: "copperplate", Copperplate, serif;
  font-weight: 500;
  font-size: 1.111cqw;
  letter-spacing: 0.12cqw;
  color: #d9d2c6;
  white-space: nowrap;
}

.dolch-badge strong { color: #fff; font-weight: 700; }

.dolch-hero__stage { position: relative; height: 34.815cqw; }

.dolch-hero__title {
  position: absolute;
  left: 0;
  right: 0;
  top: 3.333cqw;
  text-align: center;
  font-family: "proxima-nova", Mulish, system-ui, sans-serif;
  font-size: 3.889cqw;
  font-weight: 800;
  letter-spacing: -0.028cqw;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
  margin: 0;
}

.dolch-hero__art {
  position: absolute;
  left: 24.259%;
  top: 7.222cqw;
  width: 52.593%;
  height: auto;
  display: block;
}

.dolch-hero__filtro {
  position: absolute;
  left: 81.019%;
  top: 9.63cqw;
  width: 14.074%;
  height: 14.444cqw;
  display: block;
}

.dolch-hero__filtro-txt {
  position: absolute;
  left: 78.333%;
  top: 26.389cqw;
  width: 19.444%;
  text-align: center;
  font-family: "copperplate", Copperplate, serif;
  font-weight: 300;
  font-size: 0.926cqw;
  letter-spacing: 0.13cqw;
  line-height: 1.6;
  color: #d8cdb8;
}

/* ============================================================
   4. HERO MOBILE
   ============================================================ */

.dolch-hero__mobile { display: none; }

/* ============================================================
   5. TARJETA DEL FORMULARIO
   ============================================================ */

.dolch-card-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 0 16px 35px;
}

.dolch-card {
  width: 100%;
  max-width: 886px;
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  padding: 44px 56px 34px;
}

.dolch-card__heading {
  font-size: 23px;
  font-weight: 600;
  color: #e8843d;
  letter-spacing: -0.2px;
  margin: 0 0 30px;
}

.dolch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 26px 72px;
}

.dolch-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- campos de línea --- */

.dolch-field { position: relative; }

.dolch-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #d2d2d2;
  background: transparent;
  font-family: Mulish, "proxima-nova", system-ui, sans-serif;
  font-size: 14px;
  color: #2a2a2a;
  padding: 4px 2px 9px;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
}

.dolch-input::placeholder { color: #a3a3a3; opacity: 1; }
.dolch-input:focus { border-bottom-color: #e8843d; }

/* --- selects pill --- */

.dolch-select-wrap { position: relative; }

.dolch-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 31px;
  border: 1px solid #1e1e1e;
  border-radius: 999px;
  background: #fff;
  text-align: center;
  text-align-last: center;
  font-family: Mulish, "proxima-nova", system-ui, sans-serif;
  font-size: 12px;
  color: #2a2a2a;
  padding: 0 26px;
  outline: none;
}

.dolch-select:focus { border-color: #e8843d; }
.dolch-select:disabled { opacity: 0.55; }

.dolch-caret {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: block;
}

.dolch-select:disabled + .dolch-caret { opacity: 0.55; }

/* --- checkbox de aceptación (modal de bases) ---
   El "No soy un robot" del diseño salió: lo reemplaza el campo reCAPTCHA v2
   de Gravity Forms cuando haya claves (ver inc/gf-form-definition.php).
   .dolch-check sigue en uso para el check de aceptación del modal. */

.dolch-check {
  width: 22px;
  height: 22px;
  border: 1.5px solid #9a9a9a;
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  transition: all 0.16s;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}

.dolch-check[aria-checked="true"] {
  border-color: #e8843d;
  background: #e8843d;
}

.dolch-check__tick { visibility: hidden; }
.dolch-check[aria-checked="true"] .dolch-check__tick { visibility: visible; }

.dolch-human__label {
  font-size: 12.5px;
  color: #3a3a3a;
  cursor: pointer;
  user-select: none;
}

/* --- errores --- */

.dolch-error {
  color: #e02020;
  font-size: 11px;
  margin-top: 5px;
  display: none;
}

.dolch-field.is-invalid .dolch-error,
.dolch-field.is-invalid .dolch-error--pill { display: block; }

.dolch-error--pill { margin-top: 6px; }

.dolch-field.is-invalid .dolch-input { border-bottom-color: #e02020; }
.dolch-field.is-invalid .dolch-select { border-color: #e02020; }

/* --- acciones --- */

.dolch-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  margin-top: 2px;
}

.dolch-btn {
  border: 0;
  background: #e8843d;
  color: #fff;
  font-family: Mulish, "proxima-nova", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.6px;
  padding: 11px 44px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s;
}

.dolch-btn:hover { background: #f0954f; }
.dolch-btn:active { background: #cf6f2c; }
.dolch-btn:disabled { background: #d6d6d6; cursor: not-allowed; }

.dolch-required {
  font-size: 12px;
  color: #6a6a6a;
}

.dolch-required span { color: #e02020; }

/* --- estado "ya participaste" --- */

.dolch-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 28px 8px 20px;
}

.dolch-done__title {
  font-size: 23px;
  font-weight: 700;
  color: #e8843d;
  letter-spacing: -0.2px;
}

.dolch-done__text {
  font-size: 14px;
  line-height: 1.7;
  color: #3a3a3a;
  max-width: 520px;
}

.dolch-done__note {
  font-size: 12px;
  color: #8f8f8f;
  margin-top: 4px;
}

[hidden] { display: none !important; }

/* ============================================================
   6. FRANJA SANITARIA Y PIE
   ============================================================ */

.dolch-sanitario { display: block; width: 100%; height: auto; background: #000; }

.dolch-sanitario--mobile { display: none; background: #000; }

.dolch-legal {
  background: #000;
  padding: 22px 24px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.dolch-legal__age {
  font-size: 12px;
  font-weight: 600;
  color: #e6e6e6;
  letter-spacing: 0.4px;
}

.dolch-legal__text {
  font-size: 11px;
  color: #8f8f8f;
  max-width: 760px;
  line-height: 1.6;
}

/* ============================================================
   7. MODALES
   ============================================================ */

.dolch-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 1, 0.72);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 60;
}

.dolch-modal--sent { z-index: 70; }

.dolch-modal__box {
  width: 100%;
  max-width: 580px;
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  padding: 38px 40px 32px;
}

.dolch-modal__box--sent {
  max-width: 520px;
  padding: 44px 44px 36px;
  text-align: center;
}

.dolch-modal__title {
  font-size: 21px;
  font-weight: 700;
  color: #e8843d;
  letter-spacing: -0.2px;
  margin: 0 0 22px;
}

.dolch-bases {
  height: 210px;
  overflow-y: auto;
  padding-right: 16px;
  font-size: 12.5px;
  line-height: 1.95;
  color: #2f2f2f;
  text-align: justify;
  white-space: pre-line;
  overscroll-behavior: contain;
}

.dolch-bases::-webkit-scrollbar { width: 8px; }
.dolch-bases::-webkit-scrollbar-thumb { background: #c9c9c9; border-radius: 8px; }
.dolch-bases::-webkit-scrollbar-track { background: #efefef; border-radius: 8px; }

.dolch-accept {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 20px;
}

.dolch-accept .dolch-check {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 12px;
}

.dolch-accept.is-locked .dolch-check,
.dolch-accept.is-locked .dolch-human__label {
  opacity: 0.45;
  cursor: not-allowed;
}

.dolch-modal__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
}

.dolch-modal__hint {
  font-size: 11px;
  color: #8f8f8f;
  text-align: center;
  min-height: 14px;
}

.dolch-btn--wide { padding: 12px 52px; border-radius: 9px; }

.dolch-sent__title {
  font-size: 22px;
  font-weight: 700;
  color: #e8843d;
  margin: 0 0 14px;
}

.dolch-sent__text {
  font-size: 14px;
  line-height: 1.7;
  color: #3a3a3a;
}

.dolch-sent__btn { margin-top: 28px; padding: 12px 44px; border-radius: 9px; }

/* ============================================================
   8. MOBILE — corte en 760px, igual que el diseño aprobado
   ============================================================ */

@media (max-width: 759px) {

  .dolch-hero__dark,
  .dolch-hero__orange,
  .dolch-hero__canvas { display: none; }

  .dolch-hero__mobile {
    display: flex;
    position: relative;
    z-index: 1;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px 46px;
    background-image: url(assets/images/bg-hero-dark.png);
    background-size: 100% 100%;
    background-position: center;
  }

  .dolch-hero__mobile-logo {
    width: 100%;
    max-width: 420px;
    height: auto;
    display: block;
  }

  .dolch-hero__mobile-title {
    text-align: center;
    font-family: "proxima-nova", Mulish, system-ui, sans-serif;
    font-size: 27px;
    line-height: 1.12;
    font-weight: 800;
    color: #fff;
    margin: 16px 0 0;
  }

  .dolch-hero__mobile-art {
    width: 100%;
    max-width: 248px;
    height: auto;
    display: block;
    margin: 8px 0 -104px;
  }

  .dolch-hero__mobile-badge {
    position: relative;
    z-index: 3;
    margin-bottom: -34px;
    border: 1px solid #b78f4d;
    background: #000;
    padding: 7px 18px;
    font-family: "copperplate", Copperplate, serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 1.1px;
    line-height: 1.5;
    color: #d9d2c6;
    text-align: center;
  }

  .dolch-card-wrap {
    background-image: url(assets/images/bg-hero-orange.png);
    background-size: 100% 100%;
    background-position: center;
  }

  .dolch-card { padding: 22px 18px 20px; }

  .dolch-card__heading { font-size: 19px; margin-bottom: 18px; }

  .dolch-grid { gap: 14px 0; }

  .dolch-col { gap: 14px; }

  .dolch-sanitario { display: none; }

  .dolch-sanitario--mobile { display: block; }

  .dolch-sanitario--mobile img { display: block; width: 100%; height: auto; }

  .dolch-modal { padding: 16px; }

  .dolch-modal__box { padding: 26px 22px 24px; border-radius: 20px; }

  .dolch-bases { height: 42vh; }
}

/* ============================================================
   9. ANIMACIONES

   Dos capas distintas:

   a) ENTRADA — cada pieza aparece una sola vez al cargar, escalonada de
      arriba hacia abajo. Son animaciones CSS con `both`, así que el estado
      inicial (invisible) lo pinta el navegador antes del primer frame: no
      hay parpadeo ni hace falta JavaScript.

   b) CONTINUA — el brillo detrás del producto late, para siempre.

   El brillo hace las dos cosas, y declara las dos animaciones en la misma
   regla. La continua arranca con un delay que la deja empezar cuando la de
   entrada ya terminó; al ser la última de la lista gana sobre la misma
   propiedad. Por eso las dos abren y cierran en el mismo estado (opacidad 1,
   escala 1), o el relevo se vería como un salto.
   ============================================================ */

@keyframes dolch-aparecer {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes dolch-fundido {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes dolch-entrada-art {
  from { opacity: 0; transform: translate3d(0, 26px, 0) scale(0.965); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

/* El brillo sube y baja de intensidad. Ciclo largo y desfasado del de la
   foto (7,5s contra 9s) para que no se sincronicen y se note el patrón. */
@keyframes dolch-latido {
  0%   { opacity: 1;    transform: translate(-50%, -50%) scale(1); }
  50%  { opacity: 0.55; transform: translate(-50%, -50%) scale(0.94); }
  100% { opacity: 1;    transform: translate(-50%, -50%) scale(1); }
}

@keyframes dolch-glow-entrada {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* --- el brillo detrás del producto --- */

.dolch-hero__glow {
  position: absolute;
  left: 50.5%;
  top: 18.5cqw;
  width: 64%;
  height: 30cqw;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 178, 96, 0.34) 0%,
    rgba(232, 132, 61, 0.20) 34%,
    rgba(180, 96, 40, 0.07) 58%,
    rgba(180, 96, 40, 0) 74%
  );
  animation:
    dolch-glow-entrada 1.2s ease-out 0.3s both,
    dolch-latido 7.5s ease-in-out 1.5s infinite;
}

/* --- entradas escalonadas --- */

.dolch-hero__dark,
.dolch-hero__orange { animation: dolch-fundido 1.1s ease-out both; }

.dolch-header__logo      { animation: dolch-aparecer 0.8s ease-out 0.05s both; }
.dolch-badge             { animation: dolch-aparecer 0.8s ease-out 0.14s both; }
.dolch-hero__title       { animation: dolch-aparecer 0.85s ease-out 0.20s both; }
.dolch-hero__filtro      { animation: dolch-fundido 1s ease-out 0.6s both; }
.dolch-hero__filtro-txt  { animation: dolch-aparecer 0.8s ease-out 0.7s both; }
.dolch-card-wrap         { animation: dolch-aparecer 0.9s ease-out 0.42s both; }
.dolch-sanitario,
.dolch-sanitario--mobile { animation: dolch-fundido 1s ease-out 0.75s both; }
.dolch-legal             { animation: dolch-fundido 1s ease-out 0.85s both; }

/* La foto sólo entra: una vez adentro se queda quieta. */
.dolch-hero__art {
  animation: dolch-entrada-art 1s cubic-bezier(0.22, 0.61, 0.36, 1) 0.32s both;
}

/* ============================================================
   9b. ANIMACIONES EN MOBILE
   ============================================================ */

@media (max-width: 759px) {

  /* El brillo va como pseudo-elemento del bloque mobile: ahí la foto no
     vive en el lienzo del hero desktop. */
  .dolch-hero__mobile { position: relative; }

  .dolch-hero__mobile::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 58%;
    width: 92%;
    height: 230px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(
      ellipse at center,
      rgba(255, 178, 96, 0.30) 0%,
      rgba(232, 132, 61, 0.17) 36%,
      rgba(180, 96, 40, 0) 72%
    );
    animation:
      dolch-glow-entrada 1.2s ease-out 0.3s both,
      dolch-latido 7.5s ease-in-out 1.5s infinite;
  }

  .dolch-hero__mobile-logo,
  .dolch-hero__mobile-title,
  .dolch-hero__mobile-art,
  .dolch-hero__mobile-badge { position: relative; z-index: 2; }

  .dolch-hero__mobile-logo  { animation: dolch-aparecer 0.8s ease-out 0.05s both; }
  .dolch-hero__mobile-title { animation: dolch-aparecer 0.85s ease-out 0.18s both; }
  .dolch-hero__mobile-badge { animation: dolch-aparecer 0.8s ease-out 0.5s both; }

  .dolch-hero__mobile-art {
    animation: dolch-entrada-art 1s cubic-bezier(0.22, 0.61, 0.36, 1) 0.3s both;
  }
}

/* ============================================================
   9c. MOVIMIENTO REDUCIDO

   Quien pidió menos movimiento en su sistema operativo ve la página quieta
   y completa: nada de opacidad 0 colgada por un `both` que nunca corre.
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

  .dolch-hero__dark,
  .dolch-hero__orange,
  .dolch-header__logo,
  .dolch-badge,
  .dolch-hero__title,
  .dolch-hero__art,
  .dolch-hero__filtro,
  .dolch-hero__filtro-txt,
  .dolch-hero__glow,
  .dolch-hero__mobile::before,
  .dolch-hero__mobile-logo,
  .dolch-hero__mobile-title,
  .dolch-hero__mobile-art,
  .dolch-hero__mobile-badge,
  .dolch-card-wrap,
  .dolch-sanitario,
  .dolch-sanitario--mobile,
  .dolch-legal {
    animation: none !important;
    opacity: 1;
  }

  .dolch-hero__glow,
  .dolch-hero__mobile::before { transform: translate(-50%, -50%); }

  .dolch-hero__art,
  .dolch-hero__mobile-art { transform: none; }
}
