/* =========================================================
   1) RESET / BASE
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
}

img {
    max-width: 100%;
    display: block;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}


/* =========================================================
   2) VARIABLES — LIGHT THEME
   ========================================================= */
:root {
    /* Layout */
    --anchor-offset: 80px;
    --siteFooter-height: 80px;
    --hero-height: 150px;
    --menu-max-height: 50px;
    --breath-space: 20px;

    /* Brand / Header / Menu */
    --brand-bg: #E7F1EC;
    /* много меко зелено-сиво */
    --brand-fg: #2A2F2D;
    /* мек тъмен графит */
    --brand-nav-fg: #3A423F;
    /* по-тъмен, но не черен */
    --brand-nav-fg-open: #1F2A26;

    /* Accent (зелено пастелно) */
    --accent: #A9D8C2;
    /* основен акцент – пастелно зелено */
    --accent-2: #8CCDB0;
    /* hover – малко по-наситено */
    --accent-3: #E3F3EC;
    /* фон за hover / box */

    /* Neutral palette */
    --bg: #F5F7F6;
    /* много светло зелено-сиво */
    --bg-secondary: #dde3dcf1;
    /* карти, секции */
    --text: #2A2F2D;
    /* мек графит */
    --text-secondary: #5A615E;
    /* приглушено сиво-зелено */
    --muted: #7C8682;
    /* леко студено сиво */
    --border: #D3E0DB;
    /* много мек зеленеещ бордер */

    /* Contacts */
    --contact-text: #1F2A26;
    --contact-link: #2F6F57;
    /* тъмно пастелно зелено */
    --contact-link-hover: #3F8F6F;
    /* по-ярко, но пак меко */

    /* Header / Footer */
    --header-bg: #E7F1EC;
    --footer-bg: #E7F1EC;

    --nav-bg: #F0F4F2;
    /* по-ясен фон */
    --nav-text: #2A2F2D;
    /* тъмен графит */
    --nav-hover-bg: #CFE7DD;
    /* пастелно зелено, но по-видимо */
    --nav-hover-text: #1F2A26;
    /* по-тъмен текст */

    /* Shadows */
    --shadow: 0 2px 8px rgba(40, 60, 50, 0.12);
    /* по-мек зеленеещ нюанс */
}



/* =========================================================
   3) VARIABLES — DARK THEME
   ========================================================= */
@media (prefers-color-scheme: dark) {
    :root {
        --brand-bg: #1E2422;
        /* тъмно зелено-сиво */
        --brand-fg: #DDE5E1;
        --brand-nav-fg: #C9D5D0;
        --brand-nav-fg-open: #A9D8C2;

        --accent: #8CCDB0;
        --accent-2: #A1E0C4;
        --accent-3: #2A3A35;

        --bg: #181D1B;
        /* тъмно зелено-сиво */
        --bg-secondary: #222826;
        /* вторичен фон */
        --text: #DDE5E1;
        --text-secondary: #AEB8B3;
        --muted: #8A9590;
        --border: #2E3A36;

        --contact-text: #DDE5E1;
        --contact-link: #A9D8C2;
        --contact-link-hover: #C4E7D7;

        --header-bg: #222b28;
        --footer-bg: #222b28;

        --nav-bg: #222826;
        --nav-text: #DDE5E1;
        --nav-hover-bg: #2F3A37;
        --nav-hover-text: #FFFFFF;

        --shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    }
}



/* =========================================================
   4) GLOBAL ELEMENTS
   ========================================================= */
section,
[id] {
    scroll-margin-top: var(--anchor-offset);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

.section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

#i0 {
    position: relative;
    padding-top: 80px;
    margin-top: -100px;
}

section:last-of-type {
    border-bottom: none;
    min-height: calc(100vh - var(--anchor-offset) - var(--siteFooter-height) - 20px);
}

section+section {
    padding-top: 12px;
}


button,
.btn {
    background: var(--accent);
    color: #0F1A14;
}

button:hover {
    background: var(--accent-2);
}


/* =========================================================
   5) BRAND BAR (HEADER)
   ========================================================= */
.brand-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
    background: var(--header-bg);
    color: var(--brand-fg);
    box-shadow: var(--shadow);

}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand img.logo {
    width: 48px;
    object-fit: contain;
}

