/* --- RESET I ZMIENNE --- */
:root {
    --color-gold: #baa256;
    --color-gold-dark: #b39840;
    --color-dark: #201d1a;
    --color-dark-hover: #292421;
    --color-text: #eae2c5;
    --color-grey: #9f9c9a;
    --border-color: #404040;
    /* Główny font strony */
    --font-main: "freight-text-pro", Baskerville, "Baskerville Old Face", "Hoefler Text", Garamond, "Times New Roman", serif;
    /* Font dla nagłówków formularza */
    --font-headers: "FreightBigProMedium-Regular", Baskerville, "Baskerville Old Face", serif;
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    text-rendering: optimizelegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-dark);
    color: var(--color-text);
    font-family: var(--font-main);
    overflow-x: hidden;
    margin: 0; 
    position: relative;
}

/* --- KONFIGURACJA CZCIONEK --- */

/* Font do LOGO w menu */
@font-face {
    font-family: 'logoFont-Face';
    src: url('fonts/medio.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; 
}

/* Font do INTRO (tak jak w oryginale) */
@font-face {
    font-family: 'myFirstFont';
    src: url('fonts/LassigueDMato.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; 
}

/* --- DOSTĘPNOŚĆ --- */
:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* --- GŁÓWNY HEADER (Zjeżdżające MENU) --- */
.main-header {
    position: fixed;
    width: 100%;
    height: 80px; 
    z-index: 200; /* BARDZO WAŻNE: Musi być wyżej niż intro (100) */
    top: 0;
    background-color: var(--color-dark); 
    transition: height 0.3s ease; 
    will-change: height, transform;
    
    /* ANIMACJA: Menu zjeżdża z góry - ZMIANA: Czas wydłużony do 2.2s (wolniej i delikatniej) */
    animation: slideDownHeader 2.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes slideDownHeader {
    0% { transform: translateY(-180%); } /* Schowane wysoko */
    100% { transform: translateY(0); }   /* Widoczne na miejscu */
}

.main-nav, 
.nav-list {
    width: 100%;
    height: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list {
    display: flex;
}

/* --- ELEMENTY MENU --- */
.nav-item {
    height: 100%;
    border-bottom: 2px solid var(--color-gold);
    border-right: 0.1px solid var(--border-color);
    background-color: var(--color-dark);
    transition: background-color 0.3s ease-out, border-color 0.3s ease-out;
    flex: 0 0 12%; 
    display: flex;
    align-items: center;
    justify-content: center;
    position: static;
}

.nav-item.logo-item {
    flex: 0 0 40%;
    border-right: 0.1px solid var(--border-color);
    justify-content: center; 
}

.nav-item:last-child {
    border-right: none;
    background-color: var(--color-gold);
    border-bottom: none; 
    cursor: pointer;
}

.nav-item:last-child:hover {
    background-color: var(--color-gold-dark);
}

/* --- LINKI --- */
.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: var(--color-grey);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    white-space: nowrap; 
}

/* --- HOVER --- */
.nav-item:not(.logo-item):not(:last-child):hover {
    background-color: var(--color-dark-hover);
    border-bottom: 7px solid var(--color-gold);
}

.nav-item:not(.logo-item):not(:last-child):hover .nav-link {
    padding-top: 5px; 
}

.nav-item:not(.logo-item):hover .nav-link {
    color: var(--color-gold);
}

.nav-item:last-child .nav-link {
    color: var(--color-dark);
    font-weight: normal; 
}
.nav-item:last-child:hover .nav-link {
    color: var(--color-dark);
}

/* --- AKTYWNA STRONA --- */
.nav-item.current-page {
    background-color: var(--color-dark-hover);
}

.nav-item.current-page .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 7px;
    background-color: var(--color-gold);
    z-index: 2;
}

.nav-item.current-page .nav-link {
    color: var(--color-gold);
}

/* --- LOGO --- */
.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: #fff;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 12px;
    transition: gap 0.3s ease; 
}

.logo-img {
    height: 60px;
    width: auto;
    display: block;
    margin: 0;
    transition: height 0.3s ease; 
    will-change: height;
}

.logo-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; 
    margin: 0;
}

.brand-name {
    font-family: 'logoFont-Face', serif; 
    font-size: 40px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1; 
    font-weight: normal; 
    margin-bottom: -4px;
    transition: font-size 0.3s ease;
    white-space: nowrap; 
}

