:root {
    --search-width: 100%;
    --search-margin-top: 0px;
    --search-margin-bottom: 0px;
    --search-input-padding-y: 12px;
    --search-input-padding-x: 15px;
}

/*
==========================================================================
    Anewbd Live Product Search - Professional & User-Friendly Styles
==========================================================================
*/

.anewbd-live-search-wrapper {
    position: relative;
    max-width: var(--search-width);
    margin: var(--search-margin-top) auto var(--search-margin-bottom) auto;
    font-family: Arial, sans-serif;

}

.anewbd-search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.anewbd-search-input-container:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.anewbd-search-input-container:focus-within {
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.3);
    border-color: #27ae60;
}

/* ক্যাটাগরি আইকন এবং ড্রপডাউন বাটনের স্টাইল */
.anewbd-category-dropdown {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.anewbd-category-dropdown:hover {
    background-color: #e9ecef;
}

.anewbd-category-dropdown i {
    font-size: 18px;
    color: #555;
}

.anewbd-category-dropdown span {
    display: none;
}

#anewbd-live-search-input {
    flex-grow: 1;
    padding: var(--search-input-padding-y) var(--search-input-padding-x);
    border: none;
    outline: none;
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background-color: transparent;
}

/* সার্চ আইকন এবং ক্লিয়ার আইকনের স্টাইল */
.anewbd-search-icon, .anewbd-clear-icon {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50px;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    
    background-color: #f3f3f3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.anewbd-search-icon:hover {
    background-color: #229954;
}

.anewbd-clear-icon {
    font-size: 24px;
    
    background-color: #e74c3c;
    color: #ffffff;
    
    display: flex;
    align-items: center;
    justify-content: center;
}

/* সার্চ লোডার */
.anewbd-search-loader {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #27ae60;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* সার্চ রেজাল্ট কন্টেইনার */
.anewbd-search-results-container {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    z-index: 99;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.anewbd-no-results {
    padding: 15px;
    text-align: center;
    color: #888;
    font-style: italic;
    border-bottom: none !important;
}

/* সার্চ রেজাল্ট আইটেম */
.anewbd-search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

.anewbd-search-result-item:hover {
    background-color: #f8f8f8;
}

.anewbd-search-result-image img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    margin-right: 15px;
}

.anewbd-search-result-title {
    font-size: 16px;
    font-weight: 600;
    color: #101828;
}

.anewbd-search-result-price {
    font-size: 15px;
    font-weight: 700;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* রেগুলার প্রাইসের স্টাইল (হালকা রঙ ও ছোট ফন্ট) */
.anewbd-search-result-price del {
    font-size: 13px;
    font-weight: 500;
    color: #95a5a6;
}

/* সেল প্রাইসের স্টাইল (ফোকাসড এবং গাঢ় রঙ) */
.anewbd-search-result-price ins {
    font-size: 16px;
    color: #c0392b;
    text-decoration: none;
}

/* লাইভ সার্চ রেজাল্টে 'সাশ্রয়' এর পরিমাণ এর স্টাইল */
.anewbd-search-result-info {
    position: relative;
    padding-bottom: 20px;
}

.anewbd-search-result-price {
    margin-bottom: 5px;
}

.anewbd-search-result-info .saved-amount-container {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    font-size: 13px;
    font-weight: 600;
    color: #27ae60;
}

/* ক্যাটাগরি ড্রপডাউন মেনু */
.anewbd-category-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    z-index: 100;
    width: 300px;
    max-height: 250px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 0;
    list-style: none;
}

.anewbd-category-menu li {
    display: block;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}
.anewbd-category-menu li:last-child {
    border-bottom: none;
}

.anewbd-category-menu li:hover {
    background-color: #f3f3f3;
}

/* ক্যাটাগরি আইটেমের কন্টেন্ট: ছবি, নাম ও পণ্যের সংখ্যা */
.anewbd-category-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
}

.anewbd-category-image {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    object-fit: contain;
}
.anewbd-category-name {
    flex-grow: 1;
    font-weight: 600;
}
.anewbd-category-placeholder-image {
    width: 30px;
    height: 30px;
    margin-right: 10px;
}

/* পণ্যের সংখ্যা স্টাইল */
.anewbd-category-count {
    display: flex;
    align-items: center;
    background-color: transparent;
    color: #495057;
    font-size: 13px;
    font-weight: 500;
    padding: 0;
    border-radius: 0;
    white-space: nowrap;
    gap: 5px;
    padding-left: 0;
}

/* শুধুমাত্র সংখ্যাটির স্টাইল */
.anewbd-count-number {
    background-color: #27ae60;
    color: #ffffff;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 5px;
}


