/* Trendium Plus — Search Popup */

.tpsp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 99998;
    display: none;
    direction: rtl;
}
.tpsp-overlay.is-open { display: block; }

.tpsp-panel {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: min(960px, 94%);
    background: #fff;
    border: 2px solid #f97316;
    border-radius: 14px;
    padding: 18px 20px 22px;
    box-shadow: 0 18px 40px rgba(0,0,0,.18);
    direction: rtl;
    font-family: inherit;
    max-height: calc(100vh - 100px);
    overflow: auto;
}

/* Search input */
.tpsp-search {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #ffd9b8;
    padding-bottom: 14px;
    margin-bottom: 16px;
}
.tpsp-search__input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px;
    text-align: right;
    color: #222;
    padding: 6px 4px;
}
.tpsp-search__input::placeholder { color: #b9b9b9; }
.tpsp-search__icon {
    background: transparent;
    border: 0;
    color: #f97316;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
}

/* Section heads */
.tpsp-section { margin-top: 14px; }
.tpsp-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.tpsp-section__title {
    font-size: 16px;
    font-weight: 700;
    color: #1f1f1f;
}
.tpsp-view-all {
    font-size: 13px;
    color: #f97316;
    text-decoration: none;
    font-weight: 600;
}
.tpsp-view-all:hover { text-decoration: underline; }

/* Tags */
.tpsp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: right;
}
.tpsp-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 8px 10px;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    background: #fff;
    color: #333;
    font-size: 13px;
    text-decoration: none;
    transition: .15s;
    white-space: nowrap;
}
.tpsp-tag:hover {
    border-color: #f97316;
    color: #f97316;
}
.tpsp-tag__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f3f3f3;
    color: #888;
    font-size: 14px;
    line-height: 1;
}
.tpsp-tag__remove:hover {
    background: #f97316;
    color: #fff;
}
.tpsp-tags__empty {
    color: #999;
    font-size: 13px;
}

/* Products carousel */
.tpsp-products-wrap {
    position: relative;
}
.tpsp-products {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 4px 2px 8px;
    scrollbar-width: none;
}
.tpsp-products::-webkit-scrollbar { display: none; }

.tpsp-product {
    flex: 0 0 220px;
    border: 1px solid #ececec;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: .15s;
}
.tpsp-product:hover {
    border-color: #f97316;
    box-shadow: 0 6px 16px rgba(249,115,22,.12);
}
.tpsp-product__body {
    display: flex;
    gap: 10px;
    padding: 10px;
    align-items: flex-start;
}
.tpsp-product__info {
    flex: 1;
    min-width: 0;
    text-align: right;
}
.tpsp-product__name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tpsp-product__price {
    font-size: 14px;
    color: #f97316;
    font-weight: 700;
}
.tpsp-product__price del { color: #aaa; font-weight: 400; font-size: 12px; margin-inline-start: 4px; }
.tpsp-product__img {
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tpsp-product__img img { width: 100%; height: 100%; object-fit: contain; }
.tpsp-product__badge {
    background: #2b2b2b;
    color: #fff;
    text-align: center;
    font-size: 12px;
    padding: 6px 8px;
    margin-top: auto;
}

/* Arrows */
.tpsp-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ececec;
    color: #f97316;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,.08);
    z-index: 2;
    display: none;
}
.tpsp-arrow--prev { left: -6px; }
.tpsp-products-wrap.has-overflow .tpsp-arrow { display: block; }

/* Mobile */
@media (max-width: 600px) {
    .tpsp-panel { top: 56px; padding: 14px; border-radius: 10px; }
    .tpsp-product { flex-basis: 200px; }
}