.brand-bar .brand-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(1rem, 1.4rem, 1.6rem);
}


/* =========================================================
   6) HAMBURGER MENU
   ========================================================= */
.hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--brand-fg);
    cursor: pointer;
}

.hamburger .lines {
    position: relative;
    width: 22px;
    height: 14px;
    color: var(--brand-nav-fg);
}

.hamburger .lines::before,
.hamburger .lines::after,
.hamburger .line-mid {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    transition: transform 200ms ease, opacity 200ms ease, top 200ms ease, bottom 200ms ease;
}

.hamburger .lines::before {
    top: 0;
}

.hamburger .line-mid {
    top: 6px;
}

.hamburger .lines::after {
    bottom: 0;
}

.hamburger[aria-expanded="true"] .lines::before {
    top: 6px;
    transform: rotate(45deg);
    color: var(--brand-nav-fg-open);
}

.hamburger[aria-expanded="true"] .line-mid {
    opacity: 0;
}

.hamburger[aria-expanded="true"] .lines::after {
    bottom: 6px;
    transform: rotate(-45deg);
    color: var(--brand-nav-fg-open);
}


/* =========================================================
   7) HERO
   ========================================================= */
.hero {
    position: relative;
    width: 100%;
    height: var(--hero-height);
    background-color: var(--footer-bg);
    background-position: center;
    background-size: cover;
    display: none;
}

.hero img {
    height: 100%;
    object-fit: cover;
    object-position: left;
}

.header-overlay {
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--brand-fg);
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    width: 90%;
    z-index: 1;
    pointer-events: none;
}

.header-overlay h2,
.header-overlay .brand-name {
    margin: 0;
    font-size: clamp(2rem, 4.6vw, 3rem);
}


/* =========================================================
   8) DESKTOP NAVIGATION
   ========================================================= */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
    height: min-content;
}

.main-nav .inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-nav ul {
    display: flex;
    gap: clamp(12px, 2.5vw, 28px);
    align-items: center;
    padding: 6px 0;
}

.main-nav a {
    display: inline-block;
    padding: 8px 6px;
    font-weight: 600;
    border-radius: 6px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 0.9rem;
}

.main-nav a:hover {
    color: var(--accent);
    background: var(--accent-3);
    outline: none;
}

/* =========================================================
   9) MOBILE MENU
   ========================================================= */
/* ===== MOBILE MENU BACKDROP ===== */
.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 28, 0.55);
    /* по-мек зеленеещ нюанс */
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transition: opacity 160ms ease, visibility 160ms ease;
}

/* ===== MOBILE MENU WRAPPER ===== */
.mobile-menu {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: var(--bg);
    color: var(--nav-text, var(--brand-nav-fg));
    z-index: 70;
    transform: translateY(-10%);
    opacity: 0;
    visibility: hidden;
    transition: transform 200ms ease, opacity 200ms ease, visibility 200ms ease;
}

.mobile-menu nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

/* ===== OPEN STATE ===== */
.mobile-menu.open,
.mobile-menu-backdrop.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* ===== MOBILE MENU HEADER ===== */
.mobile-menu header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--brand-bg);
}

.mobile-menu header .title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--brand-fg);
}

/* ===== MOBILE MENU LIST ===== */
.mobile-menu nav ul {
    display: grid;
    gap: 8px;
    padding: 16px;
}

/* ===== MOBILE MENU BUTTONS ===== */
.mobile-menu nav ul li a {
    display: block;
    background: var(--bg-secondary);
    color: var(--nav-text, var(--brand-nav-fg));
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-weight: 600;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
    box-shadow: 0 2px 4px rgba(40, 60, 50, 0.08);
}

/* ===== MOBILE HOVER EFFECT (като desktop менюто) ===== */
.mobile-menu nav ul li a:hover,
.mobile-menu nav ul li a:focus-visible {
    background: var(--nav-hover-bg, var(--accent-3));
    color: var(--nav-hover-text, var(--accent-2));
    box-shadow: 0 3px 8px rgba(40, 60, 50, 0.15);
    outline: none;
}

/* ===== LANGUAGE BUTTON ===== */
.mobile-menu nav ul li.lang a {
    background: var(--accent-3);
    border-color: var(--accent);
    color: var(--nav-text);
}

