/**
 * Skypop Smart Search - Styles
 * Version: 1.0.0
 */

/* ========================================
   Search Container
   ======================================== */
.sss-search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.sss-search-form {
    position: relative;
}

.sss-search-input-wrapper {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sss-search-input-wrapper:focus-within {
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.sss-search-input {
    flex: 1;
    padding: 12px 15px;
    background: transparent;
    border: none;
    font-size: 15px;
    color: #333;
    outline: none;
}

.sss-search-input::placeholder {
    color: #999;
}

.sss-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    transition: color 0.2s ease;
}

.sss-search-btn:hover {
    color: #000;
}

/* ========================================
   Results Dropdown
   ======================================== */
.sss-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-height: 450px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
}

.sss-results-dropdown.active {
    display: block;
}

.sss-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.sss-results-count {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   Results Grid
   ======================================== */
.sss-results-grid {
    padding: 10px;
}

.sss-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
    color: inherit;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.sss-result-item:hover {
    background: #f5f5f5;
}

.sss-result-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.sss-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sss-result-info {
    flex: 1;
    min-width: 0;
}

.sss-result-title {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sss-result-price {
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

.sss-result-price del {
    font-weight: 400;
    color: #999;
}

.sss-result-price ins {
    text-decoration: none;
    color: #e53935;
}

/* ========================================
   View All Link
   ======================================== */
.sss-view-all {
    display: block;
    padding: 15px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    text-decoration: none;
    background: #f8f8f8;
    border-top: 1px solid #eee;
    transition: background 0.2s ease;
}

.sss-view-all:hover {
    background: #f0f0f0;
    color: #000;
}

/* ========================================
   No Results
   ======================================== */
.sss-no-results {
    padding: 30px 20px;
    text-align: center;
}

.sss-no-results p {
    margin: 0 0 8px 0;
    color: #333;
}

.sss-no-results .sss-suggestions {
    font-size: 13px;
    color: #666;
}

/* ========================================
   Loading State
   ======================================== */
.sss-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.sss-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-top-color: #000;
    border-radius: 50%;
    animation: sss-spin 0.8s linear infinite;
}

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

/* ========================================
   Mobile Styles (for Skypop Smart Menu)
   ======================================== */
.ssm-mobile-search .sss-search-container {
    max-width: none;
}

.ssm-mobile-search .sss-search-input-wrapper {
    background: rgba(255,255,255,0.9) !important;
    border-color: rgba(255,255,255,0.5) !important;
}

.ssm-mobile-search .sss-search-input {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}

.ssm-mobile-search .sss-search-input::placeholder {
    color: #666666 !important;
    -webkit-text-fill-color: #666666 !important;
}

/* Fix for autofill styling */
.ssm-mobile-search .sss-search-input:-webkit-autofill,
.ssm-mobile-search .sss-search-input:-webkit-autofill:hover,
.ssm-mobile-search .sss-search-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #000000 !important;
    -webkit-box-shadow: 0 0 0px 1000px rgba(255,255,255,0.9) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.ssm-mobile-search .sss-search-btn {
    color: #333333 !important;
}

.ssm-mobile-search .sss-search-btn:hover {
    color: #000000 !important;
}

.ssm-mobile-search .sss-results-dropdown {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 60vh;
    border-radius: 12px 12px 0 0;
    border: none;
    background: #fff;
}

.ssm-mobile-search .sss-results-dropdown .sss-result-title,
.ssm-mobile-search .sss-results-dropdown .sss-result-price {
    color: #333;
}

/* ========================================
   Trending Searches
   ======================================== */
.sss-trending {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.sss-trending-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin: 0 0 10px 0;
}

.sss-trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sss-trending-tag {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    color: #333;
    background: #f5f5f5;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sss-trending-tag:hover {
    background: #000;
    color: #fff;
}

/* ========================================
   Category Filter
   ======================================== */
.sss-category-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sss-category-filter::-webkit-scrollbar {
    display: none;
}

.sss-category-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sss-category-btn:hover,
.sss-category-btn.active {
    background: #000;
    border-color: #000;
    color: #fff;
}
