/* ==========================================================================
   CityCell — piezas de marketing administradas desde el centro de control:
   popups, ruleta de descuentos y widget asesor.
   Hoja aparte de citycell-2026.css a propósito: esto se toca con frecuencia
   y el rediseño del hero no debe verse afectado nunca.
   ========================================================================== */

:root {
    --ccm-negro: #0B0C0E;
    --ccm-verde: #5FC42C;
    --ccm-verde-osc: #4BA320;
    --ccm-blanco: #fff;
    --ccm-texto: #14171A;
    --ccm-texto-2: #5B6570;
    --ccm-linea: #E3E7E5;
    --ccm-sombra: 0 24px 70px rgba(0, 0, 0, .3);
}

/* ---------------------------------------------------------------- POPUPS -- */
.cc-pop[hidden] { display: none !important; }

.cc-pop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cc-pop-fondo {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 10, .72);
    animation: ccPopFondo .25s ease both;
}

.cc-pop-caja {
    position: relative;
    z-index: 1;
    background: var(--ccm-blanco);
    border-radius: 18px;
    box-shadow: var(--ccm-sombra);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    animation: ccPopEntra .3s cubic-bezier(.2, .9, .3, 1) both;
}

.cc-pop-x {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(11, 12, 14, .55);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}
.cc-pop-x:hover { background: rgba(11, 12, 14, .8); }

.cc-pop-img { display: block; width: 100%; height: auto; }

.cc-pop-video { position: relative; padding-top: 56.25%; background: #000; }
.cc-pop-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.cc-pop-texto { padding: 24px 26px 26px; }
.cc-pop-texto h3 {
    margin: 0 0 10px;
    font-size: 21px;
    font-weight: 700;
    color: var(--ccm-texto);
    line-height: 1.25;
}
.cc-pop-texto p { margin: 0; color: var(--ccm-texto-2); font-size: 15px; line-height: 1.6; }

.cc-pop-btn {
    display: inline-block;
    margin-top: 18px;
    padding: 12px 24px;
    border-radius: 10px;
    background: var(--ccm-verde);
    color: #08210A !important;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none !important;
    transition: background .15s;
}
.cc-pop-btn:hover { background: var(--ccm-verde-osc); color: #fff !important; }

/* Variante discreta: esquina inferior derecha, sin bloquear el sitio */
.cc-pop.cc-pop-abajo-derecha {
    inset: auto 0 0 auto;
    padding: 18px;
    display: block;
}
.cc-pop.cc-pop-abajo-derecha .cc-pop-fondo { display: none; }
.cc-pop.cc-pop-abajo-derecha .cc-pop-caja {
    max-width: 340px;
    animation: ccPopEsquina .3s cubic-bezier(.2, .9, .3, 1) both;
}
.cc-pop.cc-pop-abajo-derecha .cc-pop-texto { padding: 18px 20px 20px; }
.cc-pop.cc-pop-abajo-derecha .cc-pop-texto h3 { font-size: 17px; }
.cc-pop.cc-pop-abajo-derecha .cc-pop-texto p { font-size: 14px; }

/* El tipo "animado" entra con más presencia */
.cc-pop.cc-pop-animado .cc-pop-caja { animation: ccPopRebote .55s cubic-bezier(.18, 1.3, .4, 1) both; }

@keyframes ccPopFondo  { from { opacity: 0 } to { opacity: 1 } }
@keyframes ccPopEntra  { from { opacity: 0; transform: translateY(18px) scale(.97) } to { opacity: 1; transform: none } }
@keyframes ccPopEsquina{ from { opacity: 0; transform: translateX(24px) } to { opacity: 1; transform: none } }
@keyframes ccPopRebote { 0% { opacity: 0; transform: scale(.7) } 60% { opacity: 1; transform: scale(1.04) } 100% { transform: scale(1) } }

@media (prefers-reduced-motion: reduce) {
    .cc-pop-caja, .cc-pop-fondo { animation: none !important; }
}

@media (max-width: 575px) {
    .cc-pop { padding: 14px; }
    .cc-pop-texto { padding: 20px; }
    .cc-pop-texto h3 { font-size: 18px; }
    .cc-pop.cc-pop-abajo-derecha { inset: auto 0 0 0; padding: 12px; }
    .cc-pop.cc-pop-abajo-derecha .cc-pop-caja { max-width: none; }
}

/* ----------------------------------------------------- RULETA -- */
.cc-rul[hidden] { display: none !important; }

.cc-rul {
    position: fixed;
    inset: 0;
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cc-rul-fondo {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 10, .78);
    animation: ccPopFondo .25s ease both;
}

.cc-rul-caja {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 34px;
    background: var(--ccm-negro);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 20px;
    box-shadow: var(--ccm-sombra);
    padding: 34px 38px;
    max-width: 820px;
    width: 100%;
    max-height: 92vh;
    overflow: auto;
    animation: ccPopEntra .3s cubic-bezier(.2, .9, .3, 1) both;
}

.cc-rul-x {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.cc-rul-x:hover { background: rgba(255, 255, 255, .2); }

/* --- La rueda --- */
.cc-rul-rueda {
    position: relative;
    flex: 0 0 300px;
    width: 300px;
    height: 300px;
}

.cc-rul-svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    border: 6px solid var(--ccm-verde);
    box-shadow: 0 0 0 5px rgba(95, 196, 44, .18);
    transition: transform 4.2s cubic-bezier(.15, .85, .2, 1);
}

.cc-rul-aguja {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-top: 24px solid var(--ccm-verde);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5));
}

