/*
 * ORDEN 0388 — los tres widgets de captación: pop-up, gira y gana y raspa y gana.
 * -----------------------------------------------------------------------------
 * Todo va con el prefijo `.hcy-` para no tocar nada de la tienda. No cambia el
 * carrito, ni el checkout, ni el botón de pagar: son capas propias.
 *
 * Sin JavaScript, el pop-up no se abre (la ventana se muestra sólo cuando el
 * script le pone la clase `hcy-abierto`) y los paneles de la ruleta y de la
 * tarjeta quedan cerrados: la tienda sigue funcionando igual que hoy.
 */

/* ---------------------------------------------------------------- comunes */
.hcy-captacion {
    --hcy-captacion-color: #111827;
    font-family: inherit;
}

.hcy-captacion-abrir {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--hcy-captacion-color);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.hcy-captacion-abrir:hover {
    filter: brightness(1.15);
}

/* Los dos botones flotantes (ruleta y tarjeta) viven en la misma esquina: se
   apilan para que uno no tape al otro. */
.hcy-gira .hcy-captacion-abrir {
    bottom: 18px;
}

.hcy-raspa .hcy-captacion-abrir {
    bottom: 74px;
}

.hcy-captacion-abrir-icono {
    font-size: 18px;
    line-height: 1;
}

.hcy-captacion-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 9995;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 24px 22px 18px;
    border-radius: 16px;
    background: #fff;
    color: #111827;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.hcy-captacion-panel[hidden] {
    display: none;
}

.hcy-captacion-titulo {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.hcy-captacion-texto {
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 1.45;
}

.hcy-captacion-texto p {
    margin: 0 0 8px;
}

/* ---------------------------------------------------------------- el pop-up */
.hcy-popup {
    position: fixed;
    inset: 0;
    z-index: 9995;
    display: none;
    align-items: center;
    justify-content: center;
}

.hcy-popup.hcy-abierto {
    display: flex;
}

.hcy-popup-fondo {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
}

.hcy-popup-caja {
    position: relative;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 26px 22px 18px;
    border-radius: 16px;
    background: #fff;
    color: #111827;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.hcy-popup-titulo {
    margin: 0 0 8px;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
}

.hcy-popup-texto {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.45;
}

.hcy-popup-texto p {
    margin: 0 0 8px;
}

.hcy-popup-reloj {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: #b91c1c;
}

.hcy-popup-cerrar {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.hcy-popup-cerrar:hover {
    background: #f3f4f6;
    color: #111827;
}

/* ---------------------------------------------------------------- el formulario */
.hcy-captacion-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 6px;
}

.hcy-captacion-campo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hcy-captacion-etiqueta {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.hcy-captacion-correo {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    color: #111827;
    background: #fff;
}

.hcy-captacion-correo:focus {
    outline: 2px solid var(--hcy-captacion-color);
    outline-offset: 1px;
}

.hcy-captacion-aviso {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12.5px;
    line-height: 1.35;
    color: #4b5563;
    cursor: pointer;
}

.hcy-captacion-aviso input {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.hcy-captacion-boton {
    padding: 12px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--hcy-captacion-color);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.hcy-captacion-boton:hover {
    filter: brightness(1.15);
}

.hcy-captacion-boton[disabled] {
    opacity: 0.6;
    cursor: default;
}

.hcy-captacion-error {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #b91c1c;
}

.hcy-captacion-error[hidden] {
    display: none;
}

.hcy-captacion-nunca {
    display: block;
    margin: 10px auto 0;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------------------------------------------------------------- el resultado */
.hcy-captacion-resultado {
    margin-top: 12px;
    padding: 14px;
    border: 1px dashed #16a34a;
    border-radius: 12px;
    background: #f0fdf4;
    text-align: center;
}

.hcy-captacion-resultado[hidden] {
    display: none;
}

.hcy-captacion-gracias {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: #15803d;
}

.hcy-captacion-premio {
    margin: 0 0 8px;
    font-size: 14px;
    color: #111827;
}

.hcy-captacion-codigo-caja {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
}

.hcy-captacion-codigo {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.hcy-captacion-copiar {
    border: 0;
    border-radius: 8px;
    padding: 4px 8px;
    background: #374151;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

/* ---------------------------------------------------------------- la ruleta */
.hcy-gira-rueda-caja {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 6px auto 12px;
}

.hcy-gira-rueda {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 6px solid #111827;
    box-shadow: inset 0 0 0 4px #fff, 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 3.2s cubic-bezier(0.2, 0.9, 0.15, 1);
}

.hcy-gira-aguja {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 20px solid #111827;
    z-index: 2;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.hcy-gira-leyenda {
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 4px 10px;
    font-size: 13px;
    color: #374151;
}

.hcy-gira-leyenda li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hcy-gira-punto {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 auto;
}

/* ---------------------------------------------------------------- la tarjeta raspadita */
.hcy-raspa-tarjeta {
    position: relative;
    margin: 4px auto 14px;
    width: 100%;
    min-height: 140px;
    border-radius: 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    overflow: hidden;
    text-align: center;
    padding: 16px 12px;
}

.hcy-raspa-pista {
    margin: 0 0 10px;
    font-size: 13px;
    color: #047857;
    font-weight: 600;
}

.hcy-raspa-codigo-caja {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
}

.hcy-raspa-codigo {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.hcy-raspa-capa {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.hcy-raspa-capa[hidden] {
    display: none;
}

.hcy-raspa-descubrir {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    border: 0;
    border-radius: 8px;
    padding: 6px 10px;
    background: #111827;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.hcy-raspa-descubrir[hidden] {
    display: none;
}

.hcy-raspa-datos[hidden] {
    display: none;
}

/* ---------------------------------------------------------------- celular */
@media (max-width: 480px) {
    .hcy-popup-caja,
    .hcy-captacion-panel {
        padding: 22px 16px 16px;
    }

    .hcy-captacion-abrir {
        left: 12px;
        bottom: 12px;
        padding: 10px 14px;
        font-size: 14px;
    }

    .hcy-gira-rueda-caja {
        width: 180px;
        height: 180px;
    }
}
