/* ============================================================
   Cuenta Atrás Profesores — Kubala
   Paleta: ámbar · terracota · crema · marrón tostado
   Estética: sala de profesores acogedora, cuaderno vintage
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,700;0,9..144,900;1,9..144,400&family=DM+Sans:wght@400;600;800&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
    --pca-amber:      #e8900a;
    --pca-amber-d:    #c07008;
    --pca-amber-l:    #fbd38d;
    --pca-terra:      #c0533a;
    --pca-terra-d:    #8b3520;
    --pca-cream:      #fdf6ec;
    --pca-cream-d:    #f5e8d0;
    --pca-brown:      #4a2c0a;
    --pca-brown-soft: #7a4f25;
    --pca-white:      #ffffff;
    --pca-card-bg:    rgba(253, 246, 236, 0.92);
    --pca-radius:     20px;
    --pca-shadow:     0 24px 64px rgba(74,44,10,.18), 0 4px 16px rgba(192,83,58,.12);
}

/* ── Reset base ────────────────────────────────────────────── */
.pca-wrapper *, .pca-wrapper *::before, .pca-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Wrapper ────────────────────────────────────────────────── */
.pca-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 480px;
    padding: 48px 16px;
    overflow: hidden;
    font-family: 'DM Sans', sans-serif;

    background:
        radial-gradient(ellipse at 10% 0%,   #fde0a0 0%, transparent 50%),
        radial-gradient(ellipse at 90% 100%,  #f5b97a 0%, transparent 50%),
        radial-gradient(ellipse at 60%  20%,  #fceabb 0%, transparent 40%),
        linear-gradient(160deg, #fdf0d5 0%, #fbe0b0 50%, #f5c98a 100%);
}

/* ── Líneas de cuaderno decorativas en el fondo ──────────── */
.pca-notebook-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(
            transparent,
            transparent 31px,
            rgba(192,83,58,.08) 31px,
            rgba(192,83,58,.08) 32px
        );
    background-size: 100% 32px;
}

/* Margen izquierdo de cuaderno */
.pca-notebook-lines::before {
    content: '';
    position: absolute;
    left: clamp(28px, 6%, 56px);
    top: 0; bottom: 0;
    width: 2px;
    background: rgba(192,83,58,.15);
}

/* ── Partículas flotantes ──────────────────────────────────── */
.pca-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.pca-p {
    position: absolute;
    opacity: 0;
    animation: pca-float ease-in-out infinite;
    font-size: 20px;
    will-change: transform, opacity;
}

.pca-p--1  { left:  3%; top: 15%; font-size:22px; animation-duration:6s;  animation-delay:0s;   }
.pca-p--2  { left: 12%; top: 70%; font-size:26px; animation-duration:7s;  animation-delay:1.3s; }
.pca-p--3  { left: 22%; top: 30%; font-size:18px; animation-duration:8s;  animation-delay:2.7s; }
.pca-p--4  { left: 33%; top: 80%; font-size:24px; animation-duration:6s;  animation-delay:0.8s; }
.pca-p--5  { left: 45%; top: 10%; font-size:20px; animation-duration:9s;  animation-delay:3.5s; }
.pca-p--6  { left: 55%; top: 60%; font-size:28px; animation-duration:7s;  animation-delay:1.9s; }
.pca-p--7  { left: 64%; top: 20%; font-size:22px; animation-duration:8s;  animation-delay:4.2s; }
.pca-p--8  { left: 74%; top: 75%; font-size:18px; animation-duration:6s;  animation-delay:0.4s; }
.pca-p--9  { left: 82%; top: 40%; font-size:24px; animation-duration:9s;  animation-delay:2.1s; }
.pca-p--10 { left: 90%; top: 85%; font-size:20px; animation-duration:7s;  animation-delay:5.0s; }
.pca-p--11 { left: 96%; top: 10%; font-size:26px; animation-duration:8s;  animation-delay:3.2s; }
.pca-p--12 { left: 48%; top: 90%; font-size:18px; animation-duration:6s;  animation-delay:6.1s; }

@keyframes pca-float {
    0%   { transform: translateY(0)    rotate(-5deg)  scale(1);   opacity: 0; }
    15%  { opacity: .7; }
    50%  { transform: translateY(-28px) rotate(8deg)  scale(1.1); opacity: .65; }
    85%  { opacity: .6; }
    100% { transform: translateY(0)    rotate(-5deg)  scale(1);   opacity: 0; }
}

/* ── Card ──────────────────────────────────────────────────── */
.pca-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 680px;
    background: var(--pca-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--pca-radius);
    border: 1.5px solid rgba(232,144,10,.25);
    box-shadow: var(--pca-shadow);
    padding: 0 0 36px;
    overflow: hidden;
    animation: pca-card-in .9s cubic-bezier(.22,1,.36,1) both;
}

@keyframes pca-card-in {
    from { opacity: 0; transform: translateY(36px) scale(.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Cinta de descuento ────────────────────────────────────── */
.pca-ribbon {
    position: absolute;
    top: 22px;
    right: -32px;
    width: 140px;
    padding: 8px 0;
    background: linear-gradient(135deg, var(--pca-terra) 0%, var(--pca-terra-d) 100%);
    transform: rotate(35deg);
    text-align: center;
    box-shadow: 0 4px 14px rgba(139,53,32,.40);
    z-index: 10;
}

.pca-ribbon-text {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* ── Cabecera con franja de color ──────────────────────────── */
.pca-header {
    background: linear-gradient(135deg, var(--pca-amber) 0%, var(--pca-terra) 100%);
    padding: 40px 32px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Textura de puntos sobre el header */
.pca-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 18px 18px;
}

.pca-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.30);
    border-radius: 30px;
    padding: 5px 16px;
    margin-bottom: 16px;
    backdrop-filter: blur(6px);
}

.pca-badge-icon { font-size: 15px; line-height: 1; }

.pca-badge-label {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,.95);
}

.pca-title {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 14px;
}

.pca-title-line1 {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(16px, 3.5vw, 21px);
    font-weight: 400;
    color: rgba(255,255,255,.85);
    letter-spacing: .5px;
    line-height: 1.3;
}

.pca-title-line2 {
    font-family: 'Fraunces', serif;
    font-size: clamp(40px, 9vw, 68px);
    font-weight: 900;
    color: var(--pca-white);
    line-height: 1;
    letter-spacing: -1.5px;
    text-shadow: 0 4px 16px rgba(74,44,10,.30);
}

.pca-subtitle {
    font-size: clamp(13px, 2.5vw, 15px);
    color: rgba(255,255,255,.80);
    line-height: 1.6;
    font-style: italic;
    max-width: 420px;
    margin: 0 auto;
}

/* Ola inferior del header */
.pca-header::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 28px;
    background: var(--pca-card-bg);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

/* ── Bloque oferta ─────────────────────────────────────────── */
.pca-offer-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 28px 24px 22px;
    padding: 18px 24px;
    background: linear-gradient(135deg, #fff8ee 0%, #fef3e2 100%);
    border: 2px dashed rgba(232,144,10,.40);
    border-radius: 14px;
}

.pca-offer-pct {
    display: flex;
    align-items: flex-start;
    line-height: 1;
    color: var(--pca-terra);
    text-shadow: 0 2px 8px rgba(192,83,58,.20);
}

.pca-offer-num {
    font-family: 'Fraunces', serif;
    font-size: clamp(52px, 12vw, 80px);
    font-weight: 900;
    line-height: .9;
}

.pca-offer-sym {
    font-family: 'Fraunces', serif;
    font-size: clamp(28px, 6vw, 40px);
    font-weight: 700;
    margin-top: 8px;
}

.pca-offer-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.pca-offer-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(18px, 4vw, 26px);
    font-weight: 700;
    color: var(--pca-brown);
    line-height: 1.1;
}

.pca-offer-desc {
    font-size: clamp(12px, 2.2vw, 14px);
    color: var(--pca-brown-soft);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── Cuenta Atrás ──────────────────────────────────────────── */
.pca-countdown-wrap {
    padding: 0 24px;
    margin-bottom: 16px;
}

.pca-countdown-label {
    text-align: center;
    font-size: clamp(13px, 2.4vw, 15px);
    color: var(--pca-brown-soft);
    margin-bottom: 16px;
    line-height: 1.5;
}

.pca-countdown-label strong {
    color: var(--pca-terra);
}

.pca-countdown {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: clamp(6px, 2vw, 14px);
    flex-wrap: nowrap;
}

.pca-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    max-width: 110px;
}

.pca-digit-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 100px;
    background: linear-gradient(180deg, var(--pca-brown) 0%, #2e1803 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow:
        0 8px 24px rgba(74,44,10,.35),
        0 1px 0 rgba(255,255,255,.08) inset;
    overflow: hidden;
}

/* Brillo superior de la caja */
.pca-digit-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255,255,255,.07) 0%, transparent 100%);
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