.brand-tagline {
    font-family: 'Old Standard TT', serif;
    font-size: 11px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.2em; 
    line-height: 1;
    margin: 0;
    margin-right: -0.2em;
    text-align: center;
    transition: font-size 0.3s ease;
}

/* --- DROPDOWN --- */
.dropdown-menu {
    position: absolute;
    top: -250px; 
    left: 0;
    width: 100%; 
    height: 280px;
    background-color: var(--color-dark);
    border-bottom: 4px solid var(--color-gold);
    z-index: -1;
    display: flex;
    visibility: hidden;
    margin: 0;
    padding: 0;
    list-style: none;
    transition: all 400ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nav-item:hover .dropdown-menu {
    top: 80px;
    visibility: visible;
}

.dropdown-item {
    flex: 1; 
    height: 100%;
    border-right: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}
.dropdown-item:last-child {
    border-right: none;
}

.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(90%);
    transform: scale(1);
    transition: filter 0.2s ease-out, transform 3s ease-out;
    display: block; 
}
.pos-bottom { object-position: 50% 85%; }

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-dark);
    opacity: 0.9;
    transition: opacity 0.2s ease-out;
    z-index: 1;
}

.gallery-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    border: 1.5px solid transparent; 
    transition: all 0.1s ease-out;
}

.gallery-text span {
    display: block;
    padding: 15px; 
    color: var(--color-gold);
    text-transform: uppercase;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.1s ease-out;
    margin: 2.5px; 
}

.dropdown-item:hover .gallery-img {
    filter: grayscale(0%);
    transform: scale(1.15);
}

.dropdown-item:hover .gallery-overlay { opacity: 0; }
.dropdown-item:hover .gallery-text { border-color: var(--color-gold); }
.dropdown-item:hover .gallery-text span {
    background-color: var(--color-gold);
    color: var(--color-dark);
}

/* --- SIDEBAR --- */
.form-sidebar {
    position: fixed;
    top: 80px; 
    right: 0;
    height: calc(100vh - 80px);
    width: 450px;
    max-width: 100%;
    background-color: var(--color-dark);
    border-left: 2px solid var(--color-gold);
    z-index: 300; /* ZWIĘKSZONO: Żeby sidebar był nad otwartym menu mobilnym */
    
    transform: translateX(100%); 
    transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    will-change: transform;
    
    padding: 20px 40px; 
    overflow-y: auto;
    color: var(--color-gold);
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
}

.form-sidebar.active {
    transform: translateX(0);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--color-gold);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s;
}
.close-btn:hover {
    transform: scale(1.2);
    color: #fff;
}

.form-label {
    display: block;
    color: var(--color-gold);
    font-family: var(--font-headers, serif);
    font-size: 20px;
    margin-bottom: 2px; 
    margin-top: 10px; 
    letter-spacing: 1px;
}
.form-label:first-of-type { margin-top: 10px; }

.form-input, 
.form-textarea {
    width: 100%;
    background-color: transparent; 
    border: 1px solid var(--color-gold);
    color: var(--color-text);
    padding: 10px 15px;
    font-size: 16px;
    font-family: inherit;
    margin-bottom: 5px;
    transition: all 0.3s ease-out;
    outline: none;
}

.form-input { height: 45px; }
.form-textarea { height: 180px; resize: vertical; line-height: 1.5; }

.form-input:focus,
.form-textarea:focus {
    box-shadow: 0 0 8px rgba(186, 162, 86, 0.2);
    background-color: rgba(186, 162, 86, 0.05);
}

.submit-container {
    margin-top: 40px;
    border: 2px solid var(--color-gold);
    padding: 4px; 
    margin-bottom: 20px;
}

.submit-btn {
    width: 100%;
    height: 50px;
    background-color: var(--color-gold);
    color: #201d1a; 
    font-family: var(--font-headers, serif);
    font-size: 20px;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    letter-spacing: 1px;
    font-weight: 500;
}

