/* Voice Search Button */
.voice-search-container {
    margin-left: auto;
    display: flex;
    padding: 10px;
}

.voice-search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.voice-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #8183f4 0%, #9b6ef7 100%);
}

.voice-search-btn svg {
    width: 20px;
    height: 20px;
}

/* Voice Search Modal */
.voice-search-modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999 !important;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.voice-search-modal.open {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.voice-search-modal-content {
    background: #f9f9f9;
    border-radius: 24px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1000000 !important;
}

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

/* Header */
.voice-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px 14px;
    border-bottom: 1px solid #eeeeee;
}

.voice-search-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-star-icon {
    color: #111;
    width: 20px;
    height: 20px;
}

.voice-search-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111;
}

.voice-beta-badge {
    background: #f0f0f0;
    color: #888;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

.voice-search-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.voice-search-close:hover {
    color: #111;
}

/* Body */
.voice-search-body {
    padding: 24px 22px 20px;
    text-align: center;
}

/* Hero text */
.voice-hero-text {
    margin-bottom: 24px;
}

.voice-hero-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin: 0 0 4px;
    line-height: 1.3;
}

.voice-hero-subtitle {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.3;
}

/* Voice Animation — mic + waves side by side */
.voice-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 18px;
}

/* Mic button — clickable circle with rings */
.mic-icon {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 12px rgba(180,180,180,0.15), 0 0 0 24px rgba(180,180,180,0.08);
    flex-shrink: 0;
}

.mic-icon svg {
    stroke: #555;
    transition: stroke 0.3s;
}

.mic-icon:hover {
    border-color: #111;
    box-shadow: 0 0 0 12px rgba(0,0,0,0.08), 0 0 0 24px rgba(0,0,0,0.04);
}

/* Mic active state */
.mic-icon.is-listening {
    background: #fff0f0;
    border-color: #111;
    box-shadow: 0 0 0 12px rgba(0,0,0,0.08), 0 0 0 26px rgba(0,0,0,0.04);
    animation: mic-pulse 1.5s ease-in-out infinite;
}

.mic-icon.is-listening svg {
    stroke: #111;
}

@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 12px rgba(0,0,0,0.08), 0 0 0 26px rgba(0,0,0,0.04); }
    50% { box-shadow: 0 0 0 16px rgba(0,0,0,0.06), 0 0 0 32px rgba(0,0,0,0.02); }
}

/* Side waves — LEFT */
.voice-waves-left,
.voice-waves-right {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 50px;
}

.voice-waves-left {
    flex-direction: row;
}

.voice-waves-right {
    flex-direction: row;
}

/* All wave bars — static by default */
.voice-waves-left span,
.voice-waves-right span {
    display: inline-block;
    width: 3px;
    height: 6px;
    background: #111;
    border-radius: 3px;
    transition: height 0.2s ease;
}

/* Left waves animate inward (4→1) when listening */
.voice-waves-left.is-listening span:nth-child(1) { animation: wave-sm 0.9s ease-in-out 0.45s infinite; }
.voice-waves-left.is-listening span:nth-child(2) { animation: wave-md 0.9s ease-in-out 0.3s infinite; }
.voice-waves-left.is-listening span:nth-child(3) { animation: wave-lg 0.9s ease-in-out 0.15s infinite; }
.voice-waves-left.is-listening span:nth-child(4) { animation: wave-xl 0.9s ease-in-out 0s infinite; }

/* Right waves animate outward (1→4) when listening */
.voice-waves-right.is-listening span:nth-child(1) { animation: wave-xl 0.9s ease-in-out 0s infinite; }
.voice-waves-right.is-listening span:nth-child(2) { animation: wave-lg 0.9s ease-in-out 0.15s infinite; }
.voice-waves-right.is-listening span:nth-child(3) { animation: wave-md 0.9s ease-in-out 0.3s infinite; }
.voice-waves-right.is-listening span:nth-child(4) { animation: wave-sm 0.9s ease-in-out 0.45s infinite; }

@keyframes wave-sm { 0%, 100% { height: 6px; } 50% { height: 14px; } }
@keyframes wave-md { 0%, 100% { height: 6px; } 50% { height: 22px; } }
@keyframes wave-lg { 0%, 100% { height: 6px; } 50% { height: 32px; } }
@keyframes wave-xl { 0%, 100% { height: 6px; } 50% { height: 44px; } }

/* Voice status text */
.voice-status {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 10px;
    padding: 0;
    display: block;
    background: none !important;
    border-radius: 0;
}

