html {
    font-size: 18px;
}

main {
    margin-top: 0;                   /* skutečnou hodnotu doplníme z JS */
    transition: margin-top 0.25s ease;
}



body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

section {
    width: 100%;
    max-width: 1200px;             /* nepřesáhne běžnou čtecí šířku */
    margin: 0 auto;                /* vystředění */
    padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 5vw, 4rem);
    box-sizing: border-box;
}

/* === TYPOGRAFIE === */

h1, h2, h3, h4 {
    font-family: "Segoe UI", system-ui, sans-serif;
    font-weight: 700;
    color: #222;
    line-height: 1.2;
    margin: 0 0 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h3 { font-size: clamp(1.4rem, 3vw, 2rem); }
h4 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

p {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.65;
    color: #333;
    margin-bottom: 1.2rem;
}

strong {
    font-weight: 700;
}

/* === TLAČÍTKA – JEDNOTNÝ STYL === */

.btn,
button,
input[type="submit"] {
    display: inline-block;
    background-color: #F07E1B;
    color: white;
    padding: 0.7rem 1.6rem;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition:
        background-color 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.25s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    background-color: #cf6714;
    transform: translateY(-0.08rem);
    box-shadow: 0 0.3rem 0.7rem rgba(0, 0, 0, 0.15);
}

.btn:active,
button:active,
input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: none;
}

/* === FORMULÁŘE – jednotný vzhled === */

form {
    max-width: 90%;
    margin: 0 auto 3rem;
    padding: 1.5rem 2rem;
    background-color: #F9F5E5;          /* stejný tón jako hlavička */
    border-radius: 1rem;
    box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* Jednotné bloky políček */
.form-group {
    margin-bottom: 1rem;
}

/* Štítky */
form label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

/* Text pod políčkem (nápověda) */
.form-help {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.2rem;
}

/* Vstupy, selecty, textarea – stejné provedení */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font: inherit;
    color: #333;
    border-radius: 0.5rem;
    border: 1px solid #ccc;
    box-sizing: border-box;
    background-color: #fff;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

/* Fokus – oranžový lem, ale jemný */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #F07E1B;
    box-shadow: 0 0 0 0.15rem rgba(240, 126, 27, 0.25);
    background-color: #fffdf8;
}

/* Textarea o trošku vyšší */
textarea {
    min-height: 6rem;
    resize: vertical;
}

/* Chyby ve formuláři */
.form-error {
    font-size: 0.85rem;
    color: #c0392b;
    margin-top: 0.25rem;
}

/* Pole s chybou – červený rámeček */
.has-error input,
.has-error select,
.has-error textarea {
    border-color: #c0392b;
    box-shadow: 0 0 0 0.15rem rgba(192, 57, 43, 0.15);
}

/* Řádky pro více polí vedle sebe (jméno/příjmení/ věk...) */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1 1 0;
}

/* Na mobilu pod sebe */
@media (max-width: 700px) {
    form {
        padding: 1.25rem 1rem;
    }

    .form-row {
        flex-direction: column;
    }
}

/* Checkboxy / rádio – vedle sebe */
.form-inline-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.form-inline-options label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    margin-bottom: 0;
}

/* Trochu sjednocený vzhled checkboxů a rádií */
input[type="checkbox"],
input[type="radio"] {
    accent-color: #F07E1B;
}

/* Akce formuláře – tlačítka */
.form-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Na úzkých obrazovkách klidně doleva/na střed */
@media (max-width: 600px) {
    .form-actions {
        justify-content: flex-start;
    }
}



/* ===== HLAVIČKA – DESKTOP (výchozí) ===== */
/* layout: logo | menu | kontakt; menu je vycentrované, logo a kontakt stejně daleko od středu */

.main-header {
    background-color: #F9F5E5;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    align-items: center;

    padding: 2rem 3rem;             /* „velký“ stav – normální výška */
    box-sizing: border-box;

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;

    transition:
        padding 0.25s ease,
        box-shadow 0.25s ease,
        background-color 0.25s ease;
}



.logo img {
    height: 12rem;                  /* velký stav */
    display: block;
    transition: height 0.25s ease;
}

.main-header.scrolled .logo img {
    height: 3.5rem;                 /* malý stav */
}


/* menu ve středu */
.main-nav {
    grid-column: 2;
    justify-self: center;
}

/* kontakt vpravo */
.btn-contact {
    grid-column: 3;
    justify-self: end;
}

/* MENU – zarovnané na střed, může se lámat do více řádků */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;          /* při zmenšení se menu láme, nezalézá mimo obrazovku */
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.main-nav a {
    display: block;
    text-align: center;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
    transition:
        color 0.2s ease,
        font-weight 0.2s ease,
        text-decoration-color 0.2s ease;
}

/* šipka dolů u položek s podmenu */
.has-submenu > a {
    position: relative;
    padding-right: 1.2rem;
}

.has-submenu > a::after {
    content: "▾";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;      /* větší šipka */
    font-weight: 700;  
    display: inline-block;
    transition: transform 0.2s ease;
}