.cc-rul-centro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--ccm-negro);
    border: 4px solid var(--ccm-verde);
}

/* --- El lado del formulario --- */
.cc-rul-lado { flex: 1; min-width: 0; }

.cc-rul-lado h3 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.4px;
    color: #fff;
}
.cc-rul-sub { margin: 0 0 18px; color: #B9C1C9; font-size: 15px; line-height: 1.55; }

.cc-rul-input {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font: inherit;
    font-size: 15px;
    outline: none;
}
.cc-rul-input::placeholder { color: #7C8792; }
.cc-rul-input:focus { border-color: var(--ccm-verde); background: rgba(255, 255, 255, .09); }

.cc-rul-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    border: 0;
    border-radius: 11px;
    background: var(--ccm-verde);
    color: #08210A !important;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none !important;
    transition: background .15s;
}
.cc-rul-btn:hover { background: var(--ccm-verde-osc); color: #fff !important; }
.cc-rul-btn:disabled { opacity: .55; cursor: default; }

.cc-rul-error {
    margin: 4px 0 8px;
    padding: 9px 12px;
    border-radius: 8px;
    background: rgba(217, 69, 60, .15);
    border: 1px solid rgba(217, 69, 60, .4);
    color: #FFB4AF;
    font-size: 13.5px;
}

.cc-rul-legal { margin: 14px 0 0; color: #6F7982; font-size: 11.5px; line-height: 1.5; }

/* --- El premio --- */
.cc-rul-gano { margin: 0 0 4px; color: var(--ccm-verde); font-size: 15px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.cc-rul-que  { margin: 0 0 16px; color: #fff; font-size: 24px; font-weight: 800; line-height: 1.25; }

.cc-rul-codigo {
    padding: 14px;
    border-radius: 11px;
    border: 1px dashed var(--ccm-verde);
    background: rgba(95, 196, 44, .1);
    color: #fff;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2.5px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    user-select: all;
}

.cc-rul-nota { margin: 10px 0 16px; color: #B9C1C9; font-size: 13px; line-height: 1.55; }

@media (prefers-reduced-motion: reduce) {
    .cc-rul-svg { transition: none !important; }
    .cc-rul-caja, .cc-rul-fondo { animation: none !important; }
}

@media (max-width: 767px) {
    .cc-rul-caja { flex-direction: column; gap: 22px; padding: 26px 20px; }
    .cc-rul-rueda { flex: none; width: 230px; height: 230px; }
    .cc-rul-lado { width: 100%; }
    .cc-rul-lado h3 { font-size: 21px; }
    .cc-rul-que { font-size: 20px; }
    .cc-rul-codigo { font-size: 18px; letter-spacing: 1.5px; }
}

/* ------------------------------------------------ WIDGET ASESOR -- */
.cc-wid {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9996;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cc-wid-burbuja {
    position: relative;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: var(--ccm-verde);
    color: #08210A;
    cursor: pointer;
    box-shadow: 0 8px 26px rgba(95, 196, 44, .4);
    display: grid;
    place-items: center;
    transition: transform .18s, background .18s;
}
.cc-wid-burbuja:hover { background: var(--ccm-verde-osc); color: #fff; transform: scale(1.06); }

.cc-wid-punto {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--ccm-verde);
}

.cc-wid-panel[hidden] { display: none !important; }

.cc-wid-panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: 372px;
    max-width: calc(100vw - 32px);
    max-height: min(620px, calc(100vh - 130px));
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    animation: ccWidEntra .24s cubic-bezier(.2, .9, .3, 1) both;
}

@keyframes ccWidEntra { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }

.cc-wid-cab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    background: var(--ccm-negro);
    color: #fff;
    flex: 0 0 auto;
}
.cc-wid-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ccm-verde);
    color: #08210A;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 14px;
    flex: 0 0 auto;
}
.cc-wid-quien { flex: 1; min-width: 0; line-height: 1.35; }
.cc-wid-quien b { display: block; font-size: 15px; }
.cc-wid-quien span { font-size: 12.5px; color: var(--ccm-verde); }
.cc-wid-x {
    width: 30px; height: 30px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .1); color: #fff;
    font-size: 21px; line-height: 1; cursor: pointer;
}
.cc-wid-x:hover { background: rgba(255, 255, 255, .2); }

.cc-wid-charla {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    background: #F4F6F5;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cc-wid-msg {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.55;
    white-space: pre-line;
}
.cc-wid-asesor { background: #fff; color: var(--ccm-texto); border-bottom-left-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.cc-wid-yo {
    align-self: flex-end;
    background: var(--ccm-negro);
    color: #fff;
    border-bottom-right-radius: 5px;
}

.cc-wid-opciones { display: flex; flex-wrap: wrap; gap: 7px; }
.cc-wid-op {
    padding: 9px 14px;
    border: 1px solid var(--ccm-verde);
    border-radius: 99px;
    background: #fff;
    color: var(--ccm-verde-osc);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .14s, color .14s;
}
.cc-wid-op:hover { background: var(--ccm-verde); color: #08210A; }

/* Fichas de producto dentro de la charla */
.cc-wid-prods { display: flex; flex-direction: column; gap: 8px; }
.cc-wid-prod {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px;
    background: #fff;
    border-radius: 12px;
    text-decoration: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
    transition: transform .14s, box-shadow .14s;
}
.cc-wid-prod:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0, 0, 0, .12); }
.cc-wid-prod img {
    width: 54px; height: 54px; flex: 0 0 auto;
    object-fit: contain; background: #F4F6F5; border-radius: 8px;
}
.cc-wid-prod-info { flex: 1; min-width: 0; }
.cc-wid-prod-nom {
    font-size: 13px; font-weight: 600; color: var(--ccm-texto);
    line-height: 1.35; margin-bottom: 3px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cc-wid-prod-precio { font-size: 14px; font-weight: 800; color: var(--ccm-texto); }
.cc-wid-prod-sem { font-size: 12px; color: var(--ccm-verde-osc); font-weight: 600; }

.cc-wid-ir {
    display: block;
    padding: 12px;
    border-radius: 11px;
    background: var(--ccm-verde);
    color: #08210A !important;
    font-weight: 700;
    font-size: 14.5px;
    text-align: center;
    text-decoration: none !important;
}
.cc-wid-ir:hover { background: var(--ccm-verde-osc); color: #fff !important; }

.cc-wid-buscar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid var(--ccm-linea);
    flex: 0 0 auto;
}
.cc-wid-input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--ccm-linea);
    border-radius: 99px;
    font: inherit;
    font-size: 14px;
    outline: none;
    color: var(--ccm-texto);
}
.cc-wid-input:focus { border-color: var(--ccm-verde); }
.cc-wid-enviar {
    width: 42px; height: 42px; flex: 0 0 auto;
    border: 0; border-radius: 50%;
    background: var(--ccm-verde); color: #08210A;
    cursor: pointer; display: grid; place-items: center;
}
.cc-wid-enviar:hover { background: var(--ccm-verde-osc); color: #fff; }

.cc-wid-reiniciar[hidden] { display: none !important; }
.cc-wid-reiniciar {
    border: 0; border-top: 1px solid var(--ccm-linea);
    background: #fff; color: var(--ccm-texto-2);
    font: inherit; font-size: 12.5px; padding: 9px; cursor: pointer;
    flex: 0 0 auto;
}
.cc-wid-reiniciar:hover { color: var(--ccm-texto); background: #FAFCFA; }

/* Los tres puntitos mientras responde */
.cc-wid-escribe { display: flex; gap: 4px; padding: 13px 15px; width: 56px; }
.cc-wid-escribe i {
    width: 7px; height: 7px; border-radius: 50%; background: #B9C1C9;
    animation: ccWidPunto 1.2s infinite ease-in-out;
}
.cc-wid-escribe i:nth-child(2) { animation-delay: .15s; }
.cc-wid-escribe i:nth-child(3) { animation-delay: .3s; }
@keyframes ccWidPunto { 0%, 60%, 100% { opacity: .3; transform: translateY(0) } 30% { opacity: 1; transform: translateY(-4px) } }

@media (prefers-reduced-motion: reduce) {
    .cc-wid-panel, .cc-wid-escribe i { animation: none !important; }
}

@media (max-width: 575px) {
    .cc-wid { right: 14px; bottom: 14px; }
    .cc-wid-burbuja { width: 54px; height: 54px; }
    .cc-wid-panel { width: calc(100vw - 28px); bottom: 68px; max-height: calc(100vh - 110px); }
}
