/* Vista móvil */

.carrusel {
    width: 100%;
    height: 50vh;
    color: white;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-color: #333;
    animation: carruselFondo 20s infinite ease-in-out;
}

.mas-vendidos {
    padding: 40px 20px;
    text-align: center;
    margin-top: 60px;
}

.mas-vendidos h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.contenedor-tarjetas {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.tarjeta {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.tarjeta img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    padding: 15px;
    background-color: #fff;
}

.info {
    padding: 20px;
}

.categoria {
    font-size: 0.8rem;
    color: #777;
    text-transform: uppercase;
}

.info h3 {
    font-size: 1.2rem;
    margin: 10px 0;
    height: 50px;
}

.precio {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.btn {
    padding: 14px 50px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background-color: #FFD447;
    color: #212529;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, color 0.3s ease;
}

.btn.btn-añadido {
    background-color: #27ae60;
    color: #fff;
    transform: scale(1.02);
    cursor: default;
}

.btn.btn-sin-stock {
    background-color: #999;
    color: #fff;
    cursor: default;
}

@keyframes carruselFondo {
    0% {
        background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("../img/carrusel_1.jpg");
    }

    25% {
        background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("../img/carrusel_2.jpg");
    }

    50% {
        background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("../img/carrusel_3.jpg");
    }

    75% {
        background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("../img/carrusel_4.jpg");
    }

    100% {
        background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("../img/carrusel_5.jpg");
    }
}

.bienvenida {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90%;
    margin: 0 auto;
    gap: 20px;
}

.bienvenida h1 {
    font-size: 1.8rem;
    line-height: 1.3;
}

.contador-visitas {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
    animation: fadeInContador 1s ease forwards;
}

.contador-visitas i {
    font-size: 0.9rem;
    color: #FFD447;
}

@keyframes fadeInContador {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bienvenida > a {
    text-decoration: none;
    color: white;
    width: 100%;
    display: flex;
    justify-content: center;
}

.grid-tipos {
    display: grid;
    grid-template-columns: 1;
    gap: 0;
    margin-top: 60px;
}

.grid-tipos h2 {
    text-align: center;
    padding: 10px;
    font-size: 2.5rem;
}

.tarjeta-tipos {
    position: relative;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 30vh;
    color: white;
    overflow: hidden;
}

.tarjeta-tipos::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    transition: opacity 0.3s ease;
    z-index: 1;
    opacity: 1;
}

.tarjeta-tipos span {
    font-weight: bold;
    font-size: 20px;
}

.tarjeta-tipos span,
.tarjeta-tipos a {
    position: relative;
    z-index: 2;
}

.tarjeta-tipos .btn {
    padding: 12px 40px;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.tarjeta-tipos .btn:hover {
    background-color: white;
    color: #212529;
    transform: scale(1.05);
}

.tarjeta-tipos:nth-of-type(1) {
    background-image: url(../img/funko_tipos.png);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.tarjeta-tipos:nth-of-type(2) {
    background-image: url(../img/manga_tipo.png);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.ferias {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 30vh;
    color: white;
    overflow: hidden;
    gap: 15px;
    padding: 20px;
    margin-top: 0;
    background-image: url(../img/seccion_ferias.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ferias::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 1;
}

.ferias h3 {
    position: relative;
    z-index: 2;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ferias a {
    position: relative;
    z-index: 2;
    text-decoration: none;
}

.ferias .btn-comprar {
    padding: 14px 50px;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, color 0.3s ease;
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.ferias .btn-comprar:hover {
    background-color: white;
    color: #212529;
}

/* Vista tablet */
@media screen and (min-width: 768px) {

    .carrusel {
        height: 60vh;
    }

    .bienvenida {
        width: 70%;
    }

    .bienvenida h1 {
        font-size: 2.2rem;
    }

    .contenedor-tarjetas {
        grid-template-columns: repeat(2, 1fr);
    }

    .ferias {
        height: 35vh;
    }

    .ferias h3 {
        font-size: 1.5rem;
    }
}

/* Vista escritorio */
@media screen and (min-width: 1024px) {

    .carrusel {
        height: 70vh;
        background-position: center;
        align-items: center;
        text-align: center;
    }

    .bienvenida {
        width: 60%;
        margin: 0 auto;
        align-items: center;
        gap: 30px;
    }

    .bienvenida h1 {
        font-size: 3rem;
    }

    .mas-vendidos {
        max-width: 1200px;
        margin: 0 auto;
    }

    .contenedor-tarjetas {
        grid-template-columns: repeat(4, 1fr);
    }

    .tarjeta:hover {
        transform: translateY(-10px);
    }

    .btn:hover {
        background-color: #E6B93C;
        transform: scale(1.05);
    }

    .tarjeta-tipos {
        background-position: center;
        height: 30vh;
    }

    .tarjeta-tipos::before {
        opacity: 0;
    }

    .tarjeta-tipos span {
        font-size: 25px;
        font-weight: bold;
    }

    .tarjeta-tipos span,
    .tarjeta-tipos a {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .tarjeta-tipos:hover::before {
        opacity: 1;
    }

    .tarjeta-tipos:hover span,
    .tarjeta-tipos:hover a {
        opacity: 1;
    }

    .grid-tipos {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-tipos h2 {
        grid-column: span 2;
    }

    .ferias {
        height: 40vh;
    }

    .ferias h3 {
        font-size: 1.8rem;
    }
}