/* ===================================
   Modern WooCommerce Product Search
   =================================== */

.modern-search-form {
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e1e5e9;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.search-input-wrapper:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 20px rgba(0, 115, 170, 0.15);
}

.search-input-wrapper:focus-within {
    border-color: #0073aa;
    box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.1), 0 4px 20px rgba(0, 115, 170, 0.15);
}

.modern-search-input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: transparent;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    outline: none;
    border-radius: 50px;
}

.modern-search-input::placeholder {
    color: #999;
    opacity: 1;
}

.modern-search-input:focus::placeholder {
    opacity: 0.7;
}

.modern-search-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 4px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    overflow: hidden;
}

.modern-search-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004c73 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
}

.modern-search-button:active {
    transform: scale(0.95);
}

.modern-search-button:focus {
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

/* Icon Styling */
.search-icon,
.search-icon-active {
    position: absolute;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.search-icon-active {
    opacity: 0;
    transform: rotate(-45deg) scale(0.8);
}

/* Hover and Active States */
.modern-search-button:hover .search-icon {
    opacity: 0;
    transform: rotate(45deg) scale(0.8);
}

.modern-search-button:hover .search-icon-active {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Loading state when form is submitted */
.modern-search-form.searching .modern-search-button {
    pointer-events: none;
    background: linear-gradient(135deg, #999 0%, #777 100%);
}

.modern-search-form.searching .search-icon,
.modern-search-form.searching .search-icon-active {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-search-form {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .modern-search-input {
        padding: 14px 18px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .modern-search-button {
        width: 44px;
        height: 44px;
    }
    
    .search-icon,
    .search-icon-active {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .modern-search-input {
        padding: 12px 16px;
    }
    
    .modern-search-button {
        width: 40px;
        height: 40px;
    }
    
    .search-icon,
    .search-icon-active {
        width: 16px;
        height: 16px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .search-input-wrapper {
        border-color: #000;
        background: #fff;
    }
    
    .modern-search-button {
        background: #000;
    }
    
    .modern-search-input {
        color: #000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .search-input-wrapper {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .modern-search-input {
        color: #e2e8f0;
    }
    
    .modern-search-input::placeholder {
        color: #a0aec0;
    }
    
    .search-input-wrapper:hover {
        border-color: #63b3ed;
    }
    
    .search-input-wrapper:focus-within {
        border-color: #63b3ed;
        box-shadow: 0 0 0 4px rgba(99, 179, 237, 0.1), 0 4px 20px rgba(99, 179, 237, 0.15);
    }
}

/* Focus visible for better accessibility */
.modern-search-button:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .search-input-wrapper,
    .modern-search-button,
    .search-icon,
    .search-icon-active {
        transition: none;
    }
    
    .modern-search-form.searching .search-icon,
    .modern-search-form.searching .search-icon-active {
        animation: none;
    }
} 