/* =========================================================
   XSP REPAIR COST ESTIMATOR — FINAL STYLES (CARD GRID DESIGN)
   Scope-safe, GeneratePress compatible
   ========================================================= */

/* =======================
   CALCULATOR WRAPPER
   ======================= */
.xsp-repair-calculator {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin: 32px 0;
    overflow: hidden; /* Desktop default */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Arial, sans-serif;
}

/* =======================
   HEADER BANNER WITH IMAGE
   ======================= */
.xsp-header-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #fafafa 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
}

.xsp-header-image-box {
    width: 90px;
    height: 90px;
    min-width: 90px;
    border-radius: 12px;
    background: #ffffff;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
}

.xsp-model-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.xsp-header-details {
    flex: 1;
}

.xsp-badges-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.xsp-brand-badge {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xsp-brand-mi {
    background: #ff6900;
    color: #ffffff;
}

.xsp-brand-redmi {
    background: #e11d48;
    color: #ffffff;
}

.xsp-brand-poco {
    background: #eab308;
    color: #000000;
}

.xsp-category-badge {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    background: #e0f2fe;
    color: #0369a1;
}

.xsp-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
    padding: 0;
    color: #111827;
}

.xsp-subtitle {
    font-size: 13px;
    color: #4b5563;
    margin: 0;
    padding: 0;
}

/* =======================
   TABLE
   ======================= */
.xsp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.xsp-table thead th {
    background: #f3f4f6;
    color: #374151;
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.xsp-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    text-align: left;
    color: #1f2937;
}

.xsp-table tbody tr:hover {
    background: #f9fafb;
}

/* =======================
   INPUTS
   ======================= */
.xsp-part-select {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #ff6900;
}

/* =======================
   VARIANTS
   ======================= */
.xsp-row-motherboard {
    background: #fff7ed;
    border-left: 3px solid #ff6900;
}

.xsp-variant-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    background: #ffedd5;
    color: #9a3412;
    text-transform: uppercase;
}

/* =======================
   PRICE COLUMN
   ======================= */
.xsp-table tbody td:last-child {
    font-weight: 700;
    color: #047857;
    white-space: nowrap;
}

/* =======================
   TOTAL SUMMARY
   ======================= */
.xsp-total-box {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.xsp-total-box span {
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

.xsp-total-value {
    color: #ff6900;
    font-size: 24px;
    font-weight: 800;
}

/* =======================
   EXPLANATION & DISCLAIMERS
   ======================= */
.xsp-price-explanation {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 14px 16px;
    font-size: 13px;
    color: #374151;
}

.xsp-note {
    font-size: 12px;
    color: #6b7280;
    padding: 8px 16px 12px;
}

.xsp-disclaimer {
    font-size: 11px;
    color: #6b7280;
    padding: 10px 16px 14px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

/* =======================
   SEO & PRICING SUMMARY CARDS (RESPONSIVE)
   ======================= */
.xsp-seo-content {
    margin: 24px 16px 16px;
}

.xsp-seo-content h2 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px 0;
    line-height: 1.35;
    word-break: break-word;
}

.xsp-seo-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.xsp-seo-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
    max-width: 100%;
}

.xsp-seo-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.xsp-seo-card-full {
    grid-column: 1 / -1;
}

.xsp-seo-card-icon {
    font-size: 22px;
    line-height: 1;
    background: #f1f5f9;
    padding: 8px 10px;
    border-radius: 8px;
    flex-shrink: 0;
}

.xsp-seo-card-content {
    flex: 1;
    min-width: 0;
}

.xsp-seo-card-content h4 {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.xsp-seo-card-content p {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    word-wrap: break-word;
}

.xsp-seo-price-pill {
    display: inline-block;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-weight: 700;
    font-size: 13px;
    padding: 3px 9px;
    border-radius: 5px;
    white-space: nowrap;
}

.xsp-mb-variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px;
    margin-top: 6px;
    width: 100%;
}

.xsp-mb-variant-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    max-width: 100%;
}