.mobile-menu nav ul li.lang a:hover {
    background: var(--accent-2);
    color: #0F1A14;
}

/* ===== MOBILE MENU FOOTER ===== */
.mobile-menu footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}



/* =========================================================
   10) CONTACTS
   ========================================================= */
.contact-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
    box-shadow: var(--shadow);
}

.contact-card,
.contact-list,
#contacts {
    color: var(--contact-text);
}

.contact-card a,
.contact-list a,
#contacts a {
    color: var(--contact-link);
    font-weight: 600;
}

.contact-card a:hover,
.contact-list a:hover,
#contacts a:hover {
    color: var(--contact-link-hover);
}

.contact-list {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

#map {
    order: 99;
    width: 100%;
    border: 0;
    justify-self: center;
}

.contact-list .label {
    font-weight: 600;
    color: var(--text);
}


/* =========================================================
   11) ICONS
   ========================================================= */
.icon-phone {
    width: clamp(1rem, 1.4rem, 1.6rem);
    height: clamp(1rem, 1.4rem, 1.6rem);
    vertical-align: -3px;
    display: inline-block;
}

.desktop-lang .icon-phone {
    width: clamp(1rem, 1.2rem, 1.4rem);
    height: clamp(1rem, 1.2rem, 1.4rem);
}

/* =========================================================
   12) FOOTER
   ========================================================= */
footer.site-footer {
    background: var(--footer-bg);
    color: var(--brand-fg);
    padding: 2vh;
    text-align: center;
}


/* =========================================================
   13) BACK TO TOP BUTTON
   ========================================================= */
.back-to-top {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    width: 56px;
    height: 56px;
    border-radius: 9999px;
    border: none;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(126, 142, 146, 0.685);
    cursor: pointer;
    z-index: 55;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.back-to-top:hover {
    background: var(--accent-3);
    transform: translateY(-1px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}


/* =========================================================
   14) LANGUAGE SWITCHER
   ========================================================= */
.desktop-lang {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1rem;
    font-weight: 600;
    z-index: 100;
}

.desktop-lang a {
    color: (var(--brand-fg));
    padding: 3px 6px;
    border-radius: 4px;
}

.desktop-lang a:hover {
    /* background-color: var(--bg);
    color: var(--accent-2); */
    /* color: var(--accent); */
    background: var(--bg-secondary);
}

.mobile-menu .lang {
    display: block;
    font-size: 1.1rem;
}

.mobile-menu .lang a {
    padding: 6px 10px;
}


/* =========================================================
   15) RESPONSIVE
   ========================================================= */
@media (max-width: 540px) {
    .hide-on-small {
        display: none;
    }
}

@media (max-width: 346px) {
    .brand-name a {
        font-size: clamp(0.6rem, 0.8rem, 1rem);
    }

    .icon-phone {
        width: clamp(0.6rem, 0.8rem, 1rem);
        height: clamp(0.6rem, 0.8rem, 1rem);
    }
}

@media (min-width: 610px) {
    .contact-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-list>div:nth-child(1) {
        order: 1;
    }

    .contact-list>div:nth-child(2) {
        order: 3;
    }

    .contact-list>div:nth-child(3) {
        order: 2;
    }

    .contact-list>div:nth-child(4) {
        order: 4;
    }

    #map {
        grid-column: 1 / -1;
        /* заема всички колони */
    }
}

@media (min-width: 768px) and (pointer: fine) {

    /* фиксиран хедър */
    .hero {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: var(--hero-height);
        z-index: 50;
    }

    /* фиксирано меню под хедъра */
    .main-nav {
        display: block;
        position: fixed;
        top: var(--hero-height);
        height: var(--menu-max-height);
        left: 0;
        width: 100%;
        z-index: 60;
    }

    /* съдържанието започва под хедъра + менюто */
    main .container {
        margin-top: calc(var(--hero-height) + var(--menu-max-height));
    }

    #i0 {
        padding-top: 10px;
    }

    .contact-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .contact-list>div {
        order: initial;
    }

    #map {
        grid-column: 1 / -1;
        /* заема всички колони */
    }
}

/* Mobile only (phones + tablets, any orientation) */
@media (pointer: coarse) {
    .desktop-nav {
        display: none;
    }

    .mobile-bar {
        display: flex;
    }
}