/* 1. ГОЛОВНА ПАНЕЛЬ НАВІГАЦІЇ */
#nav {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    z-index: 1000;
    display: none; 
   background: rgb(195 217 193 / 98%); /* Ефект білого скла */
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(76, 175, 80, 0.15); /* М'яка зелена тінь */
    border: 1px solid rgba(76, 175, 80, 0.1);
    text-align: center; /* Відцентрувати весь текст */
    
    max-height: 80vh; /* Меню не буде довшим за 80% висоти екрана */
    overflow-y: auto; /* Додає вертикальний скрол, якщо контент не влазить */
    -webkit-overflow-scrolling: touch; /* Плавний скрол на iPhone */
}

/* Клас-заглушка для body */
body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

#nav.show {
    display: block !important;
    animation: fadeInScale 0.3s ease-out;
}

#nav p {
    color: #2d3436;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin: 25px 0 15px;
    display: flex;
    align-items: center;
    justify-content: center; /* Центрування заголовків */
}

/* Декоративні зелені лінії по боках заголовків */
#nav p::before, #nav p::after {
    content: "";
    height: 1px;
    width: 40px;
    background: linear-gradient(to right, transparent, #4CAF50);
    margin: 0 15px;
}
#nav p::after {
    background: linear-gradient(to left, transparent, #4CAF50);
}

/* 2. КНОПКИ ФІЛЬТРІВ (Теги) */
.catalog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center; /* Центрування кнопок всередині */
}

.catalog-filters button {
    padding: 10px 22px;
    border-radius: 50px; /* Повністю закруглені */
    border: 1px solid #eef2f0;
    background: #f0f7f2; /* Дуже легкий зелений фон */
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #4a5d51;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.catalog-filters button:hover {
    background: #e1f0e5;
    border-color: #4CAF50;
    transform: translateY(-2px);
}

.catalog-filters button.active {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 8px 15px rgba(76, 175, 80, 0.3);
}

/* 3. КНОПКА ПОШУКУ (Квадратик) */
/*.search-box {*/
/*    display: flex;*/
/*    flex-direction: column;*/
/*    align-items: center;*/
/*    justify-content: center;*/
/*    width: 65px;*/
/*    height: 65px;*/
/*    cursor: pointer;*/
/*    gap: 2px;*/
/*    transition: all 0.3s ease;*/
/*}*/

.icon-close { display: none; }
.icon-search { display: block; }

.search-box.open .icon-search { display: none; }
.search-box.open .icon-close { display: block; }

.search-box.open .btn-text {
    color: #ff4d4d !important; /* Червоний при закритті */
}

.search-box .btn-text {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: #ffffff; /* Білий за замовчуванням для вашої шапки */
    transition: color 0.2s;
}


.search-box {
   display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 65px;
    gap: 2px;
    cursor: pointer;
    border-radius: 16px;
    border: 2px solid #939393;
    box-shadow: 2px 2px 0px #777, 0 8px 16px rgba(0, 0, 0, 0.15);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.2s ease;
    background: linear-gradient(50deg, var(--brand-dark), #396730, #7baa7e);
}

/* hover*/
.search-box:hover {
    background-color: #95d484;
} 

/* натискання — кнопка втискається всередину */
.search-box:active {
    transform: translateY(4px);
    box-shadow:
        0 2px 0 #777,
        0 4px 8px rgba(0, 0, 0, 0.2);
}

/* фокус (якщо буде доступ з клавіатури) */
.search-box:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(15, 87, 0, 0.4),
        0 4px 0 #777,
        0 8px 16px rgba(0, 0, 0, 0.15);
}


/* 4. АДАПТАЦІЯ ТА ПОЗИЦІОНУВАННЯ */

/* Анімація появи */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (min-width: 769px) {
    #nav {
        position: absolute;
        top: 90px; 
        right: 20px;
        width: 100%;
        max-width: 500px; /* Трохи розширив для центрування кнопок */
    }
}

@media (max-width: 768px) {
    #nav {
        position: absolute;
        top: 75px;
        left: 10px;
        right: 10px;
    }
    
    .catalog-filters {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2 колонки на мобільних */
    }
}