/* Línea central flip */
.pca-digit-box::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 1px;
    background: rgba(0,0,0,.25);
}

.pca-digit {
    font-family: 'Fraunces', serif;
    font-size: clamp(26px, 6.5vw, 48px);
    font-weight: 900;
    color: var(--pca-amber-l);
    letter-spacing: -1px;
    line-height: 1;
    transition: transform .12s ease, opacity .12s ease;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,.40);
}

.pca-digit.pca-flip {
    animation: pca-digit-flip .25s cubic-bezier(.4,0,.2,1);
}

@keyframes pca-digit-flip {
    0%   { transform: scaleY(.5) translateY(-4px); opacity: .3; }
    60%  { transform: scaleY(1.04); opacity: 1; }
    100% { transform: scaleY(1)    translateY(0);  opacity: 1; }
}

.pca-unit-label {
    font-size: clamp(9px, 1.8vw, 12px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--pca-brown-soft);
}

.pca-colon {
    font-family: 'Fraunces', serif;
    font-size: clamp(24px, 5.5vw, 44px);
    font-weight: 900;
    color: var(--pca-amber);
    line-height: 1;
    padding-top: clamp(10px, 2vw, 18px);
    align-self: flex-start;
    animation: pca-blink 1s step-end infinite;
    opacity: .9;
    flex-shrink: 0;
}

