/**
 * Search Modal Styles - Premium Edition
 * Modern glassmorphism design with smooth animations
 */

/* Modal Container */
.modeo-search-modal {
    visibility: hidden;
    transition: visibility 0s 0.35s;
}

.modeo-search-modal.active {
    visibility: visible;
    pointer-events: auto;
    transition: visibility 0s 0s;
}

/* Backdrop with blur */
.modeo-search-modal .modeo-search-backdrop {
    opacity: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    transition: opacity 0.35s ease-out;
}

.modeo-search-modal.active .modeo-search-backdrop {
    opacity: 1;
}

/* Panel - Base styles */
.modeo-search-modal .modeo-search-panel {
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.35s ease-out;
    background: #ffffff;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.15);
}

.modeo-search-modal.active .modeo-search-panel {
    transform: translateX(0);
}

/* Mobile: Full width with rounded top corners */
@media (max-width: 767px) {
    .modeo-search-modal .modeo-search-panel {
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        top: auto;
        bottom: 0;
        height: 90vh;
        transform: translateY(100%);
    }

    .modeo-search-modal.active .modeo-search-panel {
        transform: translateY(0);
    }
}

/* Desktop: Centered modal with all corners rounded */
@media (min-width: 768px) {
    .modeo-search-modal .modeo-search-panel {
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
        height: auto;
        max-height: 80vh;
        max-width: 600px;
        width: 90%;
        border-radius: 24px;
        box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    }

    .modeo-search-modal.active .modeo-search-panel {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Search Input - Premium style */
#modeo-search-input {
    font-size: 16px;
    font-weight: 500;
    background: #f3f4f6;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

#modeo-search-input:focus {
    background: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.08);
}

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

/* Results container with custom scrollbar */
#modeo-search-results {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

#modeo-search-results::-webkit-scrollbar {
    width: 6px;
}

#modeo-search-results::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* Product Result Card - Premium */
.modeo-search-product {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #ffffff;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.modeo-search-product:hover {
    background: #fef2f2;
    border-color: rgba(220, 38, 38, 0.2);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.1);
    transform: translateY(-2px);
}

/* Product Image - Premium */
.modeo-search-product-image {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.modeo-search-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.modeo-search-product:hover .modeo-search-product-image img {
    transform: scale(1.05);
}

/* Product Info */
.modeo-search-product-info {
    flex: 1;
    min-width: 0;
}

.modeo-search-product-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 6px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modeo-search-product-price {
    font-size: 15px;
    font-weight: 700;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modeo-search-product-price del {
    color: #9ca3af;
    font-weight: 400;
    font-size: 13px;
}

/* Arrow icon */
.modeo-search-product-arrow {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 4px;
    color: #d1d5db;
    transition: all 0.25s ease;
    background: #f9fafb;
    border-radius: 8px;
}

.modeo-search-product:hover .modeo-search-product-arrow {
    color: #dc2626;
    background: #fee2e2;
    transform: translateX(4px);
}

/* Loading Spinner */
@keyframes modeo-spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: modeo-spin 0.8s linear infinite;
}

/* Products list */
.modeo-search-products {
    flex-direction: column;
    gap: 12px;
}

/* Staggered animation for results */
.modeo-search-products .modeo-search-product {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

.modeo-search-products .modeo-search-product:nth-child(1) {
    animation-delay: 0.05s;
}

.modeo-search-products .modeo-search-product:nth-child(2) {
    animation-delay: 0.1s;
}

.modeo-search-products .modeo-search-product:nth-child(3) {
    animation-delay: 0.15s;
}

.modeo-search-products .modeo-search-product:nth-child(4) {
    animation-delay: 0.2s;
}

.modeo-search-products .modeo-search-product:nth-child(5) {
    animation-delay: 0.25s;
}

.modeo-search-products .modeo-search-product:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Safe area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 767px) {
        .modeo-search-panel>div:last-child {
            padding-bottom: calc(16px + env(safe-area-inset-bottom));
        }
    }
}