/* Hero Search Form Styles */
.hero-search-form-container {
    position: relative;
    z-index: 20;
    width: 100%;
    max-width: 600px;
    margin-top: 1.5rem;
    padding: 0 0.5rem;
    /* Ensure container doesn't expand with dropdown */
    overflow: visible;
}

.hero-search-form {
    width: 100%;
}

.hero-search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 12px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.hero-search-form-container.active .hero-search-input-wrapper {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.hero-search-input-wrapper:focus-within {
    box-shadow: 0 15px 50px rgba(2, 162, 228, 0.3), 0 0 0 2px rgba(2, 162, 228, 0.5);
    background: rgba(255, 255, 255, 1);
}

.hero-search-form-container.active .hero-search-input-wrapper {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.hero-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.1rem;
    color: #1e293b;
    padding: 8px 15px;
    font-weight: 500;
}

.hero-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.hero-search-submit {
    background: linear-gradient(90deg, #02a2e4, #00a0d8);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    color: white;
    padding: 0;
}

.hero-search-submit:hover {
    background: linear-gradient(90deg, #0288c7, #0089ba);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(2, 162, 228, 0.4);
}

.hero-search-submit:active {
    transform: scale(0.95);
}

.hero-search-submit svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-search-form-container {
        max-width: 90%;
        margin-top: 1rem;
    }

    .hero-search-input-wrapper {
        padding: 10px 15px;
        border-radius: 40px;
    }

    .hero-search-input {
        font-size: 1rem;
        padding: 6px 10px;
    }

    .hero-search-submit {
        width: 40px;
        height: 40px;
    }

    .hero-search-submit svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .hero-search-form-container {
        max-width: 95%;
        margin-top: 0.75rem;
    }

    .hero-search-input {
        font-size: 0.95rem;
    }
}

/* Live Search Dropdown Styles */
.hero-search-dropdown {
    position: absolute !important;
    top: 100%;
    left: 0.5rem;
    right: 0.5rem;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
    height: 150px;
    overflow: scroll;
    z-index: 1000;
    /* Use visibility instead of display to prevent layout shifts */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    /* Prevent any layout shifts - completely remove from flow */
    contain: layout style paint;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(2, 162, 228, 0.3) transparent;
    /* Transition for smooth show/hide */
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.hero-search-dropdown.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.hero-search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.hero-search-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.hero-search-dropdown::-webkit-scrollbar-thumb {
    background-color: rgba(2, 162, 228, 0.3);
    border-radius: 3px;
}

.hero-search-dropdown::-webkit-scrollbar-thumb:hover {
    background-color: rgba(2, 162, 228, 0.5);
}

.hero-search-results {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.hero-search-result-item {
    display: flex;
    align-items: center;
    padding: 4px 8px 4px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    min-height: 40px;
}

.hero-search-result-item:last-child {
    border-bottom: none;
}

.hero-search-result-item:hover {
    background-color: rgba(2, 162, 228, 0.1);
}

.hero-search-result-item.hero-search-result-selected {
    background-color: rgba(2, 162, 228, 0.2);
    outline: 2px solid rgba(2, 162, 228, 0.5);
    outline-offset: -2px;
}

.hero-search-result-image {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
    flex-shrink: 0;
}

.hero-search-result-content {
    flex: 1;
    min-width: 0;
}

.hero-search-result-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.hero-search-result-price {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    line-height: 1.2;
}

.hero-search-loading,
.hero-search-no-results,
.hero-search-error {
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

.hero-search-loading {
    color: #02a2e4;
}

.hero-search-error {
    color: #ef4444;
}

/* Mobile Responsive for Dropdown */
@media (max-width: 768px) {
    .hero-search-dropdown {
        left: 0;
        right: 0;
        border-radius: 8px;
        max-height: 280px;
    }

    .hero-search-result-item {
        padding: 4px 8px 4px 12px;
        min-height: 40px;
    }

    .hero-search-result-image {
        width: 26px;
        height: 26px;
        margin-right: 8px;
    }

    .hero-search-result-title {
        font-size: 0.8rem;
        margin-bottom: 1px;
    }

    .hero-search-result-price {
        font-size: 0.7rem;
    }

    .hero-search-loading,
    .hero-search-no-results,
    .hero-search-error {
        padding: 12px;
        font-size: 0.8rem;
    }
}
