/* ===================================================================
 * Media Queries
 * ------------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
    h1 { font-size: 3.2rem; }
    h2 { font-size: 2.4rem; }
    h3 { font-size: 2rem; }
    
    .s-intro__title {
        font-size: 4.2rem;
    }
    
    .s-intro__subtitle {
        font-size: 2.2rem;
    }
    
    section {
        padding: 6rem 0;
    }
}

/* Domyślnie ukryj przycisk zamknięcia dla wszystkich ekranów */
.header-nav__close {
    display: none;
}

@media screen and (max-width: 900px) {
    .header-menu-toggle {
        display: block;
    }
    
    .header-nav {
        display: block;
        width: 100%;
        height: 100%;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 900;
        background-color: var(--color-bg);
        transform: translateX(100%);
        transition: transform 0.6s ease;
        overflow-y: auto;
    }

    /* Style dla całego menu mobilnego */
    .header-nav.menu-is-open {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 1500;
        background: var(--color-bg);
        overflow-y: auto;
        transform: translateX(0);
    }
    
    /* Style dla przycisku zamknięcia */
    .header-nav.menu-is-open .header-nav__close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 2000;
        background: rgba(0, 0, 0, 0.5);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
    }
    
    /* Poprawiamy pozycjonowanie kresek tworzących X */
    .header-nav.menu-is-open .header-nav__close::before,
    .header-nav.menu-is-open .header-nav__close::after {
        content: '';
        position: absolute;
        width: 20px;
        height: 2px;
        background-color: white;
        top: 50%;
        left: 50%;
    }
    
    .header-nav.menu-is-open .header-nav__close::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }
    
    .header-nav.menu-is-open .header-nav__close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }
    
    /* Ukrywamy tekst w przycisku zamknięcia */
    .header-nav.menu-is-open .header-nav__close span {
        display: none;
    }
    
    /* Blokujemy przewijanie strony gdy menu jest otwarte */
    body.menu-is-open {
        overflow: hidden;
    }
    
    .header-nav__content {
        padding: 30px 30px 42px;
    }
    
    .header-nav__list {
        flex-direction: column;
        text-align: center;
    }
    
    .header-nav__list li {
        margin-bottom: 24px;
    }
    
    .header-nav__list a {
        font-size: 18px;
        color: var(--color-text);
    }
}

@media screen and (max-width: 768px) {
    .header-logo {
        float: none;
        width: 100%;
        text-align: center;
        padding: 0;
    }
    
    .header-nav {
        float: none;
        width: 100%;
        padding: 0;
        margin-top: 0rem;
    }
    
    .header-nav__list {
        display: none;
    }
    
    .header-menu-toggle {
        display: block;
        position: fixed;
        top: 2rem;
        right: 2rem;
        width: 4rem;
        height: 3rem;
        cursor: pointer;
        z-index: 1100;
    }
    
    .header-menu-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--color-text);
        position: absolute;
        left: 0;
        transition: var(--transition);
    }
    
    .header-menu-toggle span:nth-child(1) {
        top: 0;
    }
    
    .header-menu-toggle span:nth-child(2) {
        top: 50%;
        transform: translateY(-50%);
    }
    
    .header-menu-toggle span:nth-child(3) {
        bottom: 0;
    }
    
    .header-menu-toggle.is-clicked span:nth-child(1) {
        transform: rotate(45deg);
        top: 50%;
    }
    
    .header-menu-toggle.is-clicked span:nth-child(2) {
        opacity: 0;
    }
    
    .header-menu-toggle.is-clicked span:nth-child(3) {
        transform: rotate(-45deg);
        top: 50%;
    }
    
    .header-nav.menu-is-open {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--color-bg);
        overflow-y: auto;
        z-index: 999;
        padding: 3rem 0;
    }
    
    .header-nav.menu-is-open .header-nav__list {
        display: block;
        text-align: center;
    }
    
    .header-nav.menu-is-open .header-nav__list li {
        margin: 1.5rem 0;
    }
    
    .header-nav.menu-is-open .header-nav__social {
        display: flex;
        justify-content: center;
        margin-top: 3rem;
    }
    
    .header-nav.menu-is-open .header-nav__social li {
        margin: 0 1rem;
    }
    
    .header-nav.menu-is-open .header-nav__close {
        display: block;
        position: absolute;
        top: 2rem;
        right: 2rem;
        width: 3rem;
        height: 3rem;
        text-indent: -999em;
        background-color: transparent;
        border: none;
    }
    
    .ss-copyright {
        flex-direction: column;
    }
    
    .ss-copyright span {
        margin-bottom: 1.5rem;
    }
    
    .language-switcher {
        position: static;
        margin: 0 auto;
        display: flex;
        justify-content: center;
    }
    
    .language-menu {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        width: 100% !important;
        background-color: transparent !important;
        box-shadow: none !important;
        display: none;
        padding: 0.5rem 0 !important;
        margin: 0 auto;
        max-width: 220px; /* Zwiększona szerokość z 200px na 220px */
    }
    
    /* Poprawka dla elementów menu językowego */
    .language-dropdown .language-menu li a {
        padding: 8px 12px !important; /* Zwiększony padding poziomy */
        justify-content: center !important;
        margin: 4px 0;
        border-radius: 4px;
        background-color: rgba(255, 255, 255, 0.1);
        word-break: keep-all; /* Zapobiega łamaniu wyrazów */
        white-space: nowrap; /* Zapobiega zawijaniu tekstu */
    }
}

@media screen and (max-width: 600px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.2rem; }
    h3 { font-size: 1.8rem; }
    
    .s-intro__title {
        font-size: 3.6rem;
    }
    
    .s-intro__subtitle {
        font-size: 1.8rem;
    }
    
    .s-intro__buttons .btn {
        display: block;
        width: 80%;
        margin: 1rem auto;
    }
    
    section {
        padding: 5rem 0;
    }
    
    .experience-item {
        padding: 1.5rem;
    }
    
    .ss-go-top {
        right: 2rem;
        bottom: 2rem;
    }

    .s-footer__social li {
        margin: 0 1rem;
    }
    
    .s-footer__social a {
        font-size: 2.2rem;
    }
    
    .s-footer__download .btn {
        font-size: 1.4rem;
        padding: 1rem 2rem;
    }
    
    .ss-copyright {
        font-size: 1.2rem;
        padding: 0 2rem;
    }
}

@media screen and (max-width: 400px) {
    .s-intro__title {
        font-size: 3rem;
    }
    
    .s-intro__subtitle {
        font-size: 1.6rem;
    }
    
    .header-menu-toggle {
        right: 1rem; /* Zmniejszenie odległości od prawej krawędzi */
        top: 1.5rem; /* Lekkie przesunięcie w górę */
    }
}