/**
 * AlterInstant Search - Standard Clean Design
 * 
 * Clean, professional AlterInstant Search baseline template
 * Fullscreen overlay with proper sizing and minimal styling
 * No theme interference
 */

/* ===========================
   OVERLAY & FULLSCREEN BASE
   =========================== */

#ao-fullscreen-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ao-search-container {
    width: 100%;
    max-width: 1400px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===========================
   SEARCH HEADER
   =========================== */

.ao-search-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ao-search-input-wrapper {
    flex: 1;
    position: relative;
}

.ao-search-input {
    width: 100%;
    padding: 0.875rem 1.25rem 0.875rem 3rem;
    font-size: 1.125rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ao-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ao-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.25rem;
}

.ao-search-close {
    padding: 0.75rem;
    border: none;
    background: #f3f4f6;
    border-radius: 10px;
    cursor: pointer;
    color: #6b7280;
    font-size: 1.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.ao-search-close:hover {
    background: #e5e7eb;
    color: #111827;
}

/* ===========================
   SEARCH STATS
   =========================== */

.ao-search-stats {
    padding: 1rem 2rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #6b7280;
}

.ao-search-count {
    font-weight: 500;
    color: #111827;
}

.ao-search-time {
    color: #10b981;
    font-weight: 500;
}

/* ===========================
   RESULTS GRID
   =========================== */

.ao-search-results {
    padding: 2rem;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.ao-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* ===========================
   PRODUCT CARDS - CLEAN BASELINE
   =========================== */

.ao-product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.ao-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: #d1d5db;
}

.ao-product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f9fafb;
    overflow: hidden;
}

.ao-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.ao-product-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #ef4444;
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.ao-product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ao-product-categories {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.ao-product-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #111827;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ao-product-rating {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.ao-stars {
    color: #fbbf24;
    font-size: 0.875rem;
}

.ao-rating-count {
    font-size: 0.75rem;
    color: #9ca3af;
}

.ao-product-price {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-top: auto;
}

.ao-price-regular {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    font-weight: 400;
}

.ao-price-sale {
    color: #ef4444;
}

.ao-product-actions {
    padding: 0.75rem 1rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    gap: 0.5rem;
}

.ao-btn-add-cart {
    flex: 1;
    padding: 0.625rem 1rem;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ao-btn-add-cart:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.ao-btn-icon {
    padding: 0.625rem;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ao-btn-icon:hover {
    background: #e5e7eb;
    color: #111827;
}

/* ===========================
   NO RESULTS
   =========================== */

.ao-no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.ao-no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.ao-no-results-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.ao-no-results-text {
    font-size: 1rem;
    color: #6b7280;
}

/* ===========================
   LOADING STATE
   =========================== */

.ao-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.ao-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
    .ao-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    #ao-fullscreen-search-overlay {
        padding: 0;
        align-items: stretch;
    }
    
    .ao-search-container {
        border-radius: 0;
        max-width: none;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .ao-search-header {
        padding: 1rem;
    }
    
    .ao-search-input {
        font-size: 1rem;
        padding: 0.75rem 1rem 0.75rem 2.5rem;
    }
    
    .ao-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .ao-search-results {
        padding: 1rem;
        flex: 1;
    }
}

@media (max-width: 480px) {
    .ao-products-grid {
        grid-template-columns: 1fr;
    }
    
    .ao-product-info {
        padding: 0.75rem;
    }
    
    .ao-product-title {
        font-size: 0.875rem;
    }
}