.voice-status.idle     { color: #111; }
.voice-status.listening { color: #111; }
.voice-status.processing { color: #d97706; }
.voice-status.error    { color: #dc2626; }
.voice-status.success  { color: #16a34a; }

.voice-transcript {
    font-size: 13px;
    color: #555;
    font-style: italic;
    min-height: 18px;
    margin: 0 0 16px;
}

/* Suggestions box */
.voice-suggestions-box {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    text-align: left;
    margin-bottom: 16px;
    border: 1px solid #eeeeee;
}

.voice-suggestions-label {
    font-size: 13px;
    color: #555;
    margin: 0 0 12px;
    text-align: center;
}

.voice-suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f9f9f9;
    border: 1px solid #eeeeee;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #222;
    line-height: 1.4;
}

.voice-suggestion-item:last-child {
    margin-bottom: 0;
}

.voice-suggestion-item svg {
    stroke: #111;
    flex-shrink: 0;
    margin-top: 1px;
}

/* OR divider */
.voice-or-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
}

.voice-or-divider span {
    flex: 1;
    height: 1px;
    background: #ddd;
    display: block;
}

.voice-or-divider p {
    font-size: 12px;
    color: #111;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.05em;
}

/* Actions */
.voice-actions {
    margin-top: 4px;
}

/* Type your preferences button — outlined pill style */
.voice-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid #ddd;
    padding: 13px 28px;
    border-radius: 50px;
    color: #111;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-bottom: 12px;
}

.voice-start-btn:hover {
    border-color: #111;
    background: #f9f9f9;
}

.voice-start-btn.listening {
    background: #111;
    color: #fff;
    border-color: #111;
}

.keyboard-icon {
    stroke: #111;
}

.voice-start-btn.listening .keyboard-icon {
    stroke: #fff;
}

.voice-ai-note {
    margin: 0 auto;
    max-width: 100%;
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.5;
    text-align: center;
}

/* Testing input styles - Remove this later */
.voice-test-input {
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px;
    margin: 0 0 14px;
}

.voice-test-input input:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.voice-test-input button:hover {
    background: #374151 !important;
    transform: translateY(-1px);
}

.voice-test-input button:active {
    transform: translateY(0);
}

/* Search Results */
.voice-search-results {
    border-top: 1px solid #eeeeee;
    padding: 16px 22px;
}

.voice-search-results h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #111;
}

.voice-results-grid {
    max-height: 50vh;
    overflow-y: auto;
}

.voice-results-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Tablet: 2 columns */
@media (max-width: 1023px) {
    .voice-results-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 1 column */
@media (max-width: 599px) {
    .voice-results-wrapper {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.voice-result-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    background: white;
}

.voice-result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.voice-result-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.voice-result-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.voice-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.voice-result-item:hover .voice-result-image img {
    transform: scale(1.05);
}

.voice-result-info {
    padding: 10px;
}

.voice-result-info h5 {
    margin: 0 0 5px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-result-price {
    color: #111;
    font-weight: 600;
    margin: 3px 0;
    font-size: 13px;
}

.voice-result-size,
.voice-result-color,
.voice-result-category,
.voice-result-occasion {
    font-size: 11px;
    color: #6b7280;
    margin: 2px 0;
}

/* Results Header */
.voice-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eeeeee;
}

.voice-results-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.voice-results-count {
    font-size: 12px;
    color: #6b7280;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 28px 16px;
    color: #6b7280;
}

.no-results svg {
    margin-bottom: 12px;
    color: #9ca3af;
}

.no-results p {
    color: #4b5563;
    margin-bottom: 10px;
}

.no-results-suggestion {
    font-weight: 500;
    margin-top: 16px;
}

.no-results ul {
    text-align: left;
    display: inline-block;
    margin-top: 10px;
}

.no-results li {
    margin: 6px 0;
    color: #111;
    cursor: pointer;
    transition: color 0.2s;
}

.no-results li:hover {
    color: #444;
    text-decoration: underline;
}

.voice-search-redirect {
    background: #111;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 14px;
    transition: all 0.3s;
}

.voice-search-redirect:hover {
    background: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .voice-search-btn span {
        display: none;
    }

    .voice-search-btn {
        padding: 10px;
    }

    .voice-search-modal-content {
        width: 92%;
        margin: 16px;
    }

    .voice-hero-title,
    .voice-hero-subtitle {
        font-size: 17px;
    }
}

/* Loading State */
.voice-loading {
    text-align: center;
    padding: 32px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #111;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Fix modal appearing behind mobile header */
body.modal-open header,
body.modal-open .site-header,
body.modal-open .header-main {
    z-index: 1 !important;
}

/* Powered by footer */
.voice-powered-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 0 4px;
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

.voice-powered-footer svg {
    fill: #aaa;
    flex-shrink: 0;
}

.voice-powered-footer span {
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Debug info styles */
.debug-info {
    font-family: monospace;
    font-size: 12px;
}

.debug-info p {
    margin: 5px 0;
}