/* ==============================================
   ADVANCED WOO SEARCH — КАСТОМНЫЕ СТИЛИ
   ============================================== */

/* ----- 1. ОБЩИЕ СТИЛИ ДЛЯ AWS (везде) ----- */
.aws-container .aws-search-form {
    display: flex !important;
    align-items: center !important;
    background: var(--global-palette9, #FFFFFF) !important;
    border: 1px solid var(--global-palette7, #d5dce4) !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.aws-container .aws-search-form .aws-search-field {
    flex: 1 !important;
    border: none !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    color: var(--global-palette3, #052f44) !important;
    background: transparent !important;
    outline: none !important;
    width: 100% !important;
    height: auto !important;
    line-height: 1.4 !important;
}

.aws-container .aws-search-form .aws-search-field::placeholder {
    color: var(--global-palette5, #3d5e81) !important;
    font-weight: 400 !important;
}

.aws-container .aws-search-form .aws-search-btn {
    background: var(--global-palette1, #1a252e) !important;
    border: 1px solid var(--global-palette1, #1a252e) !important;
    padding: 0 12px !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    height: 100% !important;
    min-height: 38px !important;
    border-radius: 0 !important;
    width: 40px !important;
}

.aws-container .aws-search-form .aws-search-btn:hover {
    background: var(--global-palette10, #ff4500) !important;
    border: 1px solid var(--global-palette10, #ff4500) !important;
}

.aws-container .aws-search-form .aws-search-btn svg {
    fill: var(--global-palette9, #FFFFFF) !important;
    width: 24px !important;
    height: 24px !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.aws-container .aws-search-form .aws-search-btn_icon {
    width: 20px !important;
}

/* ----- 2. ПОИСК В ХЕДЕРЕ — КНОПКА С ЛУПОЙ + ВЫПАДАШКА ----- */
.ddd-search-trigger-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.ddd-search-toggle {
    background: rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    cursor: pointer;
    padding: 6px 16px 6px 12px !important;
    margin-top: 0;
    color: var(--global-palette1, #1a252e);
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px !important;
    width: auto !important;
    height: auto !important;
    align-self: center;
    border-radius: 0 !important;
}

.ddd-search-toggle:hover {
    background: var(--global-palette10, #ff4500) !important;
    color: var(--global-palette9, #FFFFFF) !important;
    border-color: var(--global-palette10, #ff4500) !important;
}

.ddd-search-toggle:focus {
    outline: 2px solid var(--global-palette1, #1a252e);
    outline-offset: 2px;
    background: var(--global-palette14, #3BAD0C);
    color: var(--global-palette9, #FFFFFF);
    border-color: var(--global-palette1, #1a252e);
}

/* Скрываем старую SVG-лупу */
.ddd-search-toggle svg {
    display: none !important;
}

/* Вставляем новую SVG-лупу через ::before */
.ddd-search-toggle::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

/* Текст "Пошук" */
.ddd-search-toggle::after {
    content: "Пошук";
    font-size: 14px;
    font-weight: 500;
    color: var(--global-palette9, #ffffff) !important;
    transition: color 0.2s ease;
}

.ddd-search-toggle:hover::after {
    color: var(--global-palette9, #ffffff) !important;
}

.ddd-search-toggle:hover::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
}

.ddd-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: var(--global-palette2, #4abc1a);
    border: none;
    border-radius: 0 !important;
    padding: 12px 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 9999;
    box-sizing: border-box;
}

.ddd-search-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ddd-search-dropdown .aws-container .aws-search-form {
    border-color: var(--global-palette9, #FFFFFF) !important;
}

.ddd-search-dropdown .aws-container .aws-search-form .aws-search-btn {
    min-height: 40px !important;
    padding: 0 16px !important;
}

.ddd-search-dropdown .aws-container .aws-search-form .aws-search-btn svg {
    width: 28px !important;
    height: 28px !important;
}

/* Отступ справа от кнопки поиска (для корзины) */
.ddd-search-trigger-wrapper {
    margin-right: 8px !important;
}

/* ----- 3. AWS В МОБИЛЬНОМ ДРОВЕРЕ ----- */
.ddd-mobile-search-wrapper .aws-container .aws-search-form {
    border-color: var(--global-palette6, #5d7b9d) !important;
}

.ddd-mobile-search-wrapper .aws-container .aws-search-form .aws-search-field {
    padding: 10px 14px !important;
    font-size: 15px !important;
}

.ddd-mobile-search-wrapper .aws-container .aws-search-form .aws-search-btn {
    min-height: 44px !important;
    padding: 0 18px !important;
}

.ddd-mobile-search-wrapper .aws-container .aws-search-form .aws-search-btn svg {
    width: 26px !important;
    height: 26px !important;
}

/* ----- 4. AWS В ВИДЖЕТАХ / САЙДБАРЕ ----- */
.widget .aws-container .aws-search-form {
    border-color: var(--global-palette7, #d5dce4) !important;
}

.widget .aws-container .aws-search-form .aws-search-field {
    padding: 8px 12px !important;
    font-size: 14px !important;
}

.widget .aws-container .aws-search-form .aws-search-btn {
    min-height: 36px !important;
    padding: 0 14px !important;
}

.widget .aws-container .aws-search-form .aws-search-btn svg {
    width: 24px !important;
    height: 24px !important;
}

/* ----- 5. СКРЫВАЕМ ДЕСКТОПНУЮ КНОПКУ НА МОБИЛКАХ И ПЛАНШЕТАХ ----- */
@media (max-width: 1023px) {
    .ddd-search-trigger-wrapper {
        display: none !important;
    }
}

/* ----- 6. АДАПТИВ ----- */
@media (max-width: 768px) {
    .aws-container .aws-search-form .aws-search-field {
        font-size: 13px !important;
        padding: 6px 10px !important;
    }

    .aws-container .aws-search-form .aws-search-btn {
        min-height: 34px !important;
        padding: 0 12px !important;
    }

    .aws-container .aws-search-form .aws-search-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
}

@media (max-width: 480px) {
    .ddd-search-dropdown {
        width: 280px;
        right: -10px;
        padding: 10px 12px;
    }
}

/* ----- 7. АДАПТИВ для 404 ----- */
@media (max-width: 1024px) {
    #incontent .aws-container .aws-search-form .aws-search-field {
        font-size: 20px !important;
        padding: 15px !important;
    }

    #incontent .aws-container .aws-search-form .aws-search-btn {
        min-height: 40px !important;
        padding: 0 15px !important;
    }

    #incontent .aws-container .aws-search-form .aws-search-btn svg {
        width: 25px !important;
        height: 25px !important;
    }
}

/* ==============================================
   ПОИСК НА ПЛАНШЕТАХ — БЕЛЫЙ ФОН (как корзина)
   ============================================== */

@media (max-width: 1199px) and (min-width: 1024px) {
    .ddd-search-toggle {
        background: var(--global-palette9, #ffffff) !important;
        padding: 6px 10px !important;
        border-radius: 4px !important;
        width: auto !important;
        justify-content: center !important;
        gap: 0 !important;
        transition: background 0.25s ease !important;
    }

    .ddd-search-toggle::after {
        content: "" !important;
        display: none !important;
    }

    .ddd-search-toggle::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23052f44'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") !important;
    }

    .ddd-search-toggle:hover {
        background: var(--global-palette10, #ff4500) !important;
    }

    .ddd-search-toggle:hover::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") !important;
    }
}