@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

html,
body {
    width: 100%;
    position: relative;
    /* Removed overflow-x: hidden to allow sticky elements to work properly */
}

body {
    background-color: #f5f5f5;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #511281;
    color: whitesmoke;
    padding: 0px 2%;
    height: 12vh;
}

.header-left {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.buscador {
    position: relative;
    display: flex;
    align-items: center;
    width: 350px;
    /* Ancho controlado para que sea responsive */
    max-width: 100%;
}

.buscador .fa-magnifying-glass {
    position: absolute;
    left: 15px;
    color: whitesmoke;
}

#campo-busqueda {
    width: 100%;
    height: 4.5vh;
    border-radius: 42px;
    background-color: transparent;
    border: 2px solid white;
    padding-left: 40px;
    color: white;
    transition: all 0.3s ease;
}

#campo-busqueda::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#campo-busqueda:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

header .img {
    flex: 0 0 auto;
    text-align: center;
}

header .img img {
    width: 6vw;
}

.inicio-sesion {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.inicio-sesion a {
    color: white;
    margin: 0 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
}

.inicio-sesion a:hover {
    text-decoration: underline;
}

.navegacion {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background-color: #2E0249;
}

.navegacion a {
    color: white;
    margin: 0 20px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: lighter;
}

main {
    padding: 4%;
}

.superior {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2%;
    margin-bottom: 40px;
}

.info-artista {
    display: flex;
    flex-direction: column;
    align-items: left;
    text-align: left;
    padding-top: 14%;
}

.info-artista h3 {
    font-size: 2em;
    margin-bottom: 15px;
    width: 92%;
    color: #511281;
    /* Purple accent color */
}

.info-artista .nombre-artista {
    font-weight: bold;
    margin-bottom: 20px;
}

.nombre-artista {
    font-weight: normal;
    color: #555;
}

.info-contexto {
    display: flex;
    align-items: center;
    padding-top: 10px;
    width: 92%;
}

p.info-contexto {
    font-size: 1.2em;
}

.novedades {
    position: relative;
    overflow: hidden;
    padding-bottom: 30px;
}

.novedades .titulo-novedades {
    font-size: 1.8em;
    margin-bottom: 15px;
    text-align: center;
}

.contenedor-carrusel {
    width: 90%;
    max-width: 800px;
    height: 300px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    overflow: hidden;
}

.carrusel {
    position: relative;
    width: 100%;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.elemento-carrusel {
    position: absolute;
    width: 14vw;
    height: auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.elemento-carrusel img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;

}

.elemento-carrusel.left {
    transform: translateX(-20vw) scale(0.8);
    opacity: 0.5;
    z-index: 1;
}

.elemento-carrusel.center {
    transform: translateX(0) scale(1.4);
    opacity: 1;
    z-index: 2;
}


.elemento-carrusel.right {
    transform: translateX(20vw) scale(0.8);
    opacity: 0.8;
    z-index: 1;
}


.mid .encabezado-popular {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mid .popular {
    font-size: 1.8em;
}

.filtro {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mid .filtro select {
    padding: 8px 12px;
    border: 3px solid #996dba;
}

.cuadricula-canciones {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cuadricula-canciones .elementos {
    display: grid;
    grid-template-columns: auto auto 1fr 1fr auto;
    align-items: center;
    padding: 10px;
    border: 2px solid #d2bfe0;
    border-radius: 5px;
}

.cuadricula-canciones .elementos .numero-cancion {
    font-size: 1.5em;
    font-weight: bold;
    margin-right: 15px;
}

.cuadricula-canciones .elementos img {
    width: 50px;
    height: 50px;
    margin-right: 15px;
}

.cuadricula-canciones .elementos .titulo-cancion {
    font-weight: bold;
}

.cuadricula-canciones .elementos .artista {
    color: #555;
}

.cuadricula-canciones .elementos .visualizaciones {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-self: end;
}

footer {
    background-color: #1a1a1a;
    color: white;
    padding: 40px;
}

.cuadricula-pie {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.p1 .imagen-pie img {
    height: 14vh;
    width: auto;
    margin-bottom: 15px;
}

.pie {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    align-items: center;
}

.p1,
.p2,
.p3,
.p4 {
    display: flex;
    justify-content: center;
}

.pie .p4 {
    text-align: left;
    flex-direction: row;
}

.pie img {
    width: 60px;
    margin-bottom: 10px;
}

.pie h3 {
    margin-bottom: 15px;
}

.pie a,
.pie p {
    color: #ccc;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.pie a:hover {
    color: white;
}

.pie .redes-sociales a {
    margin-right: 15px;
    font-size: 1.5em;
    color: white;
}

.pie .redes-sociales {
    display: flex;
}

.pie .redes-sociales a:hover {
    color: #ccc;
}