@keyframes pca-blink {
    0%, 100% { opacity: .9; }
    50%       { opacity: .2; }
}

/* ── Urgencia ──────────────────────────────────────────────── */
.pca-urgency {
    margin: 12px 24px 20px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #fff3e0, #ffe8cc);
    border-left: 4px solid var(--pca-terra);
    border-radius: 0 10px 10px 0;
    font-size: clamp(12px, 2.2vw, 14px);
    color: var(--pca-brown);
    line-height: 1.55;
}

.pca-urgency strong {
    color: var(--pca-terra-d);
}

/* ── Estado expirado ───────────────────────────────────────── */
.pca-expired {
    text-align: center;
    padding: 20px 24px;
    animation: pca-card-in .5s ease both;
}

.pca-expired-icon {
    font-size: 42px;
    display: block;
    margin-bottom: 10px;
}

.pca-expired-text {
    font-family: 'Fraunces', serif;
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 700;
    color: var(--pca-brown);
    line-height: 1.5;
}

/* ── CTA Botón ─────────────────────────────────────────────── */
.pca-cta-wrap {
    padding: 0 24px;
    text-align: center;
}

/* Halo animado exterior */
.pca-cta-wrap {
    position: relative;
}

.pca-cta-btn {
    display: inline-block;
    width: 100%;
    max-width: 460px;
    text-decoration: none !important;
    position: relative;
    border-radius: 14px;
    padding: 3px; /* grosor del borde degradado */
    background: linear-gradient(135deg, var(--pca-amber), var(--pca-terra), var(--pca-amber-d), var(--pca-terra));
    background-size: 300% 300%;
    animation: pca-btn-halo 3s linear infinite,
               pca-btn-bounce 3s cubic-bezier(.28,.84,.42,1) 1.5s infinite;
    box-shadow:
        0 10px 36px rgba(192,83,58,.50),
        0 4px  12px rgba(232,144,10,.30);
}

