/* Estilos generales del contenedor */
.flip-countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    color: white;
}

.time-segment {
    text-align: center;
    /* Reducimos el margen para que esté más junto en móviles */
    margin: 0 5px;
}

.time-label {
    display: block;
    margin-top: 10px;
    /* Usamos un tamaño de fuente más adaptable */
    font-size: 14px;
    color: #333;
    text-transform: uppercase;
    font-weight: 700;
}

/* Estilo de la tarjeta que hace el "flip" */
.flip-card {
    display: inline-block;
    position: relative;
    /* Tamaños más grandes para escritorio */
    width: 100px;
    height: 90px;
    font-size: 60px;
    line-height: 90px;
    font-weight: bold;
    perspective: 500px;
}

/* Partes superior e inferior de la tarjeta */
.flip-card .top, .flip-card .bottom {
    display: block;
    position: absolute;
    width: 100%;
    height: 50%;
    overflow: hidden;
    background-color: #020340;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.flip-card .top {
    top: 0;
    line-height: 90px; /* Alinea el número */
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.flip-card .bottom {
    bottom: 0;
    line-height: 0; /* Alinea el número */
}

/* Pseudo-elementos para la animación */
.flip-card .top::before, .flip-card .bottom::before {
    content: attr(data-value);
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
}

.flip-card .top::before {
    top: 0;
}

.flip-card .bottom::before {
    /* Mueve el texto hacia arriba, debe ser igual a la altura de la tarjeta */
    bottom: -90px;
}

/* Animación */
.flip-card .top.flipping {
    animation: flip-top 0.2s ease-in-out forwards;
    transform-origin: bottom;
}

.flip-card .bottom.flipping {
    animation: flip-bottom 0.2s ease-in-out forwards;
    transform-origin: top;
}

@keyframes flip-top {
    100% {
        transform: rotateX(90deg);
    }
}

@keyframes flip-bottom {
    100% {
        transform: rotateX(0deg);
    }
}


/* ------------------------------------------- */
/* --- ESTILOS RESPONSIVOS PARA TELÉFONOS --- */
/* ------------------------------------------- */
@media (max-width: 480px) {

    .time-segment {
        margin: 0 3px; /* Aún menos margen en pantallas muy pequeñas */
    }

    /* Reducimos el tamaño de la tarjeta y la fuente */
    .flip-card {
        width: 70px;    /* Ancho reducido */
        height: 60px;   /* Alto reducido */
        font-size: 40px; /* Tamaño de fuente más pequeño */
        line-height: 60px;
    }

    .flip-card .top {
        line-height: 60px; /* Ajustamos la alineación vertical del número */
    }

    /* Ajustamos la posición del pseudo-elemento para que coincida con la nueva altura */
    .flip-card .bottom::before {
        bottom: -60px;
    }

    .time-label {
        font-size: 12px; /* Etiqueta más pequeña */
        margin-top: 5px;
    }
}