/* FFP Premium Search - Steeda-Style Search Experience v1.5 */

/* Completely hide BeTheme live search */
.mfn-live-search-box,
.mfn-live-search-wrapper,
.mfn-live-search-list,
.search_wrapper .mfn-live-search-box,
.search_wrapper .mfn-live-search-wrapper {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Modal Overlay */
.ffp-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.ffp-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.ffp-search-container {
    position: relative;
    max-width: 1100px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

/* Search Header */
.ffp-search-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.ffp-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    transition: border-color 0.2s;
}

.ffp-search-input-wrap:focus-within {
    border-color: #cc0000;
}

.ffp-search-icon {
    width: 24px;
    height: 24px;
    color: #9ca3af;
    flex-shrink: 0;
}

#ffp-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    font-weight: 500;
    color: #1f2937;
    background: transparent;
}

#ffp-search-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.ffp-search-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    color: #6b7280;
    transition: all 0.2s;
}

.ffp-search-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.ffp-search-close svg {
    width: 20px;
    height: 20px;
}

/* Search Body */
.ffp-search-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.ffp-search-sidebar {
    width: 260px;
    border-right: 1px solid #e5e7eb;
    padding: 20px;
    overflow-y: auto;
    background: #fff;
    flex-shrink: 0;
}

.ffp-search-section {
    margin-bottom: 24px;
}

.ffp-search-section h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.ffp-search-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ffp-search-section li {
    margin-bottom: 2px;
}

.ffp-search-section li a,
.ffp-search-section li button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}

.ffp-search-section li a:hover,
.ffp-search-section li button:hover {
    background: #f3f4f6;
    color: #cc0000;
}

.ffp-search-section li .count {
    font-size: 12px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

/* Results Area */
.ffp-search-results {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fafafa;
}

.ffp-results-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.ffp-results-count {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.ffp-results-count strong {
    color: #1f2937;
}

.ffp-results-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-content: start;
}

.ffp-search-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.ffp-search-placeholder p {
    margin: 0;
    font-size: 16px;
}

/* Product Card - FIXED IMAGE DISPLAY */
.ffp-product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.ffp-product-card:hover {
    border-color: #cc0000;
    box-shadow: 0 4px 12px rgba(204, 0, 0, 0.15);
    transform: translateY(-2px);
}

.ffp-product-image {
    width: 100%;
    height: 180px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
}

.ffp-product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    padding: 10px;
    transition: transform 0.3s;
}

.ffp-product-card:hover .ffp-product-image img {
    transform: scale(1.05);
}

.ffp-product-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.ffp-product-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
}

.ffp-product-sku {
    font-size: 11px;
    color: #9ca3af;
    margin: 0;
    font-family: monospace;
}

.ffp-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #cc0000;
    margin: 4px 0 0 0;
}

.ffp-product-price del {
    color: #9ca3af;
    font-weight: 400;
    font-size: 13px;
    margin-left: 6px;
}

.ffp-product-price ins {
    text-decoration: none;
}

/* Stock status */
.ffp-product-stock {
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
}

.ffp-product-stock.in-stock {
    color: #10b981;
}

.ffp-product-stock.out-of-stock {
    color: #ef4444;
}

.ffp-product-stock.backorder {
    color: #f59e0b;
}

/* Results Footer */
.ffp-results-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    background: #fff;
}

.ffp-see-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #cc0000;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s;
}

.ffp-see-all-btn:hover {
    background: #a00;
    color: #fff;
    transform: translateY(-1px);
}

/* Loading State */
.ffp-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
}

.ffp-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #cc0000;
    border-radius: 50%;
    animation: ffp-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes ffp-spin {
    to { transform: rotate(360deg); }
}

/* No Results */
.ffp-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.ffp-no-results h3 {
    margin: 0 0 8px;
    color: #1f2937;
}

.ffp-no-results p {
    margin: 0;
    color: #6b7280;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .ffp-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ffp-product-image {
        height: 150px;
    }
}

@media (max-width: 768px) {
    .ffp-search-container {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .ffp-search-body {
        flex-direction: column;
    }
    
    .ffp-search-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        max-height: 180px;
        padding: 16px;
        overflow-y: auto;
    }
    
    .ffp-search-section {
        margin-bottom: 16px;
    }
    
    .ffp-search-section h4 {
        font-size: 10px;
        margin-bottom: 8px;
    }
    
    .ffp-search-section ul {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .ffp-search-section li {
        margin: 0;
    }
    
    .ffp-search-section li a,
    .ffp-search-section li button {
        padding: 6px 10px;
        font-size: 12px;
        background: #f3f4f6;
        border-radius: 20px;
    }
    
    .ffp-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }
    
    .ffp-product-image {
        height: 120px;
    }
    
    .ffp-product-info {
        padding: 10px;
    }
    
    .ffp-product-title {
        font-size: 12px;
        min-height: 32px;
    }
    
    .ffp-product-price {
        font-size: 14px;
    }
    
    .ffp-product-sku {
        display: none;
    }
}

/* Scrollbar styling */
.ffp-search-sidebar::-webkit-scrollbar,
.ffp-results-grid::-webkit-scrollbar {
    width: 6px;
}

.ffp-search-sidebar::-webkit-scrollbar-track,
.ffp-results-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ffp-search-sidebar::-webkit-scrollbar-thumb,
.ffp-results-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.ffp-search-sidebar::-webkit-scrollbar-thumb:hover,
.ffp-results-grid::-webkit-scrollbar-thumb:hover {
    background: #999;
}