/* ================== GENERAL STYLES ================== */
.awh-search-container {
    position: relative;
    width: 100%;
    font-family: inherit;
    direction: rtl;
    margin: 0 auto;
}

/* Updated Breakpoint: 1025px */
@media (min-width: 1025px) {
    .awh-search-container {
        max-width: 500px;
    }
}

.awh-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    padding: 5px;
    height: 50px;
    transition: all 0.3s ease;
}

.awh-search-input-wrapper:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.awh-search-input {
    width: 100%;
    padding: 0 15px 0 50px;
    border: none !important;
    background: transparent !important;
    height: 100%;
    font-size: 14px;
    font-family: inherit;
    text-align: right;
    color: #444;
    outline: none !important;
    font-weight: 500;
}

/* استایل دکمه نارنجی */
.awh-search-icon-wrapper {
    position: absolute;
    left: 5px;
    top: 5px;
    bottom: 5px;
    width: 42px;
    background: #fb743e;
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(251, 116, 62, 0.3);
}

.awh-search-icon-wrapper:hover {
    background: #e05d28;
    transform: scale(1.05);
}

/* ================== DESKTOP 3-COLUMN LAYOUT ================== */
@media (min-width: 1025px) {
    .awh-three-col-layout {
        display: flex;
        gap: 0;
        padding: 0;
        align-items: stretch;
        height: 55vh;
        max-height: 600px;
    }
    
    .awh-search-col-right {
        width: 25%;
        border-left: 1px solid #eee;
        padding: 20px;
        display: flex;
        flex-direction: column;
        background: #fdfdfd;
    }

    .awh-search-col-middle {
        width: 50%;
        padding: 20px;
        display: flex;
        flex-direction: column;
        background: #fff;
    }

    .awh-search-col-left {
        width: 25%;
        border-right: 1px solid #eee;
        padding: 20px;
        display: flex;
        flex-direction: column;
        background: #fafafa;
    }
    
    .awh-categories-list, 
    .awh-products-grid, 
    .awh-top-products-list {
        overflow-y: auto;
        flex-grow: 1;
        padding-left: 5px;
        scrollbar-width: thin;
    }

    .awh-col-title {
        font-size: 14px;
        font-weight: bold;
        color: #333;
        margin: 0 0 15px 0;
        padding-bottom: 10px;
        border-bottom: 2px solid #fb743e;
    }
    
    .awh-desktop-view .awh-tabs-row { display: none; }
}

/* ================== COMPONENTS ================== */