.xsp-mb-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    word-break: break-word;
    line-height: 1.4;
}

.xsp-mb-price {
    font-size: 12px;
    font-weight: 700;
    color: #047857;
    white-space: nowrap;
    flex-shrink: 0;
}

/* =======================
   RELATED MODELS GRID CARDS
   ======================= */
.xsp-related-models {
    margin: 20px 16px 24px;
    padding: 18px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.xsp-related-models h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px 0;
    color: #0f172a;
}

.xsp-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.xsp-related-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.xsp-related-card:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.12);
}

.xsp-related-card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
}

.xsp-related-card:hover .xsp-related-card-title {
    color: #2563eb;
}

.xsp-related-arrow {
    color: #94a3b8;
    font-weight: 700;
    transition: transform 0.2s ease;
}

.xsp-related-card:hover .xsp-related-arrow {
    color: #2563eb;
    transform: translateX(4px);
}

.xsp-related-card-sub {
    font-size: 11px;
    color: #64748b;
}

/* =======================
   BREADCRUMB
   ======================= */
.xsp-breadcrumb {
    font-size: 13px;
    margin-bottom: 14px;
    color: #6b7280;
}

.xsp-breadcrumb a {
    color: #2563eb;
    text-decoration: none;
}

.xsp-breadcrumb span {
    margin: 0 6px;
}

/* =======================
   MOBILE BREAKDOWN TOGGLE
   ======================= */
.xsp-breakdown-toggle {
    display: none; /* Hidden on Desktop */
    margin-top: 8px;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.xsp-trust-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    font-size: 11px;
    color: #065f46;
    background: #ecfdf5;
    border-top: 1px solid #d1fae5;
}

.xsp-trust-badges span {
    white-space: nowrap;
}

.xsp-trust-note {
    margin: 4px 0 0;
    font-size: 11px;
    color: #6b7280;
}

.xsp-why-range {
    margin: 10px 16px 0;
    font-size: 12px;
    color: #374151;
}

.xsp-why-range summary {
    cursor: pointer;
    font-weight: 600;
    color: #2563eb;
}

.xsp-why-range p {
    margin-top: 6px;
    color: #6b7280;
}

/* =======================
   COST BREAKDOWN CONTAINER
   ======================= */
