:root {
    --bg-blur: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.2);
    --corner-size: 16px;
}

.search{
    padding: 1em;
    position: absolute;
    width: 70%;
    bottom: 20%;
    right: 1%;

    min-width: 800px;
    max-width: 1000px;

    display: flex;

}

.search .input-wrapper{
    position: relative;

    margin: 1em;
    aspect-ratio: 2 / 1;
    flex: 1;

}

.input-wrapper input{
    padding: 1em;
    border-radius: var(--corner-size);
    width: 100%;
    height: 100%;

    border: none;
    box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.3);
    background-color: var(--bg-blur);
    backdrop-filter: blur(5px);

    font-size: 1.1em;
}

.input-icon {
    position: absolute;
    top: calc(var(--corner-size) / 2);
    right: calc(var(--corner-size) / 2);
    transform: translate(80%, -130%);
    width: 35px;
    height: 35px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 2;
    overflow: hidden;
    padding: 6px;
}

.input-icon img {
    width: 100%;
}

.input-wrapper input[type='date'] {
    text-align: center;
}


/* Анимированная кнопка поиска */


.button-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}

.wave-btn {
    position: absolute;
    width: 100%;
    height: 100%;
}

.wave-btn path {
    fill: #8DB1D9;
    filter: blur(1px);
}

.btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    border-radius: 50%;
    border: none;
    background: #8DB1D9;
    cursor: pointer;
}

.btn img {
    width: 70%;
    object-fit: cover;
    user-select: none;
}

/* Анимации наведения на кнопку */

.button-wrapper:hover .wave-btn path {
    fill: #B59C98;
}

.button-wrapper:hover .btn {
    background: #B59C98;
}

.btn:active {
    background: #91657E !important;
}

.button-wrapper:has(.btn:active) .wave-btn path {
    fill: #91657E;
}

/*.flatpickr-day.selected {*/
/*    background: #91657E !important;*/
/*    border-color: #91657E !important;*/
/*}*/

/* Оригинальные стили кнопок поиска для мобильных */
@media (max-width: 768px) {
    .hero_search {
        width: 100%;
        padding: 0;
        position: relative;
        z-index: 2;
    }

    .search {
        position: relative;
        width: 100%;
        min-width: auto;
        flex-direction: column;
        padding: 0;
        gap: 15px;
    }

    .search .input-wrapper {
        margin: 0;
        aspect-ratio: auto;
        height: 60px;
        position: relative;
        width: 100%;
    }

    .input-wrapper input {
        padding: 1em;
        border-radius: var(--corner-size);
        width: 100%;
        height: 100%;
        border: none;
        box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.3);
        background-color: var(--bg-blur);
        backdrop-filter: blur(5px);
        font-size: 1.1em;
        color: #333;
    }

    .input-wrapper input::placeholder {
        color: #666;
    }

    .input-icon {
        position: absolute;
        top: calc(var(--corner-size) / 2);
        right: calc(var(--corner-size) / 2);
        transform: translate(80%, -50%);
        width: 35px;
        height: 35px;
        background: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        cursor: pointer;
        z-index: 2;
        overflow: hidden;
        padding: 6px;
    }

    .input-icon img {
        width: 100%;
    }

    .button-wrapper {
        position: relative;
        width: 130px;
        height: 130px;
        margin: 20px auto 0;
    }

    .wave-btn {
        position: absolute;
        width: 100%;
        height: 100%;
    }

    .wave-btn path {
        fill: #8DB1D9;
        filter: blur(1px);
    }

    .btn {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 60%;
        height: 60%;
        border-radius: 50%;
        border: none;
        background: #8DB1D9;
        cursor: pointer;
    }

    .btn img {
        width: 70%;
        object-fit: cover;
        user-select: none;
    }

    .button-wrapper:hover .wave-btn path {
        fill: #B59C98;
    }

    .button-wrapper:hover .btn {
        background: #B59C98;
    }

    .btn:active {
        background: #91657E !important;
    }

    .button-wrapper:has(.btn:active) .wave-btn path {
        fill: #91657E;
    }

    .autocomplete {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(5px);
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 16px;
        padding: 0.7em;
        margin-top: 0.3em;
        box-shadow: 3px 3px 15px rgba(0, 0, 0, 0.3);
    }

    .autocomplete > div {
        color: #333;
        border-bottom: 1px solid #9e9e9e;
        padding: 0.7em;
        text-align: center;
    }

    .autocomplete > div:hover {
        filter: brightness(0.9);
    }
}

/* Анимированные ошибки валидации */
@property --draw {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.input-wrapper.has-error {
    overflow: visible;
}

.input-wrapper.has-error::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--corner-size);
    background: conic-gradient(from 180deg, #e74c3c var(--draw), transparent var(--draw));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    padding: 2px;
    pointer-events: none;
    z-index: 1;
    animation: draw-border 1.2s cubic-bezier(.65, 0, .35, 1) forwards;
}

@keyframes draw-border {
    to { --draw: 360deg; }
}

.input-wrapper .field-error {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    font-size: 11px;
    color: #e74c3c;
    white-space: nowrap;
    opacity: 0;
    animation: err-txt .25s .45s ease forwards;
    z-index: 3;
    pointer-events: none;
}

@keyframes err-txt {
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
