.wc-digikala-search { position: relative; width: 100%; max-width: 560px; margin: 0 10px; }
.wc-digikala-search-input { width: 100%; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 2px; outline: none; transition: box-shadow .2s, border-color .2s; font-size: 14px; }
.wc-digikala-search-input:focus { border-color: #c7d2fe; box-shadow: 0 0 0 4px rgba(99,102,241,.12); }
.wc-digikala-search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.06); display: none; max-height: 440px; overflow-y: auto; z-index: 9999; }
.wc-digikala-search-results .result-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #f3f4f6; text-decoration: none; color: #111827; transition: background .15s; }
.wc-digikala-search-results .result-item:last-child { border-bottom: none; }
.wc-digikala-search-results .result-item:hover { background: #f9fafb; }
.wc-digikala-search-results .result-thumb { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid #f3f4f6; }
.wc-digikala-search-results .meta { display: grid; gap: 4px; }
.wc-digikala-search-results .title { font-size: 14px; line-height: 1.4; }
.wc-digikala-search-results .price { font-size: 13px; font-weight: 600; color: #d32f2f; }
.wc-digikala-search-results .no-result { padding: 12px; text-align: center; color: #6b7280; font-size: 13px; }
.section { border-bottom: 1px solid #f1f1f1; }
.section:last-child { border-bottom: none; }
.section-title { padding: 8px 12px; font-size: 13px; font-weight: bold; color: #555; background: #f9f9f9; }
.result-item.cat .title,
.result-item.brand .title { color: #1e40af; font-weight: 500; }
.structured-item { 
  padding: 8px 12px; 
  border-bottom: 1px solid #eee; 
  display: block; 
  text-decoration: none; 
}
.structured-item .label { font-weight: bold; color: #111; display:inline-block;}
.structured-item .context { font-size: 12px; color: #666; }

.keywords { 
  padding: 15px; 
  display: block; 
  gap: 10px; 
}
.keyword { 
  font-size: 18px; 
  color: #ddd; 
  cursor: pointer; 
}
.keyword:hover { text-decoration: underline; }
.keywords a.keyword {
    font-size: 15px;
    color: #888;
    text-decoration: none;
    display: block;
    padding: 6px;
}
.keywords a.keyword:hover {
  text-decoration: underline;
}
/* استایل سرچ‌باکس با آیکون */

.structured-item .icon,
.keyword .icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  vertical-align: middle;
  background: url("data:image/svg+xml,%3Csvg fill='none' stroke='%23888' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

#wc-digikala-search input[type='text']{
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding-right: 35px;
    background: #f0f0f1;
}

.wc-digikala-search-input {
    width: 100%;
    padding: 12px 40px 12px 14px; /* جا برای ذره‌بین */
    border: 1px solid #e5e7eb;
    border-radius: 2px;
    outline: none;
    font-size: 14px;
}

.wc-digikala-search-input :focus {
    border-color: #c7d2fe;
    box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}

/* آیکون ذره‌بین سمت راست */
.wc-digikala-search::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg fill='none' stroke='%23666' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    pointer-events: none;
}

/* span موبایل */
#wc-digikala-search .custom-placeholder {
    display: none; /* default دسکتاپ مخفی */
}

/* موبایل */
@media (max-width: 768px) {
    #wc-digikala-search-input::placeholder { color: transparent; }
    #wc-digikala-search .custom-placeholder {
        display: flex;
        position: absolute;
        top: 50%;
        right: 35px; /* برای RTL راست یا چپ */
        transform: translateY(-50%);
        color: #888;
        align-items: center;
        font-size: 14px;
        pointer-events: none;
        z-index: 2;
    }
    #wc-digikala-search .custom-placeholder img {
        height: 25px;
        margin: 0 4px;
    }
        .wc-digikala-search-input::placeholder {
        color: transparent !important; /* متن placeholder مخفی بشه */
    }
    .wc-digikala-search .custom-placeholder {
        display: flex; /* پیش‌فرض تو موبایل نشون داده بشه */
    }
    .wc-digikala-search {margin: 0 auto; }
}
