/* ========================================
   Search Modal - Desktop Only
   ======================================== */

/* Кнопка відкриття пошуку в header */
.header-search-btn {
    display: none; /* За замовчуванням ховаємо */
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #578dac 0%, #45A148 100%);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    font-family: "OpenSans-SemiBold", sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(87, 141, 172, 0.3);
}

.header-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(87, 141, 172, 0.4);
}

.header-search-btn i {
    font-size: 16px;
}

/* Показуємо тільки на десктопі */
@media (min-width: 992px) {
    .header-search-btn {
        display: inline-flex;
    }
}

/* Модальне вікно */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

.search-modal.active {
    display: flex;
}

.search-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-modal__container {
    position: relative;
    width: 90%;
    max-width: 800px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s ease;
    z-index: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666666;
    transition: all 0.3s ease;
    z-index: 2;
}

.search-modal__close:hover {
    background: #e0e0e0;
    color: #333333;
    transform: rotate(90deg);
}

.search-modal__content {
    padding: 40px 40px 30px;
}

.search-modal__title {
    font-family: "OpenSans-Bold", sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #333333;
    margin: 0 0 30px 0;
    text-align: center;
}

.search-modal__search-wrapper {
    position: relative;
}

.search-modal__icon {
    position: absolute;
    left: 25px;
    top: 22px;
    color: #578dac;
    font-size: 20px;
    pointer-events: none;
    z-index: 2;
}

.search-modal__input {
    width: 100%;
    padding: 20px 25px 20px 65px;
    font-family: "OpenSans-Regular", sans-serif;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    color: #333333;
}

.search-modal__input:focus {
    outline: none;
    border-color: #578dac;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(87, 141, 172, 0.1);
}

.search-modal__input::placeholder {
    color: #999999;
}

.search-modal__results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-modal__results.active {
    display: block;
}

/* Використовуємо ті самі стилі що й для основного пошуку */
.search-modal__results .waste-search__result-item {
    padding: 18px 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.search-modal__results .waste-search__result-item:last-child {
    border-bottom: none;
}

.search-modal__results .waste-search__result-item:hover {
    background: linear-gradient(90deg, rgba(87, 141, 172, 0.05) 0%, rgba(69, 161, 72, 0.05) 100%);
}

.search-modal__results .waste-search__result-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(87, 141, 172, 0.1) 0%, rgba(69, 161, 72, 0.1) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #578dac;
    font-size: 18px;
}

.search-modal__results .waste-search__result-content {
    flex: 1;
}

.search-modal__results .waste-search__result-code {
    font-family: "OpenSans-Bold", sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #578dac;
    margin: 0 0 5px 0;
}

.search-modal__results .waste-search__result-title {
    font-family: "OpenSans-Regular", sans-serif;
    font-size: 14px;
    color: #333333;
    margin: 0;
    line-height: 1.4;
}

.search-modal__results .waste-search__result-highlight {
    background: rgba(87, 141, 172, 0.2);
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

.search-modal__results .waste-search__no-results,
.search-modal__results .waste-search__loading {
    padding: 30px 25px;
    text-align: center;
    color: #999999;
    font-family: "OpenSans-Regular", sans-serif;
    font-size: 15px;
}

.search-modal__results .waste-search__loading i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Scrollbar */
.search-modal__results::-webkit-scrollbar {
    width: 8px;
}

.search-modal__results::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.search-modal__results::-webkit-scrollbar-thumb {
    background: #578dac;
    border-radius: 10px;
}

.search-modal__results::-webkit-scrollbar-thumb:hover {
    background: #45A148;
}

/* ========================================
   Responsive
   ======================================== */

/* Tablet */
@media (max-width: 991px) {
    .search-modal {
        padding-top: 60px;
    }
    
    .search-modal__container {
        max-width: 90%;
    }
    
    .search-modal__content {
        padding: 35px 30px 25px;
    }
    
    .search-modal__title {
        font-size: 28px;
        margin-bottom: 25px;
    }
    
    .search-modal__input {
        padding: 18px 20px 18px 60px;
        font-size: 15px;
    }
    
    .search-modal__icon {
        left: 20px;
        top: 20px;
        font-size: 18px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .search-modal {
        padding-top: 20px;
        align-items: stretch;
    }
    
    .search-modal__container {
        width: 100%;
        max-width: 100%;
        height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    
    .search-modal__content {
        padding: 30px 20px;
        flex: 1;
        overflow-y: auto;
    }
    
    .search-modal__title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .search-modal__close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .search-modal__input {
        padding: 16px 18px 16px 55px;
        font-size: 14px;
        border-radius: 40px;
    }
    
    .search-modal__icon {
        left: 18px;
        top: 18px;
        font-size: 16px;
    }
    
    .search-modal__results {
        max-height: 300px;
        border-radius: 15px;
    }
    
    .search-modal__results .waste-search__result-item {
        padding: 15px 18px;
        gap: 12px;
    }
    
    .search-modal__results .waste-search__result-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .search-modal__results .waste-search__result-code {
        font-size: 14px;
    }
    
    .search-modal__results .waste-search__result-title {
        font-size: 13px;
    }
}




/* ========================================
   Dropdown Search in Menu
   ======================================== */

.dropdown-search {
    padding: 15px 20px 10px;
    pointer-events: auto;
}

.dropdown-search:hover {
    background: transparent !important;
}

.dropdown-search__wrapper {
    position: relative;
}

.dropdown-search__icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #578dac;
    font-size: 16px;
    pointer-events: none;
    z-index: 2;
}

.dropdown-search__input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    font-family: "OpenSans-Regular", sans-serif;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    color: #333333;
}

.dropdown-search__input:focus {
    outline: none;
    border-color: #578dac;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(87, 141, 172, 0.1);
}

.dropdown-search__input::placeholder {
    color: #999999;
    font-size: 13px;
}

.dropdown-search__results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-height: 350px;
    overflow-y: auto;
    display: none;
    z-index: 9999;
}

