/* ==========================================================================
   جستجوی آژاکس ووکامرس — دیزاین لوازم آرایشی
   رنگ اصلی: #750D24
   ========================================================================== */

:root {
    --wcas-primary: #750D24;
    --wcas-primary-soft: #f7ecef;
    --wcas-primary-hover: #5c0a1c;
    --wcas-text: #3a3a3a;
    --wcas-muted: #9a9a9a;
    --wcas-border: #efe7e9;
    --wcas-bg: #ffffff;
    --wcas-radius: 14px;
}

/* ظرف فرم باید نسبی باشه تا نتایج زیرش بیاد */
.wcas-form-wrap {
    position: relative;
}

/* ==== پنل نتایج ==== */
.wcas-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 99999;
    background: var(--wcas-bg);
    border: 1px solid var(--wcas-border);
    border-radius: var(--wcas-radius);
    box-shadow: 0 18px 50px rgba(117, 13, 36, 0.14), 0 4px 12px rgba(0,0,0,0.05);
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px 0;
    direction: rtl;
    text-align: right;
    animation: wcasFade 0.18s ease;
}

@keyframes wcasFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* اسکرول‌بار ظریف */
.wcas-results::-webkit-scrollbar { width: 6px; }
.wcas-results::-webkit-scrollbar-thumb {
    background: var(--wcas-primary);
    border-radius: 10px;
    opacity: 0.6;
}
.wcas-results::-webkit-scrollbar-track { background: transparent; }

/* ==== سکشن‌ها ==== */
.wcas-section {
    padding: 12px 18px;
    border-bottom: 1px solid var(--wcas-border);
}
.wcas-section:last-of-type {
    border-bottom: none;
}

.wcas-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--wcas-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.2px;
}
.wcas-section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 15px;
    background: var(--wcas-primary);
    border-radius: 3px;
}

/* ==== چیپ‌ها (برند و دسته) ==== */
.wcas-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wcas-chip {
    display: inline-block;
    padding: 7px 16px;
    font-size: 13px;
    color: var(--wcas-text) !important;
    background: #fff;
    border: 1px solid var(--wcas-border);
    border-radius: 30px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    line-height: 1.6;
    white-space: nowrap;
}
.wcas-chip:hover {
    background: var(--wcas-primary);
    border-color: var(--wcas-primary);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(117, 13, 36, 0.22);
}

/* ==== لیست محصولات ==== */
.wcas-product-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wcas-product {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 10px;
    border-radius: 12px;
    text-decoration: none !important;
    transition: background 0.18s ease;
}
.wcas-product:hover {
    background: var(--wcas-primary-soft);
}

.wcas-product-img {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    background: #faf6f7;
    border: 1px solid var(--wcas-border);
    display: flex;
    align-items: center;
    justify-content: center;
}
.wcas-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wcas-product-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wcas-product-title {
    font-size: 13.5px;
    color: var(--wcas-text);
    line-height: 1.7;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.18s ease;
}
.wcas-product:hover .wcas-product-title {
    color: var(--wcas-primary);
}

.wcas-product-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--wcas-primary);
}
.wcas-product-price del {
    color: var(--wcas-muted);
    font-weight: 400;
    font-size: 11.5px;
    margin-left: 6px;
}
.wcas-product-price ins {
    text-decoration: none;
}

/* ==== لینک مشاهده همه ==== */
.wcas-view-all {
    display: block;
    text-align: center;
    padding: 13px;
    margin: 6px 14px 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: #fff !important;
    background: var(--wcas-primary);
    border-radius: 10px;
    text-decoration: none !important;
    transition: background 0.2s ease;
}
.wcas-view-all:hover {
    background: var(--wcas-primary-hover);
}

/* ==== حالت‌های خالی و لودینگ ==== */
.wcas-loading,
.wcas-empty {
    padding: 26px 18px;
    text-align: center;
    color: var(--wcas-muted);
    font-size: 13.5px;
}

.wcas-loading::before {
    content: '';
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-left: 8px;
    border: 2px solid var(--wcas-border);
    border-top-color: var(--wcas-primary);
    border-radius: 50%;
    vertical-align: middle;
    animation: wcasSpin 0.7s linear infinite;
}
@keyframes wcasSpin {
    to { transform: rotate(360deg); }
}

/* ==== ریسپانسیو ==== */
@media (max-width: 768px) {
    .wcas-results {
        max-height: 65vh;
    }
    .wcas-product-img {
        width: 46px;
        height: 46px;
    }
    .wcas-product-title {
        font-size: 13px;
    }
    .wcas-chip {
        padding: 6px 13px;
        font-size: 12.5px;
    }
}
