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

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding: 2em 1em;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2em 1em;
    background-color: #DF4040;
}

header div:nth-child(2) {
    display: flex;
    gap: 1.5em;
}

header i {
    font-size: 2.25em;
    text-decoration: none;
    color: black;
}

footer {
    background-color: #2e2e2e;
    display: flex;
    justify-content: center;
    padding-top: 2em;
    padding-bottom: 2em;
}

footer div {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
}

footer div p {
    color: white;
}

h1 a, h2 a {
    text-decoration: none;
    color: black;
}

nav {
    position: relative;
    background-color: #d2d2d2;
}

#hamburguesa {
    display: none;
}

#icono_hamburguesa {
    font-size: 2em;
    padding: 0.5em;
    cursor: pointer;
    display: block;
    color: #2e2e2e;
    width: 14.9%;
}

.menu_hamburguesa {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: none;
    flex-direction: column;
    background-color: #d2d2d2;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.menu_hamburguesa li {
    text-align: center;
    border-top: 1px solid #bbb;
}

.menu_hamburguesa li a {
    display: block;
    padding: 1em;
    text-decoration: none;
    color: #2e2e2e;
}

#hamburguesa:checked + #icono_hamburguesa + .menu_hamburguesa {
    display: flex;
}

/*Diseño de la vista de videojuegos*/
.mensaje_bienvenida {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.lista {
    display: flex;
    flex-direction: column;
    gap: 2em;
}

.contenedor_tarjetas {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2em;
    margin-top: 2em;
}

.tarjeta_videojuego {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2em;
    box-shadow: 0 0px 20px rgba(0, 0, 0, 0.3);
    height: 100%;
    border-radius: 1em;
}

.info_superior {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3em;
}

.info_superior h2 {
    font-size: 1.2em;
    margin: 0;
}

.info_superior h3 {
    font-size: 1em;
    margin: 0;
    color: #4f4f4f;
}

.imagen_tarjeta {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 270px;
    margin: 1em 0;
}

.imagen_tarjeta img {
    max-height: 90%;
    max-width: 100%;
    object-fit: cover;
    border-radius: 1em;
}

.info_inferior {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.precio {
    font-size: 1.1em;
    font-weight: bold;
}

/*Diseño de la vista de información*/
.principal_info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1em;
}

.contenedor_info {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 1.5em;
  margin: 0 auto;
}

.contenedor_info > div {
  width: 100%;
}

.contenedor_info img {
  width: 100%;
  height: auto;
}

.contenedor_info > div:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

.contenedor_info > div:nth-child(2) a.btn_principal {
  display: inline-block;
  width: auto;
  padding: 0.5em 1em;
  text-align: center;
  width: 60%;
}

/*Diseño de la vista del carrito*/
.contenedor_principal_carrito {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    height: 100%;
}

.contenedor_carrito {
    width: 100%;
}

.contenedor_carrito > h1 {
    text-align: center;
}

.contenedor_elementos,
.contenedor_precio {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.contenedor_elementos {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    border-top-right-radius: 0.5em;
    border-top-left-radius: 0.5em;
}

.elemento_carrito {
    display: flex;
    width: 100%;
    padding-top: 1.25em;
    padding-bottom: 1.25em;
}

.elemento_carrito:nth-child(even) {
    background-color: #ddd;
}

.elemento_carrito:nth-child(odd) {
    background-color: #ececec;
}

.eliminar_elemento {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 15%;
}

.eliminar_elemento i {
    font-size: 1.5em;
    color: black;
}

.eliminar_elemento i:hover {
    background-color: #DF4040;
    border-radius: 1em;
    padding: 0.5em;
    color: white;
}

.info_elemento {
    display: flex;
    width: 65%;
    gap: 0.5em;
}

.info_elemento h1,
.contenedor_precio h1 {
    font-size: 1.1em;
}

.info_elemento h2,
.contenedor_precio h2 {
    font-size: 0.9em;
}

.info_elemento div:nth-child(1) {
    width: 25%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.info_elemento div:nth-child(2) {
    width: 75%;
    align-content: center;
}

.precio_unidad {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 20%;
}

.precio_unidad h2 {
    font-size: 0.9em;
}

.elemento_carrito img {
    width: auto;
    height: 65px;
    border-radius: 0.5em;
}

.contenedor_precio {
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: end;
    align-items: center;
    border-bottom-left-radius: 0.5em;
    border-bottom-right-radius: 0.5em;
    gap: 1em;
}

.contenedor_precio div:nth-child(1) {
    width: 60%;
    text-align: end;
}

.contenedor_precio div:nth-child(2) {
    width: 20%;
    text-align: center;
}

.btn_finalizar_compra {
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: end;
    align-items: center;
}

/*Diseño de la vista información personal*/
.contenedor_infopersonal {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.contenedor_infopersonal > div {
    width: 100%;
    background: white;
    border-radius: 1em;
    padding: 2em;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.contenedor_infopersonal h1 {
    margin-top: 0.5em;
    margin-bottom: 1em;
    text-align: center;
}

.icono_personal {
    display: flex;
    justify-content: center;
    align-items: center;
}

.contenedor_infopersonal i {
    font-size: 5em;
}

.info_user {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5em;
}

/*Diseño de la vista historial*/
.contenedor_historial {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1.25em;
}

.contenedor_historial h1 {
    align-self: center;
}

.tabla_historial {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

.tabla_historial th, 
.tabla_historial td {
    padding: 0.75em;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.fila_principal .icono_detalles {
    text-align: center;
}

.btn_detalles {
    color: white;
    background-color: #DF4040;
    padding: 0.4em 0.6em;
    border-radius: 0.25em;
    text-decoration: none;
}

.btn_detalles:hover {
    background-color: #a93131;
}

.tabla_videojuegos {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5em;
    background-color: #ddd;
}

.tabla_videojuegos th, 
.tabla_videojuegos td {
    padding: 0.5em;
    border: 1px solid #d2d2d2;
    text-align: left;
}

.tabla_videojuegos thead th {
    background-color: #DF4040;
    color: white;
}

.tabla_videojuegos tbody td {
    background-color: white;
}

.detalle_compra td {
    background-color: #ececec;
}

.contenido_detalle {
    padding: 1em 0;
    background-color: #ececec;
}

/*Diseño de la vista de factura*/
.contenedor_principal_factura {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.contenedor_factura {
    width: 100%;
    background: white;
    border-radius: 1em;
    padding: 2em;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.resumen_factura h2,
.resumen_factura h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.resumen_factura p {
    margin-bottom: 0.25em;
}

.tabla_factura {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

.tabla_factura th,
.tabla_factura td {
    border: 1px solid #d2d2d2;
    padding: 0.75em;
    text-align: left;
}

.tabla_factura th {
    background-color: #DF4040;
    color: white;
}

.btn_volver_tienda {
    display: inline-block;
    margin-top: 2em;
    padding: 0.75em 1.5em;
    background-color: #DF4040;
    color: white;
    text-decoration: none;
    border-radius: 0.5em;
}

.btn_volver_tienda:hover {
    background-color: #a93131;
}

/*Diseño vista tablas principales*/
.contenedor_tablas_principal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.contenedor_tablas_principal > h1 {
    margin-bottom: 0.5em;
}

.tabla_principal {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    margin-bottom: 2em;
}

.tabla_principal th,
.tabla_principal td {
    border: 1px solid #d2d2d2;
    padding: 0.75em;
    text-align: left;
    vertical-align: middle;
}

.tabla_principal th {
    background-color: #DF4040;
    color: white;
}

.tabla_principal img {
    height: 100px;
    width: auto;
}

.table_responsive {
    width: 100%;
    overflow: auto;
}

.celda_imagen,
.celda_genero,
.celda_descripcion,
.celda_nombre,
.celda_apellidos,
.celda_telefono {
    display: none;
}

/*Diseño para los formularios*/
.contenedor_form {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.caja_form {
    width: 100%;
    background: white;
    border-radius: 1em;
    padding: 2em;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.caja_form > h1 {
    text-align: center;
    margin-bottom: 0.5em;
}

.caja_form > h2 {
    margin-bottom: 0.5em;
}

.caja_form > h3 {
    margin-bottom: 0.5em;
}

form label {
    display: block;
    margin-bottom: 0.5em;
}

.caja_form form input,
.caja_form form select,
.caja_form form textarea {
    width: 100%;
    padding: 0.75em 1em;
    margin-bottom: 1em;
    border: 1px solid #d2d2d2;
    border-radius: 0.5em;
    font-size: 1em;
    box-sizing: border-box;
}

#mensajeError {
    color: red;
}

/*Diseño formulario filtro*/
.form_filtro {
    width: 100%;
    background: white;
    border-radius: 1em;
    padding: 2em;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.form_filtro > h3 {
    margin-bottom: 0.5em;
}

.fila_filtro {
    display: flex;
    gap: 1.25em;
    margin-bottom: 1.25em;
}

.filtro {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 50%;
}

.filtro input {
    padding: 0.25em 0.75em;
    border: 1px solid #d2d2d2;
    border-radius: 0.5em;
    font-size: 1em;
    box-sizing: border-box;
}

.articulos_admin {
    display: none;
}

/*Diseño botones*/
.btns_stock {
    display: flex;
    gap: 2.5em;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.btn_añadir_titulo {
    width: 100%;
    display: flex;
    margin-top: 1em;
    gap: 1.25em;
}

.btn_principal,
.btn_principal_button {
    display: inline-block;
    padding: 0.75em 1.5em;
    background-color: #DF4040;
    color: white;
    text-decoration: none;
    border-radius: 0.5em;
    border: none;
    font-size: 1em;
}

.btn_principal:hover,
.btn_principal_button:hover {
    background-color: #a93131;
}

.btn_secundario {
    display: inline-block;
    padding: 0.75em 1.5em;
    background-color: #4f4f4f;
    color: white;
    text-decoration: none;
    border-radius: 0.5em;
}

.btn_secundario:hover {
    background-color: #2e2e2e;
}

.btn_secundario_select {
    display: inline-block;
    padding: 0.75em 1.5em;
    background-color: #2e2e2e;
    color: white;
    text-decoration: none;
    border-radius: 0.5em;
}

.valor_stock {
    display: flex;
    justify-content: space-around;
}

.valor_stock i {
    color: rgb(0, 0, 0, 0.3);
}

.valor_stock i:hover {
    color: rgb(0, 0, 0, 1);
}

.btn_icono {
    border: none;
    background-color: white;
}

.btn_icono i {
    font-size: 1.20em;
    color: black;
}

.btn_icono i:hover {
    background-color: #DF4040;
    border-radius: 1em;
    padding: 1em;
    color: white;
}

/*Diseño SlideShow*/
.slideshow {
    width: 100%;
    position: relative;
    margin-bottom: 2em;
}

.slideshow img {
    width: 100%;
    height: auto;
}

.slideshow i {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 1.5em;
    z-index: 999;
    cursor: pointer;
    color: white;
    padding: 0.5em;
    background-color: rgb(0, 0, 0, 0.7);
    border-bottom-left-radius: 10px;
}

/*Diseño para el apartado de paginación*/
.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.625em;
    padding: 0.625em;
    border-radius: 0.625em;
}

.btn_paginacion {
    padding: 0.5em 0.938em;
    text-decoration: none;
    color: #2e2e2e;
    background-color: #ddd;
    border: 1px solid #bbb;
    border-radius: 0.313em;
    font-weight: bold;
    font-size: 0.875em;
}

.btn_paginacion:hover {
    background-color: #DF4040;
    color: white;
}

.btn_paginacion.disabled {
    color: #d2d2d2;
    background-color: white;
    border-color: #ddd;
}

.btn_paginacion.active {
    background-color: #DF4040;
    color: white;
}

button {
    cursor: pointer;
}


/*Menu desplegable del usuario*/
.user_menu {
    position: relative;
    display: inline-block;
}

.user_menu .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #d2d2d2;
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 150px;
    z-index: 1000;
}

.user_menu .dropdown li {
    padding: 0.625em;
}

.user_menu .dropdown li a {
    text-decoration: none;
    color: black;
    display: block;
}

.user_menu .dropdown li:hover {
    background-color: #ececec;
}

header > div {
    display: flex;
    gap: 1.25em;
    align-items: center;
}

#userToggle:hover {
    cursor: pointer;
}

/*Popup eliminados*/
#fondo_popup_eliminados {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 999;
}

#popup_eliminados {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2em;
    border-radius: 0.75em;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    z-index: 1000;
    width: 95%;
}

#popup_eliminados h2 {
    margin-bottom: 1em;
    font-size: 1.2em;
}

#popup_eliminados ul {
    margin-bottom: 1em;
    list-style-type: none;
}

/*Popup de titulos*/
#fondo_popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 999;
}

#popup_exito {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #e0ffe0;
    border: 2px solid #33cc33;
    border-radius: 0.625em;
    padding: 1.25em 1.875em;
    font-size: 1.2em;
    font-weight: bold;
    z-index: 1000;
    display: none;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

@media only screen and (min-width: 1024px) {
    header {
       padding: 1em 3em; 
    }

    header div:nth-child(2) {
        gap: 5em;
    }

    main {
        padding: 3em 10em;
    }

    #icono_hamburguesa {
        display: none;
    }

    .menu_hamburguesa {
        display: flex !important;
        flex-direction: row;
        justify-content: space-around;
        position: static;
        width: auto;
    }

    .menu_hamburguesa li {
        border: none;
    }

    .menu_hamburguesa li a {
        padding: 1em 2em;
    }

    /*SlideShow*/
    .slideshow {
        width: 35%;
    }

    /*Vista videojuegos*/
    .lista {
        gap: 3em;
    }

    .contenedor_tarjetas {
        grid-template-columns: repeat(4, 1fr);
        gap: 4em;
    }

    /*Vista info videojuego*/
    .principal_info {
        justify-content: center;
        align-items: center;
        padding: 0;
        height: 100%;
    }

    .contenedor_info {
        flex-direction: row;
        width: 70%;
        gap: 2.5em;
    }

    .contenedor_info > div:nth-child(1) {
        width: 40%;
        display: flex;
        justify-content: center;
    }

    .contenedor_info img {
        max-width: 100%;
        max-height: 450px;
        width: auto;
        height: auto;
    }

    .contenedor_info > div:nth-child(2) {
        width: 60%;
        gap: 0.94em;
    }

    .contenedor_info > div:nth-child(2) a.btn_principal {
        width: 25%;
        text-align: center;
    }

    /*Vista de carrito*/
    .contenedor_carrito {
        width: 70%;
    }

    .eliminar_elemento {
        width: 10%;
    }

    .info_elemento {
        width: 70%;
        gap: 1.25em;
    }

    .info_elemento h1,
    .contenedor_precio h1 {
        font-size: 32px;
    }

    .info_elemento h2,
    .contenedor_precio h2 {
        font-size: 24px;
    }

    .info_elemento div:nth-child(1) {
        width: 15%;
    }

    .info_elemento div:nth-child(2) {
        width: 85%;
    }

    .precio_unidad h2 {
        font-size: 24px;
    }

    .elemento_carrito img {
        height: 100px;
    }

    .contenedor_precio {
        gap: 0;
    }

    /*Vista Info personal*/
    .contenedor_infopersonal > div {
        width: 40%;
    }

    /*Vista tabla historial*/
    .tabla_historial {
        width: 70%;
    }

    .fila_principal .icono_detalles {
        text-align: left;
    }

    /*Vista factura*/
    .contenedor_factura {
        width: 50%;
    }

    /*Vista tablas principales*/
    .tabla_principal {
        width: 80%;
    }

    .tabla_principal img {
        height: 150px;
    }

    .celda_imagen,
    .celda_genero,
    .celda_descripcion,
    .celda_nombre,
    .celda_apellidos,
    .celda_telefono {
        display: table-cell;
    }

    .table_responsive {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    /*Vista de los formularios*/
    .caja_form {
        width: 40%;
    }

    /*Vista del filtro*/
    .form_filtro {
        width: 40%;
    }

    .articulos_admin {
        display: table-cell;
    }

    /*Diseño botones*/
    .btn_añadir_titulo {
        width: 80%;
    }

    /*Desplegable usuario*/
    .user_menu .dropdown {
        left: 50%;
        transform: translateX(-50%);
    }

    /*Popup eliminados*/
    #popup_eliminados {
        max-width: 500px;
    }
}

@media only screen and (min-width: 768px) and (max-width: 1023px) {
    header {
       padding: 1em 3em; 
    }

    header div:nth-child(2) {
        gap: 5em;
    }

    main {
        padding: 3em 3em;
    }

    #icono_hamburguesa {
        display: none;
    }

    .menu_hamburguesa {
        display: flex !important;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        position: static;
        width: auto;
    }

    .menu_hamburguesa li {
        border: none;
    }

    .menu_hamburguesa li a {
        padding: 1em 2em;
    }

    /*Vista videojuegos*/
    .lista {
        gap: 3em;
    }

    .contenedor_tarjetas {
        grid-template-columns: repeat(2, 1fr);
        gap: 3em;
    }

    /*Vista info videojuego*/
    .principal_info {
        justify-content: center;
        align-items: center;
        padding: 0;
        height: 100%;
    }

    .contenedor_info {
        flex-direction: row;
        width: 100%;
        gap: 2.5em;
    }

    .contenedor_info > div:nth-child(1) {
        width: 50%;
        display: flex;
        justify-content: center;
    }

    .contenedor_info img {
        max-width: 100%;
        max-height: 450px;
        width: auto;
        height: auto;
    }

    .contenedor_info > div:nth-child(2) {
        width: 50%;
        gap: 0.94em;
    }

    .contenedor_info > div:nth-child(2) a.btn_principal {
        width: 35%;
        text-align: center;
    }

    /*Vista carrito*/
    .contenedor_carrito {
        width: 100%;
    }

    .eliminar_elemento {
        width: 15%;
    }

    .info_elemento {
        width: 65%;
        gap: 0.5em;
    }

    .info_elemento h1,
    .contenedor_precio h1 {
        font-size: 1.8em;
    }

    .info_elemento h2,
    .contenedor_precio h2 {
        font-size: 1.5em;
    }

    .info_elemento div:nth-child(1) {
        width: 25%;
    }

    .info_elemento div:nth-child(2) {
        width: 75%;
    }

    .precio_unidad h2 {
        font-size: 24px;
    }

    .elemento_carrito img {
        height: 100px;
    }

    .contenedor_precio {
        gap: 0;
    }

    /*Vista tabla historial*/
    .fila_principal .icono_detalles {
        text-align: left;
    }

    /*Vista factura*/
    .contenedor_factura {
        width: 100%;
    }

    /*Vista tablas principales*/
    .celda_imagen,
    .celda_genero,
    .celda_nombre,
    .celda_apellidos,
    .celda_telefono {
        display: table-cell;
    }

    /*Desplegable usuario*/
    .user_menu .dropdown {
        left: 50%;
        transform: translateX(-50%);
    }

    /*Popup eliminados*/
    #popup_eliminados {
        width: 85%;
    }

    /*Popup exito*/
    #popup_exito {
        width: 70%;
    }
}