/* =========================================================
   КОНТЕЙНЕР И БУТОНИ (МОДЕРЕН ДИЗАЙН)
   ========================================================= */

.button-container-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    padding: 5px 15px;
    font-size: 13px;
    font-weight: bold;
    color: #005ba1;
    background-color: #ffffff;
    text-decoration: none;
    border: 1px solid #f7941e;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08); /* Махната стара сянка */
    cursor: pointer;
    position: relative;
    overflow: hidden;
    will-change: transform;
    transition: all 0.2s ease-in-out;
}

.btn img {
    vertical-align: middle;
    display: inline-block;
    width: 32px;
    height: 25px;
    transition: transform .18s ease;
}

/* Ефекти при посочване */
.btn:hover {
    background-color: #fff9f0;
    border-color: #e78300;
    box-shadow: 0 6px 12px rgba(247, 148, 30, 0.15);
    transform: translateY(-2px);
}

.btn:hover img {
    transform: translateY(-1px) scale(1.05);
}

.btn:focus-visible {
    outline: 3px solid rgba(0,91,161,.35);
    outline-offset: 2px;
}

.button-container-top .btn .btn-text {
    display: block;
    text-align: center;
    line-height: 1.15;
    white-space: normal;
    max-width: 110px;
}

/* =========================================================
   ФОРМА ЗА ТЪРСЕНЕ (ДЕСКТОП)
   ========================================================= */

#block-bartik-formazatrsene {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

#block-bartik-formazatrsene h2 {
    background: #f0ece1;
    border-bottom: 2px solid #d4a017;
    color: #005ba1;
    font-weight: bold;
    font-size: 15px;
    text-transform: uppercase;
    text-align: center;
    padding: 8px 10px;
    margin: 0 0 10px 0;
    border-radius: 4px 4px 0 0;
}

#search-block-form {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 0 10px 15px 10px;
    width: 100%;
    box-sizing: border-box;
}

/* Обвивката на полето (важно за Drupal) */
#search-block-form .form-item-keys {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0; /* Спира насилственото разтягане */
}

#search-block-form .form-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    height: 40px;
    box-sizing: border-box;
}

#search-block-form .form-search:focus {
    border-color: #f7941e;
    outline: none;
}

/* Бутон с лупа (Десктоп) */
#search-block-form .search-form__submit {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 0;
    background: #f5f5f5 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23333"><path d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 1 0-.7.7l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14z"/></svg>') center/20px no-repeat;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

#search-block-form .search-form__submit:hover {
    background-color: #e0e0e0;
}

#edit-lang-fieldset,
#edit-language--wrapper {
    display: none !important;
}

/* =========================================================
   ФИКС ЗА ТЪРСАЧКАТА В МОБИЛЕН ИЗГЛЕД (ДА НЕ СЕ РЕЖЕ)
   ========================================================= */

@media only screen and (max-width: 1023px) {
    
    #block-bartik-formazatrsene {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #search-block-form {
        display: flex !important;
        flex-direction: row !important; 
        flex-wrap: nowrap !important;
        width: 100% !important;
        padding: 10px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        gap: 0 !important; /* Сливат се един до друг */
    }

    /* МАГИЯТА ЗА МОБИЛНО: */
    #search-block-form .form-item-keys {
        flex: 1 1 auto !important; 
        width: 100% !important;
        min-width: 0 !important; /* Пречи на полето да излезе извън екрана */
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    #search-block-form .form-search {
        width: 100% !important;
        max-width: 100% !important;
        height: 46px !important;
        margin: 0 !important;
        border-radius: 6px 0 0 6px !important; /* Заоблено само отляво */
        border-right: none !important; /* Маха дясната линия */
        box-sizing: border-box !important;
        background-color: #f4f9fd !important; /* Лек фон, за да се вижда */
    }

    /* Оранжевият бутон с лупата (Мобилен) */
    #search-block-form .search-form__submit {
        flex: 0 0 50px !important; 
        width: 50px !important;
        height: 46px !important;
        margin: 0 !important;
        border-radius: 0 6px 6px 0 !important; /* Заоблено само отдясно */
        box-sizing: border-box !important;
        background-color: #f7941e !important; 
        border-color: #f7941e !important;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffffff"><path d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 1 0-.7.7l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14z"/></svg>') !important;
        background-repeat: no-repeat !important;
        background-position: center center !important;
        background-size: 20px !important;
    }
}
/* =========================================================
   ПЕРФЕКТНО ВЕРТИКАЛНО ПОДРАВНЯВАНЕ НА ТЪРСАЧКАТА
   ========================================================= */

/* 1. Задължаваме Flexbox-а да центрира елементите вертикално */
#search-block-form {
    align-items: stretch !important; 
}

/* 2. Махаме невидимите отстъпи на контейнера около бутона */
#search-block-form .form-actions,
#search-block-form .form-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}

/* 3. Подсигуряваме се, че самият бутон няма скрити отстъпи */
#search-block-form .search-form__submit {
    margin: 0 !important;
    padding: 0 !important;
}