@keyframes pca-btn-halo {
    0%   { background-position:   0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position:   0% 50%; }
}

@keyframes pca-btn-bounce {
    0%, 100% { transform: translateY(0); }
    45%       { transform: translateY(-6px); }
    65%       { transform: translateY(-2px); }
}

.pca-cta-btn:hover {
    animation: pca-btn-halo 3s linear infinite;
    transform: translateY(-5px) scale(1.02);
    box-shadow:
        0 18px 48px rgba(192,83,58,.65),
        0 6px  16px rgba(232,144,10,.40);
}

.pca-cta-btn:active {
    transform: translateY(0) scale(.98);
}

.pca-cta-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px 28px;
    background: linear-gradient(135deg, #d4600a 0%, #b84030 100%);
    border-radius: 11px;
    position: relative;
    overflow: hidden;
}

/* Barrido de brillo */
.pca-cta-inner::after {
    content: '';
    position: absolute;
    top: -10%; left: -70%;
    width: 45%;
    height: 120%;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.38) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: pca-shine 2.8s ease-in-out 2s infinite;
}

@keyframes pca-shine {
    0%   { left: -70%; opacity: 0; }
    15%  { opacity: 1; }
    50%  { left: 130%; opacity: 0; }
    100% { left: 130%; opacity: 0; }
}

.pca-cta-emoji {
    font-size: 22px;
    line-height: 1;
    animation: pca-emoji-bob 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pca-emoji-bob {
    0%, 100% { transform: rotate(-8deg) scale(1); }
    50%       { transform: rotate(8deg)  scale(1.15); }
}

.pca-cta-text {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(15px, 3vw, 18px);
    font-weight: 800;
    color: #fff;
    letter-spacing: .3px;
    text-shadow: 0 1px 4px rgba(0,0,0,.25);
    line-height: 1.2;
}

.pca-cta-arrow {
    font-size: 20px;
    color: rgba(255,255,255,.85);
    transition: transform .2s ease;
    flex-shrink: 0;
}

.pca-cta-btn:hover .pca-cta-arrow {
    transform: translateX(5px);
}

.pca-cta-note {
    margin-top: 10px;
    font-size: clamp(11px, 1.8vw, 13px);
    color: var(--pca-brown-soft);
    line-height: 1.4;
}

/* ── Responsive ────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 640px) {
    .pca-wrapper {
        padding: 32px 12px;
        min-height: 420px;
    }
    .pca-header {
        padding: 36px 20px 28px;
    }
    .pca-offer-strip {
        margin: 22px 16px 18px;
        padding: 14px 16px;
        gap: 12px;
    }
    .pca-countdown-wrap {
        padding: 0 16px;
    }
    .pca-urgency {
        margin: 10px 16px 16px;
    }
    .pca-cta-wrap {
        padding: 0 16px;
    }
}

/* Móvil */
@media (max-width: 420px) {
    .pca-wrapper {
        padding: 24px 8px;
    }
    .pca-ribbon {
        right: -36px;
        top: 18px;
    }
    .pca-offer-strip {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        margin: 18px 12px 14px;
    }
    .pca-offer-info {
        text-align: center;
        align-items: center;
    }
    .pca-colon {
        display: none; /* En móvil muy pequeño se ocultan los dos puntos para evitar overflow */
    }
    .pca-countdown {
        gap: 4px;
    }
    .pca-digit-box {
        border-radius: 8px;
    }
    .pca-urgency {
        margin: 10px 12px 14px;
        padding: 10px 14px;
    }
    .pca-cta-wrap {
        padding: 0 12px;
    }
    .pca-cta-inner {
        padding: 15px 16px;
        gap: 8px;
    }
}

/* Pantalla grande */
@media (min-width: 900px) {
    .pca-card {
        border-radius: 24px;
    }
}