.xsp-cost-breakdown {
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.xsp-cost-breakdown ul {
    list-style: none;
    margin: 0;
    padding: 12px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
}

.xsp-table tbody th {
    text-align: left;
    padding: 12px 14px;
    font-weight: 500;
}

@keyframes xspSlideUp {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =======================
   MOBILE FIXES
   ======================= */
@media (max-width: 640px) {

    /* Allow sticky to work */
    .xsp-repair-calculator {
        overflow: visible;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .xsp-table thead {
        display: none;
    }

    .xsp-table tr {
        display: grid;
        grid-template-columns: 40px 1fr auto; /* FIXED */
        align-items: left;
        gap: 10px;
        padding: 12px 14px;
        border-bottom: 1px solid #e5e7eb;
    }

    .xsp-table td {
        padding: 0;
        border: none;
    }

    .xsp-table td:nth-child(2) {
        font-size: 14px;
        font-weight: 500;
    }

    .xsp-table td:last-child {
        font-size: 14px;
        font-weight: 700;
        text-align: right;
    }

    .xsp-total-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        position: sticky;
        bottom: 0;
        background: #ffffff;
        border-top: 1px solid #d1d5db;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
        z-index: 100;
    }

    .xsp-total-value {
        font-size: 22px;
    }

    /* Show button on mobile */
    .xsp-breakdown-toggle {
        display: inline-block;
    }

    /* Hide breakdown by default on mobile */
    .xsp-cost-breakdown {
        display: none; 
        animation: xspSlideUp 0.3s ease-out;
    }

    /* Show breakdown only when class is added */
    .xsp-cost-breakdown.is-open {
        display: block;
    }

    /* SEO & Variant Card Mobile Responsive Fixes */
    .xsp-seo-content {
        margin: 20px 10px 10px;
    }

    .xsp-seo-card {
        padding: 12px;
    }

    .xsp-mb-variant-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .xsp-mb-price {
        align-self: flex-start;
    }
}

/* =========================================================
   POPUP MODAL STYLES (QUICK CALCULATOR VIEW)
   ========================================================= */
.xsp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    box-sizing: border-box;
}

.xsp-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.xsp-modal-container {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 660px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
    animation: xspModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes xspModalPop {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.xsp-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.15s ease;
}

.xsp-modal-close:hover {
    background: #ff6900;
    color: #ffffff;
    border-color: #ff6900;
}

.xsp-modal-body {
    padding: 20px;
    box-sizing: border-box;
}

.xsp-modal-loader {
    text-align: center;
    padding: 40px 20px;
    font-weight: 600;
    color: #475569;
    font-size: 15px;
}

.xsp-view-full-page-btn {
    display: inline-block;
    background: #f8fafc;
    color: #2563eb !important;
    border: 1px solid #cbd5e1;
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.xsp-view-full-page-btn:hover {
    background: #2563eb;
    color: #ffffff !important;
    border-color: #2563eb;
}

/* =========================================================
   HUB INTRO HERO CARD — PREMIUM STYLING & RESPONSIVE GRID
   ========================================================= */
.xsp-hub-intro-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 26px 28px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    box-sizing: border-box;
}

.xsp-hub-intro-card:hover {
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

.xsp-intro-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.xsp-intro-h1 {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 !important;
    letter-spacing: -0.025em;
    line-height: 1.3 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.xsp-intro-badges-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.xsp-intro-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 30px;
    line-height: 1.4;
    white-space: nowrap;
}

.xsp-badge-gst {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.xsp-badge-labor {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #ffe4e6;
}

.xsp-badge-warranty {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.xsp-intro-text {
    font-size: 14.5px !important;
    color: #334155 !important;
    line-height: 1.7 !important;
    margin: 0 0 20px 0 !important;
}

/* 2x2 BALANCED HIGHLIGHTS GRID */
.xsp-intro-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    box-sizing: border-box;
}

.xsp-intro-chip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    transition: all 0.2s ease;
}

.xsp-intro-chip:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.xsp-chip-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.xsp-chip-content strong {
    color: #0f172a;
}

/* RESPONSIVE MEDIA QUERIES FOR INTRO CARD */
@media (max-width: 768px) {
    .xsp-intro-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 640px) {
    .xsp-hub-intro-card {
        padding: 18px 16px;
        margin-bottom: 20px;
        border-radius: 14px;
    }

    .xsp-intro-h1 {
        font-size: 19px !important;
    }

    .xsp-intro-badge {
        font-size: 11.5px;
        padding: 4px 10px;
    }
}

/* =========================================================
   BRAND HUB PILLAR PAGE — CONTROLS, FILTERS & GRID STYLES
   ========================================================= */
.xsp-brand-models-hub {
    margin: 28px 0 36px 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.xsp-hub-header {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
    transition: box-shadow 0.3s ease;
}

.xsp-hub-header:hover {
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

.xsp-hub-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.xsp-hub-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.xsp-hub-title {
    margin: 0 !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.xsp-title-icon {
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #fff7ed;
    border: 1px solid #ffedd5;
    border-radius: 10px;
}

.xsp-hub-brand-redmi .xsp-title-icon {
    background: #fff1f2;
    border-color: #ffe4e6;
}

.xsp-hub-brand-poco .xsp-title-icon {
    background: #fefce8;
    border-color: #fef08a;
}

.xsp-hub-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    color: #475569;
    padding: 7px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.xsp-live-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    animation: xspPulse 2s infinite;
}

@keyframes xspPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.xsp-count-num {
    color: #ff6900;
    font-weight: 800;
}

.xsp-hub-brand-redmi .xsp-count-num { color: #e11d48; }
.xsp-hub-brand-poco .xsp-count-num { color: #d97706; }

.xsp-hub-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* SEARCH BAR + SORT DROPDOWN ROW (SIDE BY SIDE) */
.xsp-search-sort-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.xsp-search-box {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.xsp-sort-box {
    flex-shrink: 0;
}

.xsp-hub-sort-select {
    height: 48px !important;
    padding: 0 38px 0 14px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px !important;
    cursor: pointer;
    outline: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
    white-space: nowrap;
}

.xsp-hub-sort-select:hover {
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

.xsp-hub-sort-select:focus {
    border-color: #ff6900 !important;
    box-shadow: 0 0 0 3px rgba(255, 105, 0, 0.12) !important;
}

.xsp-search-icon {
    position: absolute;
    left: 16px;
    font-size: 16px;
    color: #94a3b8;
    pointer-events: none;
}

.xsp-hub-search-input {
    width: 100% !important;
    height: 48px !important;
    box-sizing: border-box !important;
    padding: 0 42px 0 44px !important;
    font-size: 14.5px !important;
    font-weight: 500 !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    outline: none !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02) !important;
}

.xsp-hub-search-input:focus {
    border-color: #ff6900 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(255, 105, 0, 0.14) !important;
}

.xsp-hub-brand-redmi .xsp-hub-search-input:focus {
    border-color: #e11d48 !important;
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.14) !important;
}

.xsp-hub-brand-poco .xsp-hub-search-input:focus {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18) !important;
}

.xsp-search-clear {
    position: absolute;
    right: 12px;
    background: #cbd5e1;
    color: #475569;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.xsp-search-clear:hover {
    background: #ff6900;
    color: #ffffff;
}

/* FILTER TABS ROW */
.xsp-filter-tabs-wrapper {
    width: 100%;
    overflow: hidden;
}

.xsp-filter-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    padding: 3px 2px;
}

.xsp-filter-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.xsp-tab-btn {
    background: #f8fafc;
    color: #475569;
    border: 1.5px solid #cbd5e1;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
}

.xsp-tab-btn:hover {
    background: #ffffff;
    color: #0f172a;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.xsp-tab-btn.is-active {
    background: linear-gradient(135deg, #ff6900 0%, #ff5500 100%);
    color: #ffffff;
    border-color: #ff6900;
    box-shadow: 0 4px 14px rgba(255, 105, 0, 0.3);
}

.xsp-hub-brand-redmi .xsp-tab-btn.is-active {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    border-color: #e11d48;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3);
}

.xsp-hub-brand-poco .xsp-tab-btn.is-active {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    color: #0f172a;
    border-color: #eab308;
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.35);
}

.xsp-tab-icon {
    font-size: 14px;
    line-height: 1;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 640px) {
    .xsp-search-sort-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .xsp-hub-sort-select {
        width: 100% !important;
    }
}

@media (max-width: 640px) {
    .xsp-hub-header {
        padding: 16px;
        margin-bottom: 20px;
        border-radius: 14px;
    }

    .xsp-hub-title {
        font-size: 18px !important;
    }

    .xsp-title-icon {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .xsp-hub-count-badge {
        font-size: 12px;
        padding: 5px 12px;
    }

    .xsp-tab-btn {
        padding: 7px 14px;
        font-size: 12.5px;
    }

    /* 2 COLUMNS ON MOBILE DEVICES FOR HUB GRID */
    .xsp-hub-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .xsp-hub-card {
        padding: 12px 10px !important;
    }

    .xsp-hub-card .xsp-related-card-title {
        font-size: 13px !important;
    }

    .xsp-hub-card .xsp-related-card-sub {
        font-size: 11px !important;
    }
}