/*
==========================================================================
   লাইভ সার্চ রেজাল্ট আইটেমের লেআউট ফিক্স
==========================================================================
*/
.anewbd-search-result-item {
    display: flex; /* আইটেম দুটিকে পাশাপাশি রাখার জন্য */
    align-items: flex-start; /* আইটেমগুলোকে উপরে অ্যালাইন করা */
    gap: 15px; /* ছবি ও তথ্যের মধ্যে দূরত্ব */
}

.anewbd-search-result-info {
    flex: 1; /* এটিই মূল পরিবর্তন, যা বাকি জায়গাটি দখল করে */
    min-width: 0; /* অতিরিক্ত কন্টেন্ট থাকা সত্ত্বেও কন্টেইনার যেন স্বাভাবিক থাকে */
    display: flex;
    flex-direction: column;
}




/*
==========================================================================
    মোবাইল রেসপন্সিভ ডিজাইন
==========================================================================
*/
@media (max-width: 768px) {
    .anewbd-live-search-wrapper {
        max-width: 95%; /* মোবাইলের জন্য প্রস্থ কমিয়ে আনা হলো */
        margin: 10px auto;
    }

    .anewbd-search-input-container {
        height: 40px; /* ইনপুট ফিল্ডের উচ্চতা কমানো হলো */
    }

    #anewbd-live-search-input {
        padding: 8px 10px; /* ইনপুট প্যাডিং কমানো হলো */
        font-size: 14px;
    }

    .anewbd-search-icon, .anewbd-clear-icon {
        width: 40px; /* আইকনের প্রস্থ কমানো হলো */
        font-size: 16px;
    }
    
    .anewbd-search-loader {
        right: 10px; /* লোডারের অবস্থান ঠিক করা হলো */
    }

    .anewbd-category-dropdown {
        width: 40px;
        height: 40px;
    }

    .anewbd-category-dropdown i {
        font-size: 16px;
    }
    
    .anewbd-search-result-item {
        padding: 8px 10px;
    }
    
    .anewbd-search-result-image img {
        width: 50px;
        height: 50px;
    }

    .anewbd-search-result-title {
        font-size: 14px;
    }
    
    .anewbd-search-result-price {
        font-size: 14px;
    }
    
    .anewbd-search-result-info .saved-amount-container {
        font-size: 12px;
    }
}


/* ==========================================================================
   Live Search - Smart List-Style Category Menu
   ========================================================================== */

/* ক্যাটাগরি মেনুর মূল কন্টেইনার */
.anewbd-category-menu {
    position: absolute;
    top: calc(100% + 0);
    left: 0;
    right: 0;
    z-index: 100;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    max-height: 300px; /* একটি নির্দিষ্ট উচ্চতা */
    overflow-y: auto; /* প্রয়োজনে ভার্টিকাল স্ক্রলবার দেখাবে */
    padding: 8px;
}

/* প্রতিটি ক্যাটাগরি আইটেমের স্টাইল */
.anewbd-category-menu li {
    list-style: none;
    cursor: pointer;
    border-bottom: none;
    border-radius: 6px; /* প্রতিটি আইটেমের জন্য বর্ডার রেডিয়াস */
    transition: background-color 0.2s ease;
}

.anewbd-category-menu li:not(:last-child) {
    margin-bottom: 4px; /* আইটেমগুলোর মধ্যে ফাঁকা জায়গা */
}

/* হোভার করলে সুন্দর ইফেক্ট */
.anewbd-category-menu li:hover {
    background-color: #f8f9fa;
}

/* আইটেমের ভেতরের কন্টেন্ট */
.anewbd-category-menu .anewbd-category-item-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 12px;
}

/* ক্যাটাগরি ইমেজ */
.anewbd-category-menu .anewbd-category-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: contain;
    background-color: #f1f3f5;
    padding: 4px;
}

/* ক্যাটাগরির নাম */
.anewbd-category-menu .anewbd-category-name {
    flex-grow: 1; /* বাকি জায়গা দখল করবে */
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

/* পণ্যের সংখ্যা (ব্যাজ স্টাইল) */
.anewbd-category-menu .anewbd-category-count .anewbd-count-number {
    background-color: #e9ecef;
    color: #495057;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 15px; /* ব্যাজের মতো দেখতে */
}


/* Placeholder Text Font Size Control */
.anewbd-live-search-input::placeholder {
  font-size: 11px; /* আপনার পছন্দমত সাইজ দিন, যেমন 14px */
  color: #999; /* চাইলে রঙও পরিবর্তন করতে পারেন */
}

/* বিভিন্ন ব্রাউজারের সাপোর্টের জন্য */
.anewbd-live-search-input::-webkit-input-placeholder { /* Chrome/Opera/Safari */
  font-size: 14px;
}
.anewbd-live-search-input::-moz-placeholder { /* Firefox 19+ */
  font-size: 14px;
}
.anewbd-live-search-input:-ms-input-placeholder { /* IE 10+ */
  font-size: 14px;
}
.anewbd-live-search-input:-moz-placeholder { /* Firefox 18- */
  font-size: 14px;
}