.dropdown-search__results.active {
    display: block;
}

/* Стилі результатів */
.dropdown-search__results .waste-search__result-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.dropdown-search__results .waste-search__result-item:last-child {
    border-bottom: none;
}

.dropdown-search__results .waste-search__result-item:hover {
    background: linear-gradient(90deg, rgba(87, 141, 172, 0.05) 0%, rgba(69, 161, 72, 0.05) 100%);
}

.dropdown-search__results .waste-search__result-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, rgba(87, 141, 172, 0.1) 0%, rgba(69, 161, 72, 0.1) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #578dac;
    font-size: 14px;
}

.dropdown-search__results .waste-search__result-content {
    flex: 1;
}

.dropdown-search__results .waste-search__result-code {
    font-family: "OpenSans-Bold", sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #578dac;
    margin: 0 0 4px 0;
}

.dropdown-search__results .waste-search__result-title {
    font-family: "OpenSans-Regular", sans-serif;
    font-size: 12px;
    color: #333333;
    margin: 0;
    line-height: 1.4;
}

.dropdown-search__results .waste-search__result-highlight {
    background: rgba(87, 141, 172, 0.2);
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

.dropdown-search__results .waste-search__no-results,
.dropdown-search__results .waste-search__loading {
    padding: 20px 15px;
    text-align: center;
    color: #999999;
    font-family: "OpenSans-Regular", sans-serif;
    font-size: 13px;
}

.dropdown-search__results .waste-search__loading i {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* Scrollbar */
.dropdown-search__results::-webkit-scrollbar {
    width: 6px;
}

.dropdown-search__results::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.dropdown-search__results::-webkit-scrollbar-thumb {
    background: #578dac;
    border-radius: 10px;
}

.dropdown-search__results::-webkit-scrollbar-thumb:hover {
    background: #45A148;
}

/* Divider після пошуку */
.dropdown-search + .dropdown-divider {
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 991px) {
    .dropdown-search {
        padding: 12px 15px 8px;
    }
    
    .dropdown-search__input {
        padding: 10px 12px 10px 40px;
        font-size: 13px;
    }
    
    .dropdown-search__icon {
        left: 12px;
        font-size: 14px;
    }
    
    .dropdown-search__results {
        max-height: 280px;
    }
}


























/* ========================================
   Calculate Modal
   ======================================== */

.calculate-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.calculate-modal.active {
    display: flex;
}

.calculate-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.calculate-modal__container {
    position: relative;
    width: 100%;
    max-width: 550px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    z-index: 1;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.calculate-modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666666;
    transition: all 0.3s ease;
    z-index: 2;
}

.calculate-modal__close:hover {
    background: #e0e0e0;
    color: #333333;
    transform: rotate(90deg);
}

.calculate-modal__content {
    padding: 40px 35px 35px;
}

.calculate-modal__icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #578dac 0%, #45A148 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #ffffff;
    box-shadow: 0 5px 20px rgba(87, 141, 172, 0.3);
}

.calculate-modal__title {
    font-family: "OpenSans-Bold", sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #333333;
    text-align: center;
    margin: 0 0 12px 0;
}

.calculate-modal__subtitle {
    font-family: "OpenSans-Regular", sans-serif;
    font-size: 15px;
    color: #666666;
    text-align: center;
    margin: 0 0 30px 0;
    line-height: 1.5;
}

.calculate-modal__subtitle strong {
    color: #578dac;
    font-weight: 600;
}

.calculate-modal__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calculate-modal__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calculate-modal__label {
    font-family: "OpenSans-SemiBold", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calculate-modal__label i {
    color: #578dac;
    font-size: 14px;
}

.calculate-modal__input {
    font-family: "OpenSans-Regular", sans-serif;
    font-size: 15px;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #333333;
}

.calculate-modal__input:focus {
    outline: none;
    border-color: #578dac;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(87, 141, 172, 0.1);
}

.calculate-modal__input::placeholder {
    color: #999999;
}

.calculate-modal__button {
    font-family: "OpenSans-SemiBold", sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 30px;
    background: linear-gradient(135deg, #578dac 0%, #45A148 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(87, 141, 172, 0.3);
    margin-top: 10px;
}

.calculate-modal__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(87, 141, 172, 0.4);
}

.calculate-modal__button:active {
    transform: translateY(0);
}

.calculate-modal__success {
    text-align: center;
    padding: 20px;
}

.calculate-modal__success i {
    font-size: 64px;
    color: #45A148;
    margin-bottom: 20px;
}

.calculate-modal__success h3 {
    font-family: "OpenSans-Bold", sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #333333;
    margin: 0 0 10px 0;
}

.calculate-modal__success p {
    font-family: "OpenSans-Regular", sans-serif;
    font-size: 15px;
    color: #666666;
    margin: 0;
}

/* Scrollbar */
.calculate-modal__container::-webkit-scrollbar {
    width: 8px;
}

.calculate-modal__container::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.calculate-modal__container::-webkit-scrollbar-thumb {
    background: #578dac;
    border-radius: 10px;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 767px) {
    .calculate-modal__container {
        max-width: 100%;
        border-radius: 15px;
    }
    
    .calculate-modal__content {
        padding: 35px 25px 30px;
    }
    
    .calculate-modal__icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .calculate-modal__title {
        font-size: 24px;
    }
    
    .calculate-modal__subtitle {
        font-size: 14px;
    }
    
    .calculate-modal__input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .calculate-modal__button {
        font-size: 15px;
        padding: 14px 25px;
    }
}