#rp-search-overlay {
    position: fixed;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 99990;
    display: none;
    cursor: pointer;
    backdrop-filter: blur(2px);
}
#woocommerce-product-search-field-0, 
#woocommerce-product-search-field-1 {
    color: #007bff !important;
    font-weight: 700 !important;
}
.rp-highlight {
    color: #007bff;
    font-weight: 700;
    background: 0 0;
}
#rp-global-results-container {
    position: fixed;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 999999;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    border-top: 1px solid #eee;
    display: none;
    box-sizing: border-box!important;
    margin: 0!important;
    padding: 0!important;
}
.rp-layout-container {
    display: flex;
    height: 100%;
    min-height: 350px;
    position: relative;
    padding: 0;
    margin: 0 auto;
    box-sizing: border-box!important;
    background: #fff;
}
.rp-sidebar {
    width: 140px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 25px 10px;
    background: #fff;
    border-right: 1px solid #f1f1f1;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}
.rp-tab-btn {
    padding: 10px;
    width: 100%;
    cursor: pointer;
    font-weight: 700;
    color: #444;
    font-size: 13px;
    transition: all .2s ease;
    border-radius: 5px;
    text-align: center;
    background-color: #f7f7f7;
    border: 1px solid #eee;
    box-sizing: border-box;
}
.rp-tab-btn:hover {
    background-color: #e2e6ea;
    color: #000;
}
.rp-tab-btn.active {
    background-color: #446084;
    color: #fff;
    border-color: #446084;
    box-shadow: 0 3px 6px rgba(68,96,132,.3);
}
.rp-content {
    flex-grow: 1;
    padding: 25px 30px;
    overflow-y: auto;
    max-height: 70vh;
    background: #fff;
    position: relative;
    min-height: 300px;
}
.rp-content-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #f1f1f1;
    padding-bottom: 10px;
    display: inline-block;
}
.rp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(180px,1fr));
    gap: 15px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.rp-item {
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 35px;
    overflow: hidden;
    box-sizing: border-box;
    transition: transform .2s,box-shadow .2s;
}
.rp-link {
    text-decoration: none;
    color: inherit;
    padding: 15px;
    display: block;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}
.rp-img-wrapper {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.rp-img-wrapper img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}
.rp-no-img {
    font-size: 40px;
    color: #eee;
}
.rp-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 5px;
}
.rp-price {
    font-size: 15px;
    font-weight: 700;
    color: #2b9504;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.rp-price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 12px;
}
.rp-price-new {
    color: #d32f2f;
}
.rp-post-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
    font-weight: 600;
}
.rp-add-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #007a33;
    color: #fff!important;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    transition: background-color .2s;
}
.rp-read-btn {
    background-color: #446084;
}
.rp-sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #d32f2f;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    z-index: 2;
}
.rp-no-results {
    text-align: center;
    padding: 40px;
    color: #777;
    font-size: 14px;
}
.rp-sub-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 0;
}
.rp-sub-tab-item {
    cursor: pointer;
    padding-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}
.rp-sub-tab-item:hover {
    color: #555;
}
.rp-sub-tab-item.active {
    color: #333;
    border-bottom-color: #007cba;
}
.rp-item-post .rp-img-wrapper {
    height: 100px!important;
    margin-bottom: 24px;
}
.rp-item-post .rp-desc-preview {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
    height: 32px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 10px;
}
.rp-tax-card {
    background-color: #446084;
    color: #fff!important;
    border-color: #446084;
    justify-content: center;
    text-align: center;
}
.rp-tax-card a {
    color: #fff!important;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    align-items: center;
}
.rp-tax-icon {
    font-size: 40px;
    margin-bottom: 10px;
}
.rp-tax-title {
    font-size: 15px;
    line-height: 1.3;
    margin-bottom: 5px;
}
.rp-tax-title strong {
    font-size: 18px;
    text-transform: uppercase;
}
.rp-tax-count {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 15px;
}
.rp-tax-btn {
    background: #fff;
    color: #446084;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    margin-top: auto;
    display: inline-block;
}
.rp-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    cursor: pointer;
    z-index: 1000;
    color: #333;
    line-height: 1;
    font-weight: 400;
    transition: background-color .2s, color .2s;
    background-color: #f2f2f2;
    padding: 4px 10px;
    border-radius: 4px;
    margin-right: 4px;
}
.rp-close-btn:hover {
    background-color: #e0e0e0;
    color: #000;
}

/* Media Queries */
@media(max-width:1100px){
    .rp-layout-container{flex-direction:column;width:100%!important;margin-left:0!important}
    .rp-sidebar{width:100%;flex-direction:row;text-align:left;padding:10px;border-right:none;border-bottom:1px solid #eee;overflow-x:auto;white-space:nowrap;background:#f9f9f9;align-items:center;gap:10px}
    .rp-tab-btn{border:1px solid #ddd;padding:8px 16px;width:auto;border-radius:20px;flex-shrink:0;background:#fff;font-size:13px;text-align:center}
    .rp-tab-btn.active{border-color:#446084;background:#446084;color:#fff}
    .rp-content{padding:15px}
    #rp-global-results-container{width:100%!important;left:0!important;margin:0!important}
    .rp-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))!important}
    .rp-close-btn { top: 10px; right: 10px; font-size: 32px; background-color: #fff; border: 1px solid #eee; box-shadow: 0 2px 4px rgba(0,0,0,0.05); padding: 2px 8px; }
}
@media(max-width:650px){
    .rp-grid{grid-template-columns:repeat(2,1fr)!important;gap:10px!important}
    .rp-img-wrapper{height:110px!important}
    .rp-title{font-size:12px!important;height:auto!important;max-height:32px!important}
}
@media screen and (max-width: 768px) {
    #woocommerce-product-search-field-0, #woocommerce-product-search-field-1, input[name="s"] { font-size: 16px !important; }
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { display: none; }

#rp-search-overlay { height: 100vh; height: 100dvh; }

@media (hover: hover) {
    .rp-item:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,.08); border-color: #ddd; }
    .rp-item:hover .rp-add-btn { background-color: #00652a; color: #fff!important; }
    .rp-tax-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(68,96,132,0.4); }
}
@media (hover: none) {
    .rp-item:hover, .rp-tax-card:hover { transform: none; box-shadow: none; border-color: #eee; }
}
/* === V64.0 additions === */

/* Prezzo variabile (ex "Scegli opzioni") */
.rp-price-variable {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

/* Avviso fallback OR (ricerca multi-parola senza risultati AND) */
.rp-or-notice {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
    padding: 6px 10px;
    background: #f9f9f9;
    border-left: 3px solid #ccc;
    border-radius: 2px;
}