/* hover – oranžová, tučné, podtržené */
.main-nav a:hover {
    color: #F07E1B;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 0.12rem;
    text-underline-offset: 0.2rem;
}

/* DROPDOWN – výchozí stav SKUTEČNĚ SCHOVANÝ */
.has-submenu {
    position: relative;
}

.submenu {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #F9F5E5;
    box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.1);
    min-width: 15rem;
    border-radius: 0.5rem;       /* zaoblené rohy */
    overflow: hidden;

    /* skryté */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(0.4rem);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        visibility 0.15s ease;
}

.submenu li a {
    text-align: left;
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
}

/* na „velkém“ layoutu rozbal na HOVER */
@media (min-width: 1001px) and (orientation: landscape) {
    .has-submenu:hover > .submenu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .has-submenu:hover > a::after {
        transform: translateY(-50%) rotate(180deg);
    }
}

/* HLAVIČKA po scrollu – zmenšená */
.main-header.scrolled {
    padding: 1rem 3rem; /* menší padding => menší hlavička */
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    background-color: #F9F5E5;
}

/* KONTAKTNÍ TLAČÍTKO */
.btn-contact {
    display: inline-block;
    padding: 0.6rem 1.6rem;
    border-radius: 999px;
    background-color: #F07E1B;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 0.25rem 0.7rem rgba(0, 0, 0, 0.15);
    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
    font-size: 0.95rem;
}

.btn-contact:hover {
    background-color: #cf6714;
    transform: translateY(-0.05rem);
    box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.2);
}

/* HAMBURGER – na desktopu skrytý */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.4rem;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 1.6rem;
    height: 0.15rem;
    margin: 0.25rem 0;
    background-color: #333;
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: center;
}

/* animace hamburgeru na „křížek“ */
.main-header.menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(0.4rem) rotate(45deg);
}

.main-header.menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
}

.main-header.menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-0.4rem) rotate(-45deg);
}
/* ===== MOBIL / ÚZKÉ OKNO – ≤1000px NEBO portrait ===== */
@media (max-width: 1000px), (orientation: portrait) {

    /* hlavička jako flex, aby se věci hezky lámaly */
    .main-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1rem;         /* v mobilu může být menší padding */
    }

    .main-header.menu-open {
        max-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .logo {
        order: 1;
    }

    .logo img {
        height: 4rem;
    }

    .main-header.scrolled .logo img {
        height: 3rem;
    }


    .menu-toggle {
        display: block;
        order: 2;
    }

    /* menu pod logem + hamburgerem, přes celou šířku */
    .main-nav {
        order: 3;
        width: 100%;
        display: none; /* dokud není .menu-open */
    }

    .main-header.menu-open .main-nav {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
        margin-top: 0.5rem;
    }

    .main-nav a {
        text-align: left;
        width: 100%;
        padding: 0.5rem 0;
        font-size: 0.95rem;
    }

    /* dropdowny – na mobilu v bloku, ale když jsou zavřené, nezabírají místo */
    .submenu {
        list-style: none;
        margin: 0;
        padding: 0;          /* žádné místo navíc kolem */
        position: static;
        top: auto;
        left: auto;
        background-color: transparent;
        box-shadow: none;
        min-width: 0;
        border-radius: 0;
        overflow: hidden;

        /* přebijeme desktopové schování */
        display: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        transition: none;
    }

    .submenu li a {
        text-align: left;
        padding: 0.4rem 1.5rem;
        font-size: 0.95rem;
    }

    .has-submenu.open > .submenu {
        display: block;  /* otevřené podmenu na mobilu */
    }

    .main-header.menu-open .has-submenu:hover > .submenu {
        display: block;
    }

    /* šipka rotuje, když je podmenu otevřené */
    .has-submenu.open > a::after {
        transform: translateY(-50%) rotate(180deg);
    }

    /* kontakt – celá šířka, ať nikam neutíká mimo obrazovku */
    .btn-contact {
        order: 4;
        width: 100%;
        margin-top: 0.5rem;
        text-align: center;
        justify-self: auto;
        box-sizing: border-box;
    }
}
/* === FIX: submenu v hamburgeru má být zavřené === */
@media (max-width: 1000px), (orientation: portrait) {

    .main-header .submenu {
        display: none !important;
    }
    .main-header .has-submenu.open > .submenu,
    .main-header.menu-open .has-submenu:hover > .submenu {
        display: block !important;
    }

}
@media (max-width: 1000px), (orientation: portrait) {

    /* odkazy v menu v hamburgeru */
    .main-header .main-nav a {
        display: block;
        position: relative;
        padding-left: 1.2rem;
        padding-right: 0.5rem; /* běžné položky bez šipky */
        white-space: normal; /* může se zalomit na více řádků */
    }

    /* položky, které mají submenu – přidáme extra místo pro šipku */
    .main-header .has-submenu > a {
        padding-right: 1rem;  /* místo pro větší šipku */
    }

    /* šipka – trochu od kraje, ať není nalepená */
    .main-header .has-submenu > a::after {
        right: 0.4rem;          /* už ne úplně na 0 */
    }
}
