/* Search Style */
.wpl-search-icon {
    background: none;
    border: none;
    cursor: pointer;
    line-height: 0;
    padding: 0;
}

.wpl-search-modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    -webkit-transform: translateY(-100%);
    transform: translateY(-100%);
    -webkit-transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.wpl-search-modal.wpl-search-modal-open {
    pointer-events: painted;
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
}

.wpl-search-modal-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    background-color: #fff;
    margin: 0;
    padding: clamp(1.5625rem, 1.2019rem + 1.6026vw, 3.125rem); /* 50px */
    border-radius: 0;
    width: 100%;
    max-width: 100%;
    position: relative;
    -webkit-transition: transform 0.3s ease-out;
    transition: transform 0.3s ease-out;
    height: 250px;
}

.wpl-search-modal-content .wpl-search-modal-header {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 30px;
    align-items: center;
    gap: 20px;
}

.wpl-search-modal-content .wpl-search-modal-body .search-by-category {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.wpl-search-modal-content .wpl-search-modal-body .search-by-category .category-list {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.wpl-search-modal-close {
    position: relative;
    width: 30px;
    height: 30px;
    font-size: 0;
    color: black;
    cursor: pointer;
}

body:has(.wpl-search-modal):after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    -webkit-transition: all 0.3s ease-out;
    transition: all 0.3s ease-out;
    pointer-events: none;
}
body:has(.wpl-search-modal.wpl-search-modal-open):after {
    opacity: 1;
}
body:has(.wpl-search-modal.wpl-search-modal-open) {
    overflow: hidden;
}

.wpl-search-modal-close:hover {
    color: #000;
}

body.modal-open {
    overflow: hidden; /* Prevent scrolling when modal is open */
}

.wpl-search-modal-close:before,
.wpl-search-modal-close:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    height: 30px;
    width: 2px;
    background-color: currentColor;
    margin: auto;
    transition: all 0.3s ease-out;
}

.wpl-search-modal-close:before {
    transform: rotate(-45deg);
}

.wpl-search-modal-close:after {
    transform: rotate(45deg);
}

.wpl-search-modal-close:hover:before {
    transform: rotate(45deg);
}

.wpl-search-modal-close:hover:after {
    transform: rotate(-45deg);
}

.elementor-widget-container:has(.wpl-search-icon) {
    line-height: 0;
}

/* ---------------------------------------------------------------------------------------------- */
.wpl-search-widget {
    position: relative;
    max-width: 100%;
}

.ajax-search-input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: var(--primaryfont);
}

.ajax-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Style for each result item */
.ajax-search-results li {
    display: flex;
    align-items: center;
    padding: 10px clamp(1.5625rem, 1.2019rem + 1.6026vw, 3.125rem); /* 50px */
    border-bottom: 1px solid #ddd;
}

/* Hover effect for result items */
.ajax-search-results li:hover {
    background: #f0f0f0;
}

/* Style for links inside results */
.ajax-search-results li a {
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    width: 100%;
    line-height: 1;
}

/* Image styling for products */
.ajax-search-results li.product a img {
    margin-right: 10px;
    border-radius: 5px;
    object-fit: cover;
    width: 50px;
    height: 50px;
    display: block;
}

/* Specific styling for product results */
.ajax-search-results li.product a {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.ajax-search-results li.product a > span:last-child {
    text-align: right;
}

.ajax-search-results li.product a > span {
    font-size: clamp(0.75rem, 0.6923rem + 0.2564vw, 1rem); /* 16px */
}

/* Styling for post excerpt */
.ajax-search-results li.post a small {
    color: #666;
    font-size: 0.9em;
}

/* Type 2 ---------------------------------------------------------------------------------------------- */
.wpl-search-normal .wpl-search-widget {
    position: relative;
}

.wpl-search-normal .wpl-search-widget .wpl-search {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    margin: 0;
    border: 0;
    background-color: transparent;
    font-size: 20px;
    line-height: 0;
    padding: 0 20px;
    color: var(--secondarycolor);
    pointer-events: none;
}

.wpl-search-normal .wpl-search-widget input {
    padding: 10px 60px 10px 20px;
    border-radius: 16px;
    background: rgba(12, 47, 55, 0.1);
    border: 2px solid rgba(12, 47, 55, 0.2);
}

.ajax-search-results:empty {
    border: 0;
}

.wpl-search-normal .ajax-search-results li {
    padding: 10px 20px;
}