/* Основні стилі Navbar (залиш без змін або онови, якщо потрібно) */
.navbar {
    background: #000000;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 3px 15px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    /* Важливо для позиціонування гірлянди */
    position: relative; 
    position: sticky;
}

.navbar.hide {
    transform: translateY(-100%);
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    z-index: 1001; /* Щоб лого було над гірляндою */
}

.navbar img.logo {
    width: 140px;
    height: 75px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* === ЯЛИНКА === */
.christmas-tree {
    font-size: 2rem;
    color: #2ecc71;
    filter: drop-shadow(0 0 5px rgba(46, 204, 113, 0.6));
    /* Початкова анімація - плавне погойдування */
    animation: treeSway 3s ease-in-out infinite;
    transition: all 0.3s ease;
    position: relative;
}

/* Додаємо сніжок на верхівку ялинки через CSS */
.christmas-tree::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 5px #fff;
    opacity: 0.8;
}

@keyframes treeSway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

/* Анімація "трусіння" при наведенні */
@keyframes treeShake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
    75% { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}

.brand-container:hover img.logo {
    transform: scale(1.05);
}

.brand-container:hover .christmas-tree {
    color: #27ae60;
    animation: treeShake 0.5s ease-in-out infinite; /* Ялинка труситься */
}

/* Навігація */
.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1001;
}

.navbar a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.3s ease;
    position: relative;
    font-size: 0.95rem;
}

.navbar a:hover {
    color: #0984e3;
    transform: translateY(-1px);
}

.navbar a:hover::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -3px;
    left: 0;
    background-color: #0984e3;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from { width: 0; }
    to { width: 100%; }
}

.navbar .hamburger {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    z-index: 1001;
}

/* === НОВОРІЧНА ГІРЛЯНДА (CSS Lightrope) === */
.lightrope {
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    position: absolute;
    z-index: 999;
    margin: 0; 
    padding: 0;
    pointer-events: none; /* Щоб не заважала клікати */
    width: 100%;
    bottom: -15px; /* Звисає знизу */
    left: 0;
}

.lightrope li {
    position: relative;
    animation-fill-mode: both;
    animation-iteration-count: infinite;
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-block;
    width: 12px;
    height: 28px;
    border-radius: 50%;
    margin: 0 15px; /* Відстань між лампочками */
    background: #00f7a5;
    box-shadow: 0px 4.66px 24px 3px #00f7a5;
    animation-name: flash-1;
    animation-duration: 2s;
}

.lightrope li:before {
    content: "";
    position: absolute;
    background: #222;
    width: 10px;
    height: 9px;
    border-radius: 3px;
    top: -4.6px;
    left: 1px;
}

.lightrope li:after {
    content: "";
    top: -14px;
    left: 9px;
    position: absolute;
    width: 52px;
    height: 18.6px;
    border-bottom: solid #222 2px;
    border-radius: 50%;
}

.lightrope li:last-child:after {
    content: none;
}

.lightrope li:nth-child(2n+1) {
    background: #00ffff;
    box-shadow: 0px 4.66px 24px 3px rgba(0, 255, 255, 0.5);
    animation-name: flash-2;
    animation-duration: 0.4s;
}

.lightrope li:nth-child(4n+2) {
    background: #f70094;
    box-shadow: 0px 4.66px 24px 3px #f70094;
    animation-name: flash-3;
    animation-duration: 1.1s;
}

.lightrope li:nth-child(odd) {
    animation-duration: 1.8s;
}

.lightrope li:nth-child(3n+1) {
    animation-duration: 1.4s;
}

@keyframes flash-1 {
    0%, 100% { background: #00f7a5; box-shadow: 0px 4.66px 24px 3px #00f7a5; }
    50% { background: rgba(0, 247, 165, 0.4); box-shadow: 0px 4.66px 24px 3px rgba(0, 247, 165, 0.2); }
}

@keyframes flash-2 {
    0%, 100% { background: #00ffff; box-shadow: 0px 4.66px 24px 3px #00ffff; }
    50% { background: rgba(0, 255, 255, 0.4); box-shadow: 0px 4.66px 24px 3px rgba(0, 255, 255, 0.2); }
}

@keyframes flash-3 {
    0%, 100% { background: #f70094; box-shadow: 0px 4.66px 24px 3px #f70094; }
    50% { background: rgba(247, 0, 148, 0.4); box-shadow: 0px 4.66px 24px 3px rgba(247, 0, 148, 0.2); }
}

/* Адаптивність */
@media (max-width: 480px) {
    .navbar {
        padding: 8px 12px;
        flex-wrap: wrap;
    }
    
    .navbar img.logo {
        width: 100px;
        height: 50px;
    }
    
    .christmas-tree {
        font-size: 1.5rem;
    }
    
    /* Ховаємо гірлянду на дуже малих екранах, якщо вона заважає, 
       або просто зменшуємо розмір */
    .lightrope {
        bottom: -10px;
    }
    .lightrope li {
        margin: 0 10px;
        width: 8px;
        height: 18px;
    }
    .lightrope li:after {
        width: 35px;
        left: 6px;
    }

    .navbar .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #1a1a1a;
        padding: 10px 0;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 999;
    }
    
    .navbar .nav-links.active {
        display: flex;
    }
    
    .navbar a {
        margin: 8px 0;
        padding: 10px 20px;
        width: 100%;
        text-align: center;
    }
    
    .navbar .hamburger {
        display: block;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .navbar { padding: 10px 15px; }
    .navbar img.logo { width: 120px; height: 60px; }
    .navbar .nav-links { flex-wrap: wrap; gap: 10px; }
    .navbar a { margin: 8px 10px; font-size: 0.9rem; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .navbar { padding: 12px 18px; }
    .navbar img.logo { width: 130px; height: 70px; }
    .navbar a { margin: 0 12px; }
}

.falling-gift {
    position: fixed; /* Фіксована позиція, щоб падало поверх всього */
    top: 0;
    left: 0;
    pointer-events: none; /* Щоб не заважало клікати */
    z-index: 9999;
    font-size: 14px;
    animation: fallDown 1.5s linear forwards;
    opacity: 1;
}

@keyframes fallDown {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(150px) rotate(360deg); /* Падає на 150px вниз */
        opacity: 0;
    }
}