/* Category Filter Items (Desktop Sidebar) */
.awh-category-search-wrapper { margin-bottom: 10px; }
.awh-cat-search-input { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; outline: none; }
.awh-categories-list { display: flex; flex-direction: column; gap: 0; }
.awh-cat-item { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid #f9f9f9; cursor: pointer; }
.awh-cat-item:hover { background: #f9f9f9; }
.awh-cat-checkbox { margin-left: 10px; width: 16px; height: 16px; accent-color: #fb743e; cursor: pointer; }
.awh-cat-name { flex-grow: 1; font-size: 13px; color: #333; }
.awh-cat-count { font-size: 11px; background: #eee; padding: 2px 6px; border-radius: 10px; color: #666; }

/* Products Grid Items */
.awh-products-grid { display: flex; flex-direction: column; gap: 10px; }
.awh-product-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid #eee; border-radius: 8px; transition: 0.2s; cursor: pointer; background: #fff; }
.awh-product-item:hover { border-color: #fb743e; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.awh-product-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.awh-product-info { flex-grow: 1; }
.awh-product-title { font-size: 13px; font-weight: bold; margin: 0 0 5px 0; color: #333; line-height: 1.4; }
.awh-product-price { font-size: 13px; color: #fb743e; font-weight: bold; }
.awh-highlight { background: #fff3cd; padding: 0 2px; border-radius: 2px; }

/* Top Products Items */
.awh-top-item { display: flex; align-items: center; gap: 10px; padding: 8px; background: #fff; border: 1px solid #eee; border-radius: 6px; cursor: pointer; transition: 0.2s; margin-bottom: 8px; }
.awh-top-item:hover { border-color: #fb743e; background: #fdfdfd; }
.awh-top-item img { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; }
.awh-top-info { display: flex; flex-direction: column; gap: 2px; }
.awh-top-title { font-size: 12px; font-weight: bold; color: #333; line-height: 1.3; }
.awh-top-price { font-size: 11px; color: #fb743e; }

/* Footer Buttons */
.awh-footer-row {
    padding-top: 10px;
    border-top: 1px solid #eee;
    margin-top: auto;
    text-align: center;
}
.awh-view-all-btn {
    display: block;
    width: 100%;
    background: #fb743e;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 10px rgba(251, 116, 62, 0.2);
    transition: all 0.2s;
}
.awh-view-all-btn:hover { background: #e05d28; transform: translateY(-2px); }

/* --- SUGGESTED CATEGORIES UI IMPROVEMENTS (Chips) --- */
.awh-suggested-categories-row { margin-bottom: 15px; width: 100%; }
.awh-suggested-title { 
    font-size: 12px; color: #888; margin-bottom: 8px; display: block; 
}
.awh-suggested-categories-list { 
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; 
    scrollbar-width: none; /* فایرفاکس */
}
.awh-suggested-categories-list::-webkit-scrollbar { display: none; } /* کروم */

.awh-suggested-category-item { 
    display: inline-flex; 
    align-items: center; 
    gap: 6px;
    background: #fff; 
    border: 1px solid #e0e0e0;
    padding: 6px 12px; 
    border-radius: 50px; /* کپسولی */
    font-size: 13px; 
    color: #555;
    white-space: nowrap; 
    cursor: pointer; 
    transition: all 0.2s ease;
}

.awh-suggested-category-item i {
    font-size: 16px;
    color: #fb743e;
}

.awh-suggested-category-item:hover { 
    border-color: #fb743e; 
    color: #fb743e; 
    background: #fff8f5;
}

/* حالت فعال برای وقتی روی دسته کلیک شده */
.awh-suggested-category-item.active {
    background: #fb743e;
    color: #fff;
    border-color: #fb743e;
}
.awh-suggested-category-item.active i {
    color: #fff;
}

/* Loading & Empty */
.awh-search-placeholder-msg {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 20px; text-align: center; color: #777;
    min-height: 250px; width: 100%;
}
.awh-search-empty-state .awh-empty-icon { font-size: 60px; color: #e0e0e0; margin-bottom: 15px; }
.awh-search-empty-state h3 { font-size: 18px; margin: 0 0 10px 0; color: #555; }
.awh-search-empty-state p { font-size: 14px; margin: 0; color: #999; }
.awh-search-main-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.awh-spinner {
    width: 40px; height: 40px; border: 3px solid rgba(255, 107, 0, 0.2);
    border-radius: 50%; border-top-color: #ff6b00;
    animation: awh-spin 0.8s ease-in-out infinite; margin-bottom: 15px;
}
@keyframes awh-spin { to { transform: rotate(360deg); } }


/* ================== MOBILE SPECIFIC OVERRIDES (Max Width 1024px) ================== */
@media (max-width: 1024px) {
    #mob-slide-search .awh-search-container {
        height: 100%; display: flex; flex-direction: column; overflow: hidden;
    }

    #mob-slide-search .awh-search-input-wrapper {
        flex-shrink: 0; z-index: 10; background: #fff; padding: 10px;
        border-bottom: 1px solid #f0f0f0; margin: 0;
        border-radius: 0; box-shadow: none; height: auto;
    }
    
    #mob-slide-search .awh-search-icon-wrapper {
        position: relative; left: auto; top: auto; bottom: auto;
        width: 45px; height: 40px;
        background: #fb743e; border-radius: 8px;
    }
    
    #mob-slide-search .awh-search-input { padding: 0 10px; text-align: right; }

    /* FIX 1: حذف پدینگ بالا در موبایل */
    #mob-slide-search .awh-dropdown-content {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none;
        border: none;
        width: 100%;
        height: 100%;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        background: #f9f9f9;
        padding-top: 0 !important; /* درخواست کاربر */
    }

    .awh-tabs-row {
        display: flex; flex-shrink: 0; background: #fff;
        padding: 10px; border-bottom: 1px solid #eee; gap: 10px;
    }

    .awh-tab {
        flex: 1; text-align: center; padding: 8px; background: #f0f0f0;
        color: #666; border-radius: 6px; font-size: 13px; border: none; transition: 0.2s;
    }
    .awh-tab.active { background: #fb743e; color: #fff; font-weight: bold; }

    .awh-tab-content {
        display: none; flex-grow: 1; overflow-y: auto; padding: 10px;
        -webkit-overflow-scrolling: touch;
    }
    .awh-tab-content.active { display: block; }

    /* فوتر موبایل */
    #mob-slide-search .awh-footer-row {
        flex-shrink: 0; background: #fff; border-top: 1px solid #eee;
        padding: 15px; display: none; /* توسط JS نمایش داده می شود */
        gap: 10px; align-items: center; justify-content: space-between;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.03); margin-top: auto;
    }
    #mob-slide-search .awh-category-trigger {
        flex: 1; justify-content: center; background: #333; color: #fff; padding: 12px; border-radius: 8px;
    }
    #mob-slide-search .awh-view-all-btn { flex: 1; margin: 0; }

    /* ستون‌های دسکتاپ مخفی */
    .awh-search-col-left, .awh-search-col-middle, .awh-search-col-right { display: none; }
    .awh-three-col-layout { display: block; height: auto; }
    
    /* وسط چین شدن در موبایل */
    #mob-slide-search .awh-search-results-wrapper {
        display: flex; flex-direction: column; min-height: 300px;
    }
    #mob-slide-search .awh-search-placeholder-msg { flex-grow: 1; }
}