/* Custom Search Modal */
.search-icon-trigger img {
    cursor: pointer;
}

.search-icon-trigger:hover figure img {
    content: url('../../assets/images/heag-icon-search-hover.svg'); /* Replace with the path to the hover SVG */
    transition: content 0.3s ease; /* Optional smooth transition */
}

/* Modal Content */

/* Full-Screen Overlay */
/* Full-Screen Overlay */
.search-overlay {
    position: fixed;
    inset: 0; 
    width: 100vw; 
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    z-index: -1; /* Move behind everything when closed */
    background: rgba(0, 0, 0, 0.5);
    padding: 0 !important;
    visibility: hidden; /* Extra safety */
}

.search-overlay.open {
    opacity: 1;
    pointer-events: auto;
    background: rgba(255, 255, 255, 1);
    z-index: 9999; /* Only high z-index when open */
    visibility: visible;
}

/* Content Box */
.search-overlay-content {
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

/* Close Button */
.search-overlay-close {
    position: absolute;
    top: 60px;
    right: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

/* Show close button only when overlay is visible */
.search-overlay.open .search-overlay-close {
    opacity: 1;
    transition-delay: 0.1s;
}

.search-overlay-content-inside {
    flex: 1;
}


/* Search Form */
.search-form {
    position: relative;
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

.search-field {
	width: 100%;
    flex-grow: 1;
    padding: 20px 10px 0 10px;
    border-top: none;
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--wp--preset--color--schwarz);
    box-sizing: border-box;
    font-size: 1.25rem;
    font-family: var(--wp--preset--font-family--body);
    color: #000;
    background: transparent;
}

.search-form input#searchInput:focus-visible {
    outline: none;
}

#searchModal .search-form {
    border-bottom: 1px solid #000;
}

#searchModal .search-field {
    color: var(--wp--preset--color--schwarz);
}

.search-results-page .search-field {
    border-bottom: 1px solid var(--wp--preset--color--schwarz);
    color: var(--wp--preset--color--schwarz);
}

.search-field::placeholder {
    color: var(--wp--preset--color--schwarz);
}

.search-results-page .search-field::placeholder {
    color: var(--wp--preset--color--schwarz);
}

.search-modal-close svg {
    filter: invert(1) brightness(0) saturate(100%);
}


.search-submit {
    padding: 10px 0 0 10px;
    cursor: pointer;
    box-sizing: border-box;
    border: none;
    background: transparent;
    transition: transform 0.2s ease-in-out; /* Add transition for transform */
    position: absolute;
    right: 0;
}

.search-submit:hover {
    transform: scale(1.1); /* Scale the button on hover */
}

.search-submit svg {
    width: 100%; /* Ensure the SVG fills the button */
    height: auto; /* Maintain aspect ratio */
    width: 30px;
    height: 30px;
    padding-right: 5px;
}

.search-submit:hover svg {
    animation: bounce 0.5s infinite alternate; /* Example of animation */
}

@keyframes bounce {
    to {
        transform: scale(1.2); /* Adjust the scale for the bounce effect */
    }
}

/* Search Icon */
.search-submit .circle, .search-submit .line  {
    fill: none; 
    stroke: var(--wp--preset--color--schwarz);
}
  
#searchModal .search-submit .circle, #searchModal .search-submit .line {
    fill: none; 
    stroke: #fff; 
}

/* clears the ‘X’ from Internet Explorer */
input[type=search]::-ms-clear { display: none; width : 0; height: 0; }
input[type=search]::-ms-reveal { display: none; width : 0; height: 0; }
/* clears the ‘X’ from Chrome */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { display: none; }