/**
 * استایل پایه‌ی فرم [dadevarzan_live_search]
 *
 * همه چیز زیر .dvls-live-search اسکوپ شده و هیچ وابستگی به استایل‌های
 * .wpcas-area ندارد؛ بنابراین می‌توانید بدون ترس از تداخل، همه را بازنویسی کنید.
 */

.dvls-live-search {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* ---------- فرم ---------- */

.dvls-live-search .dvls-ls-form {
    display: flex;
    align-items: center;
    background: #f2f2f2;
    border-radius: 4px;
    overflow: hidden;
    height: 48px;
}

.dvls-live-search .dvls-ls-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 48px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
}

.dvls-live-search.dvls-loading .dvls-ls-icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round'><path d='M21 12a9 9 0 1 1-6.219-8.56'/></svg>");
    animation: dvls-spin 1s linear infinite;
}

@keyframes dvls-spin {
    100% {
        transform: rotate(360deg);
    }
}

.dvls-live-search .dvls-ls-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    line-height: 48px;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
    font-size: inherit;
    color: inherit;
}

.dvls-live-search .dvls-ls-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.dvls-live-search select {
    flex: 0 1 auto;
    width: auto;
    max-width: 160px;
    height: 48px;
    margin: 0;
    padding: 0 30px 0 12px;
    border: none;
    border-inline-start: 1px solid rgba(0, 0, 0, .08);
    outline: none;
    box-shadow: none;
    border-radius: 0;
    background-color: transparent;
    color: inherit;
    font-size: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-repeat: no-repeat;
    background-size: 18px 18px;
    background-position: calc(100% - 8px) 50%;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 0 24 24' width='24' fill='%23666'><path d='M7 10l5 5 5-5z'/></svg>");
}

.rtl .dvls-live-search select {
    padding: 0 12px 0 30px;
    background-position: 8px 50%;
}

/* ---------- ناحیه نتایج ---------- */

.dvls-live-search .dvls-ls-results {
    display: none;
    box-sizing: border-box;
    background: #ffffff;
    color: #222222;
    text-align: start;
}

.dvls-live-search.dvls-open .dvls-ls-results {
    display: block;
}

.dvls-live-search.dvls-layout-dropdown .dvls-ls-results {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline-start: 0;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 15px;
    border-radius: 4px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
    z-index: 9999;
}

.dvls-live-search.dvls-layout-inline .dvls-ls-results {
    margin-top: 10px;
}

/* ---------- آیتم محصول (خروجی WPC AJAX Search) ---------- */

.dvls-live-search .wpcas-product {
    display: block;
    border-bottom: 1px dashed #eee;
}

.dvls-live-search .wpcas-product:last-child {
    border-bottom: none;
}

.dvls-live-search .wpcas-product:hover {
    background-color: rgba(0, 0, 0, .025);
}

.dvls-live-search .wpcas-product-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 0;
    box-sizing: border-box;
}

.dvls-live-search .wpcas-product-thumb {
    flex: 0 0 64px;
    width: 64px;
}

.dvls-live-search .wpcas-product-thumb img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 4px;
}

.dvls-live-search .wpcas-product-info {
    flex: 1 1 auto;
    min-width: 0;
}

.dvls-live-search .wpcas-product-name a {
    text-decoration: none;
    color: inherit;
    font-size: 14px;
    line-height: 1.6;
}

.dvls-live-search .wpcas-product-name a:hover {
    text-decoration: underline;
}

.dvls-live-search .wpcas-product-price {
    font-size: 13px;
    opacity: .85;
    margin-top: 4px;
}

.dvls-live-search .wpcas-product-price del {
    opacity: .6;
    margin-inline-end: 5px;
}

.dvls-live-search .wpcas-product-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dvls-live-search .wpcas-not-found {
    padding: 15px 0;
    font-size: 14px;
    text-align: center;
    opacity: .8;
}

.dvls-live-search .wpcas-more-results {
    text-align: center;
    border-top: 1px solid #eee;
}

.dvls-live-search .wpcas-more-results-inner {
    padding: 10px 0;
}

.dvls-live-search .wpcas-more-results a {
    text-decoration: none;
    font-size: 14px;
}

/* ---------- موبایل ---------- */

@media (max-width: 767px) {
    .dvls-live-search select {
        max-width: 100px;
        font-size: 13px;
        padding-inline-start: 8px;
    }

    .dvls-live-search .wpcas-product-thumb {
        flex: 0 0 52px;
        width: 52px;
    }
}