.submit-btn:hover { background-color: #d4bf70; }

@media screen and (max-width: 1000px) { 
    .form-sidebar { width: 100%; border-left: none; }
}
@media screen and (max-width: 400px) {
    .form-sidebar { padding: 20px 20px; } 
}

@media screen and (min-width:1201px) { .gallery-text span { font-size: 22px; } }
@media screen and (max-width: 1200px) { .gallery-text span { font-size: 18px; } }
@media screen and (max-width: 1000px) { .gallery-text span { font-size: 14px; } }
@media screen and (orientation:portrait){ .dropdown-menu { display: none; } }

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-button { width: 0px; height: 0px; }
::-webkit-scrollbar-thumb { background: #baa256; }
::-webkit-scrollbar-thumb:hover { background: #948038; }
::-webkit-scrollbar-thumb:active { background: #7f661f; }
::-webkit-scrollbar-track { background: #201d1a; }
::-webkit-scrollbar-track:hover { background: #404040; }
::-webkit-scrollbar-corner { background: transparent; }

/* --- RESPONSYWNOŚĆ --- */
@media screen and (min-width: 1700px) {
    .main-header { height: 110px; }
    .form-sidebar { top: 110px; height: calc(100vh - 110px); }
    .nav-item:hover .dropdown-menu { top: 110px; }
    .logo-img { height: 90px; }
    .brand-name { font-size: 56px; margin-bottom: -6px; }
    .brand-tagline { font-size: 16px; }
    .logo-container { gap: 18px; }
    .nav-link { font-size: 16px; letter-spacing: 1.5px; }
}

@media screen and (min-width: 2021px) {
    .main-header { height: 130px; }
    .form-sidebar { top: 130px; height: calc(100vh - 130px); }
    .nav-item:hover .dropdown-menu { top: 130px; }
    .logo-img { height: 100px; }
    .brand-name { font-size: 64px; }
    .brand-tagline { font-size: 19px; }
    .nav-link { font-size: 18px; }
}

@media screen and (max-width: 1200px) {
    .main-header { height: 70px; }
    .form-sidebar { top: 70px; height: calc(100vh - 70px); }
    .nav-item:hover .dropdown-menu { top: 70px; }
    .logo-img { height: 50px; }
    .brand-name { font-size: 34px; margin-bottom: -3px; }
    .brand-tagline { font-size: 9px; }
    .logo-container { gap: 10px; }
    .nav-link { font-size: 12px; }
}

@media screen and (max-width: 1000px) {
    .main-header { height: 60px; }
    .form-sidebar { top: 60px; height: calc(100vh - 60px); }
    .nav-item:hover .dropdown-menu { top: 60px; }
    .logo-img { height: 45px; }
    .brand-name { font-size: 30px; margin-bottom: -2px; }
    .brand-tagline { font-size: 9px; }
    .logo-container { gap: 8px; }
    .nav-link { font-size: 11px; letter-spacing: 0.5px; }
}

/* --- EKRAN SUKCESU --- */
.success-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--color-dark);
    z-index: 200;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden;
    transition: all 6s cubic-bezier(0.46, 0.4, 0.47, 0.4);
}
.success-overlay.active { opacity: 1; visibility: visible; }

.success-message {
    color: #fff; font-family: 'myFirstFont', sans-serif; 
    font-size: 200px; text-transform: none; text-align: center; letter-spacing: 1px;
}

@media screen and (min-width: 1921px) { .success-message { font-size: 300px; } }
@media screen and (min-width: 1600px) and (max-width: 1920px) { .success-message { font-size: 250px; } }
@media screen and (max-width: 1200px) { .success-message { font-size: 100px; } }
@media screen and (max-width: 1000px) { .success-message { font-size: 54px; } }
@media screen and (max-width: 600px) { .success-message { font-size: 50px; } }

/* =========================================
   ANIMACJA POWITALNA (INTRO - Identyczna z oryginałem)
   ========================================= */

/* Kontener Intro - pokrywa cały ekran */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-dark); /* Kolor tła identyczny jak strony */
    z-index: 100; /* Niżej niż header (200), ale wyżej niż treść */
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* ZMIANA: Czas trwania intro został przyspieszony. 
       Opóźnienie 1.5s + animacja zanikania 0.5s = 2s widoczności napisu */
    animation: fadeOutIntro 0.5s cubic-bezier(0.46, 0.4, 0.47, 0.4) forwards;
    animation-delay: 1.5s; 
    pointer-events: none; /* Kliknięcia przechodzą przez intro (SEO friendly) */
}

@keyframes fadeOutIntro {
    0% { opacity: 1; }
    99% { opacity: 0; }
    100% { opacity: 0; visibility: hidden; }
}

.intro-content {
    text-align: center;
    margin-bottom: 50px; /* Lekka korekta pozycji w pionie */
}

/* Napis Estica w Intro */
.intro-logo {
    font-family: 'myFirstFont', serif; /* Oryginalna czcionka */
    font-size: 200px; /* Rozmiar z oryginału */
    color: #eae2c5;
    margin-bottom: 20px;
    opacity: 0.8;
}

/* Responsywność napisu */
@media screen and (max-width: 1200px) { .intro-logo { font-size: 150px; } }
@media screen and (max-width: 800px) { .intro-logo { font-size: 100px; } }
@media screen and (max-width: 500px) { .intro-logo { font-size: 70px; } }

.lds-ellipsis {
    display: none;
}


/* =========================================
   NOWOŚĆ: MENU MOBILNE (HAMBURGER)
   Dla ekranów poniżej 1000px
   ========================================= */

/* Domyślnie ukryj pasek mobilny na desktopie */
.mobile-bar {
    border-bottom: 1px solid var(--color-gold);
    display: none;
}

@media screen and (max-width: 1000px) {

    /* 1. Pasek nawigacji mobilnej (Logo + Burger) */
    .mobile-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        height: 100%;
        padding: 0 20px;
        background-color: var(--color-dark);
        position: relative;
        z-index: 205; /* Wyżej niż rozwijana lista menu */
    }

    /* Stylizacja logo w pasku mobilnym */
    .mobile-bar .logo-container {
        gap: 10px;
    }
    .mobile-bar .logo-img {
        height: 45px;
        width: auto;
    }
    .mobile-bar .brand-name {
        font-size: 28px;
    }
    .mobile-bar .brand-tagline {
        font-size: 8px;
    }

    /* 2. Przycisk Hamburger */
    .hamburger-btn {
        background: transparent;
        border: none;
        cursor: pointer;
        width: 40px;
        height: 30px;
        position: relative;
        z-index: 205;
        padding: 0;
    }

    .hamburger-btn .bar {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--color-gold);
        margin: 6px 0;
        transition: 0.4s;
    }

    /* Animacja Hamburgera w X */
    .hamburger-btn.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-7px, 6px);
    }
    .hamburger-btn.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger-btn.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-7px, -6px);
    }

    /* 3. Lista Menu - U GÓRY */
    .nav-list {
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* Wyrównanie do góry */
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh; /* Pełna wysokość ekranu */
        background-color: var(--color-dark);
        z-index: 200;
        
        /* Animacja wjazdu */
        transform: translateY(-100%); /* Schowane u góry */
        transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
        padding-top: 140px; 
    }

    .nav-list.active {
        transform: translateY(0); /* Widoczne */
    }

    /* Ukryj oryginalne logo z listy (bo mamy je już na pasku) */
    .nav-item.logo-item.desktop-only-logo {
        display: none;
    }

    /* Stylizacja elementów listy na mobile */
    .nav-item {
        /* ZMIANA: Pełna szerokość i stały pasek */
        width: 100%; 
        flex: 0 0 auto; 
        height: auto;
        background: transparent;
        margin: 0; /* Brak marginesów bocznych, paski przylegają do krawędzi */
        
        opacity: 0; /* Do animacji pojawiania się */
        transform: translateY(20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        
        /* ZMIANA: Stały złoty pasek */
        border: none;
        border-bottom: 1px solid var(--color-gold);
        display: flex;
        justify-content: center; /* Wyśrodkowanie tekstu wewnątrz paska */
    }

    /* Animacja pojawiania się linków jeden po drugim */
    .nav-list.active .nav-item {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Opóźnienia dla płynnego efektu */
    .nav-list.active .nav-item:nth-child(2) { transition-delay: 0.1s; } /* Firma */
    .nav-list.active .nav-item:nth-child(3) { transition-delay: 0.2s; } /* Galeria */
    .nav-list.active .nav-item:nth-child(4) { transition-delay: 0.3s; } /* Wycena */
    .nav-list.active .nav-item:nth-child(5) { transition-delay: 0.4s; } /* Kontakt */
    .nav-list.active .nav-item:nth-child(6) { transition-delay: 0.5s; } /* Zadaj pytanie */

    /* Stylizacja linków */
    .nav-link {
        font-size: 24px; /* Duże litery */
        padding: 20px 15px; /* Większy padding góra/dół dla wygody dotyku */
        color: var(--color-text);
        display: block;
        width: 100%;
        text-align: center;
    }
    
    /* ZMIANA: Brak zmiany paska przy hoverze */
    .nav-item:hover {
        background: transparent;
        border-bottom: 1px solid var(--color-gold); /* Bez zmian */
    }
    
    .nav-item:hover .nav-link {
        color: var(--color-gold);
        /* ZMIANA: Brak zmiany paddingu */
        padding-top: 20px !important; 
    }
    
    /* Ukrycie hover dropdown galerii na mobile (kliknięcie w link przeniesie do galerii) */
    .dropdown-menu {
        display: none; 
    }
}