/**
 * Unified Search Styles - Animated Transitions & Results Display
 */

/* Search Bar Animation to Top */
.selected-category-search {
    position: fixed;
    top: 78px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    width: min(1100px, calc(100vw - 170px));
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.selected-category-search.is-docked {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.selected-category-search .bento-search-form {
    background: linear-gradient(135deg, rgba(20, 28, 44, 0.94), rgba(16, 22, 36, 0.88));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 26px 60px rgba(5, 10, 18, 0.35);
}

/* Hero Panel Transition */
.home-hero-panel.is-transitioning {
    opacity: 0;
    transform: scale(0.98) translateY(-10px);
    pointer-events: none;
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Results Container */
.search-results-container {
    width: 100%;
    max-width: 1200px;
    margin: 120px auto 40px;
    padding: 0 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-results-container.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Results Header */
.results-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(180deg, rgba(18, 24, 38, 0.9), rgba(13, 18, 30, 0.82));
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.24);
}

.results-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 900;
    color: #f8fafc;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

.results-subtitle {
    font-size: 1rem;
    color: rgba(203, 213, 225, 0.74);
    margin: 0;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* Product Card */
.product-card {
    background: linear-gradient(180deg, rgba(18, 24, 38, 0.92), rgba(13, 18, 30, 0.84));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 56px rgba(0, 0, 0, 0.28);
    border-color: rgba(249, 115, 22, 0.34);
}

.product-card-image {
    position: relative;
    width: 100%;
    height: 240px;
    background: radial-gradient(circle at top right, rgba(249, 115, 22, 0.14), transparent 28%), linear-gradient(180deg, #121927, #0f172a);
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.product-platform-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-card-content {
    padding: 20px;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 16px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.product-card-price {
    font-size: 1.2rem;
    font-weight: 900;
    color: #34d399;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.product-card-edge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-bottom: 16px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(249, 115, 22, 0.16);
    color: #fdba74;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.35;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background:
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.18), transparent 28%),
        linear-gradient(180deg, #141c2c, #0f172a);
    color: #e2e8f0;
    padding: 20px;
    text-align: center;
}

.image-placeholder-glyph {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fdba74;
    background: rgba(255,255,255,0.08);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.image-placeholder-copy {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(203, 213, 225, 0.72);
}

.product-card-actions {
    display: flex;
    gap: 10px;
}

.product-card-actions .btn-primary,
.product-card-actions .btn-secondary {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.product-card-actions .btn-primary {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.product-card-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
}

.product-card-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: var(--pricilio-ink);
    border: 1px solid rgba(15, 23, 42, 0.15);
}

.product-card-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(15, 23, 42, 0.25);
    transform: translateY(-2px);
}

.product-card-actions .btn-secondary.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Empty State */
.results-empty {
    text-align: center;
    padding: 80px 20px;
    background: rgba(255, 252, 246, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.results-empty i {
    font-size: 4rem;
    color: var(--pricilio-muted);
    margin-bottom: 20px;
    opacity: 0.5;
}

.results-empty h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--pricilio-ink);
    margin: 0 0 10px;
}

.results-empty p {
    font-size: 1rem;
    color: var(--pricilio-muted);
    margin: 0 0 24px;
}

.results-empty .btn-primary {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.results-empty .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(249, 115, 22, 0.3);
}

.results-empty .btn-secondary {
    display: inline-block;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--pricilio-ink);
    text-decoration: none;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid rgba(15, 23, 42, 0.15);
    transition: all 0.2s ease;
}

.results-empty .btn-secondary:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 1);
    border-color: rgba(15, 23, 42, 0.25);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .selected-category-search {
        width: calc(100vw - 32px);
        top: 68px;
    }
    
    .search-results-container {
        margin-top: 100px;
        padding: 0 16px;
    }
    
    .results-header {
        padding: 20px 16px;
        margin-bottom: 24px;
    }
    
    .results-title {
        font-size: 1.5rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .product-card-image {
        height: 200px;
    }
    
    .product-card-actions {
        flex-direction: column;
    }

    .product-card-actions .btn-primary,
    .product-card-actions .btn-secondary {
        width: 100%;
    }

    .product-card-edge {
        border-radius: 16px;
        white-space: normal;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .selected-category-search {
        width: calc(100vw - 100px);
    }
}

/* Loading Animation for Product Cards */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.product-card.is-loading .product-card-image {
    background: linear-gradient(
        90deg,
        #f0f0f0 0px,
        #f8f8f8 40px,
        #f0f0f0 80px
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Smooth theme consistency */
body {
    background: 
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.10), transparent 32%),
        radial-gradient(circle at top right, rgba(20, 184, 166, 0.08), transparent 28%),
        linear-gradient(180deg, #f9f6ef 0%, #f7f4ee 100%);
    background-attachment: fixed;
}

/* Ensure no jarring transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
