/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #1d1d1f;
    background-color: #ffffff;
    font-size: 17px;
    font-weight: 400;
}

/* Wrapper principal para sticky footer */
.page-wrapper {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 100dvw;
}

.content-wrapper {
    flex: 1;
    box-sizing: border-box;
    float: left;
    margin: 0 auto;
}

.wrap{
    width: 1200px;
    margin:0 auto;
    max-width: 100dvw;
}

/* Header estilo Apple */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 12px 0;
    z-index: 1000;
    .wrap {
        display: flex;
        align-items: center;
        padding: 0;
        box-sizing: border-box;
        justify-content: space-between;
    }

    a {
        display: flex;
        align-items: center;
    }

    img {
        height: 44px;
        transition: opacity 0.3s ease;

        &:hover {
            opacity: 0.8;
        }
    }

    /* Navegación principal */
    nav {
        ul {
            list-style: none;
            display: flex;
            gap: 32px;
            margin: 0;
        }

        a {
            color: #1d1d1f;
            text-decoration: none;
            font-size: 17px;
            font-weight: 400;
            transition: color 0.3s ease;
            padding: 8px 0;

            &:hover {
                color: #0071e3;
            }
        }
    }

    div:has(>.banderas){
        display: grid;
        grid-template-rows: 1fr 1fr;
        gap: 5px;
        justify-content: end;
    }

    .banderas{
        display:flex;
        flex-direction:row;
        justify-content: flex-end;
        gap:12px;
        img{
            height:20px;
            cursor:pointer;
        }
    }

    .login{
        font-size: 16px;

        .logged-in {
            display: flex;
            align-items: center;
            gap: 12px;

            a.link_gestion {
                display: inline-flex;
                align-items: center;
                gap: 8px;
                padding: 6px;
                background: #0071e3;
                color: #fff;
                border-radius: 10px;
                font-weight: 600;
                cursor: pointer;
                box-shadow: 0 4px 10px rgba(0,0,0,0.08);
                transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
                -webkit-tap-highlight-color: transparent;
                user-select: none;
                white-space: nowrap;

                &:hover, &:focus {
                    background: #005bb5;
                    transform: translateY(-1px);
                    outline: none;
                    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
                }
                
                &:active {
                    transform: translateY(0);
                    box-shadow: 0 3px 8px rgba(0,0,0,0.10);
                }
            }
        }
        a {
            color: #0071e3;
            text-decoration: none;
            font-weight: 500;
            transition: color 0.3s ease;
            float: right;

            &:hover {
                color: #005bb5;
            }
        }
    }

    /* Menú de idiomas */
    .language-menu {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: 20px;

        .language-label {
            font-size: 18px;
            color: #1d1d1f;
        }

        .language-list {
            list-style: none;
            display: flex;
            gap: 12px;
            margin: 0;

            li {
                margin: 0;
            }

            .lang-link {
                color: #86868b;
                text-decoration: none;
                font-size: 14px;
                font-weight: 500;
                padding: 6px 8px;
                border-radius: 4px;
                transition: all 0.3s ease;
                text-transform: uppercase;

                &:hover {
                    color: #0071e3;
                    background-color: rgba(0, 113, 227, 0.1);
                }

                &.active {
                    color: #0071e3;
                    background-color: rgba(0, 113, 227, 0.15);
                    font-weight: 600;
                }
            }
        }
    }
}

/* Título principal */
h1 {
    font-weight: 600;
    line-height: 1;
    text-align: center;
    background-color: #0cafcc;
    font-size: 20px;
    color: #fff;
    padding: 6px 0;
    text-transform: uppercase;
    user-select: none;
}
/* Contenido principal */
main {
    width: 100dvw;
    max-width: 100%;
    margin: 0 auto;
    /* padding: 30px 22px 60px; */
    flex: 1;
    
    p {
        font-size: 21px;
        font-weight: 400;
        line-height: 1.38;
        color: #1d1d1f;
        margin-bottom: 20px;
    }
}

/* Footer estilo Apple */
footer {
    background-color: #f5f5f7;
    border-top: 1px solid #d2d2d7;
    padding: 40px 0;
    margin-top: auto;

    nav {
        ul {
            list-style: none;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 32px;
            margin: 0;
        }

        a {
            color: #424245;
            text-decoration: none;
            font-size: 12px;
            font-weight: 400;
            transition: color 0.3s ease;
            padding: 8px 0;

            &:hover {
                color: #0071e3;
            }
        }
    }
}

/* Responsivo */
@media (max-width: 768px) {
    header {
        .wrap {
            flex-direction: column;
            gap: 16px;
            padding: 16px 22px;
        }
        
        nav {
            ul {
                gap: 24px;
                flex-wrap: wrap;
                justify-content: center;
            }
        }

        .language-menu {
            margin-left: 0;
            margin-top: 8px;
        }
    }
    
    h1 {
        font-size: 32px;
        line-height: 1.125;
        padding: 40px 22px 0;
    }
    
    main {
        padding: 0 22px 40px;

        p {
            font-size: 19px;
        }
    }
    
    footer {
        .wrap {
            padding: 0 22px;
        }
        
        nav {
            ul {
                flex-direction: column;
                align-items: center;
                gap: 16px;
            }
        }
    }
}

@media (max-width: 480px) {
    header {
        nav {
            ul {
                gap: 16px;
            }

            a {
                font-size: 16px;
            }
        }
    }
    
    h1 {
        font-size: 28px;
    }
    
    main {
        p {
            font-size: 17px;
        }
    }
}