/* Product Search Styles */

.ark-search-wrapper {
    display: inline-block;
}

.ark-search-trigger {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ark-search-trigger:hover {
    transform: scale(1.1);
}

.ark-search-icon {
    color: #ffffff;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.ark-search-trigger:hover .ark-search-icon {
    color: #e5e7eb;
}

.ark-search-placeholder {
    display: none;
}

/* Search Modal */
.ark-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
}

.ark-search-modal.active {
    display: flex;
    opacity: 1;
}

.ark-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.ark-search-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 50vh;
    background: #fafbfc;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideFromTop 0.3s ease;
    transition: height 0.3s ease, max-height 0.3s ease;
}

.ark-search-modal.searching .ark-search-container {
    height: 90vh;
    max-height: 90vh;
}

@keyframes slideFromTop {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ark-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-bottom: 1px solid #e8eaed;
    background: #ffffff;
}

.ark-search-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #9ca3af;
    margin: 0;
    text-transform: uppercase;
}

.ark-search-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease;
    border-radius: 6px;
}

.ark-search-close:hover {
    color: #1f2937;
    background: #f3f4f6;
}

.ark-search-input-wrapper {
    position: relative;
    padding: 24px 32px;
    border-bottom: 1px solid #e8eaed;
    background: #ffffff;
}

.ark-search-input-icon {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    color: #5f6368;
    pointer-events: none;
}

.ark-search-input {
    width: 100%;
    padding: 11px 80px 11px 40px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #f8f9fa;
    color: #5f6368;
}

.ark-search-input:focus {
    border-color: #dadce0;
    background: #ffffff;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08);
}

.ark-search-input::placeholder {
    color: #9aa0a6;
}

.ark-search-clear {
    position: absolute;
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #1a73e8;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    font-weight: 500;
}

.ark-search-clear:hover {
    text-decoration: underline;
}

.ark-search-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 0;
}

.ark-search-initial {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 80px;
}

.ark-search-initial > div {
    display: flex;
    gap: 80px;
    align-items: flex-start;
}

.ark-search-section {
    flex: 1;
}

.ark-search-section:first-child {
    flex: 0 0 280px;
}

.ark-search-section-title {
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    margin: 0 0 20px 0;
}

.ark-popular-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ark-popular-tag {
    padding: 8px 18px;
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 16px;
    font-size: 13px;
    color: #3c4043;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ark-popular-tag:hover {
    background: #e8eaed;
    border-color: #dadce0;
}

.ark-popular-products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.ark-product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
}

.ark-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(60, 64, 67, 0.15);
    border-color: #dadce0;
}

.ark-product-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.ark-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ark-product-color {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.1);
}

.ark-product-placeholder {
    width: 80%;
    height: 80%;
    background: #e5e7eb;
    border-radius: 50%;
}

.ark-product-info {
    padding: 16px;
    text-align: center;
    background: #ffffff;
}

.ark-product-title {
    font-size: 14px;
    font-weight: 500;
    color: #1a73e8;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ark-product-subtitle {
    font-size: 12px;
    color: #5f6368;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Search Results */
.ark-search-results {
    animation: fadeIn 0.3s ease;
}

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

.ark-search-results-header {
    margin-bottom: 16px;
}

.ark-results-count {
    font-size: 14px;
    color: #6b7280;
}

.ark-search-results {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 80px;
}

.ark-search-results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Loading Animation */
.ark-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    animation: fadeIn 0.3s ease;
}

.ark-loading-animation {
    text-align: center;
}

.ark-paint-can {
    animation: bounce 1.5s ease-in-out infinite;
    color: #3b82f6;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.ark-paint-drop {
    animation: drip 1.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes drip {
    0%, 100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translateY(10px) scale(0.8);
    }
}

.ark-loading-animation p {
    margin-top: 16px;
    font-size: 14px;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 1200px) {
    .ark-search-initial,
    .ark-search-results {
        padding: 0 40px;
    }
    
    .ark-search-initial > div {
        gap: 40px;
    }
    
    .ark-search-section:first-child {
        flex: 0 0 240px;
    }
}

@media (max-width: 968px) {
    .ark-search-initial > div {
        flex-direction: column;
        gap: 32px;
    }
    
    .ark-search-section:first-child {
        flex: 1;
    }
    
    .ark-popular-products,
    .ark-search-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ark-search-modal {
        padding: 0;
    }
    
    .ark-search-container {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        animation: slideInFromTop 0.3s ease;
    }
    
    @keyframes slideInFromTop {
        from {
            transform: translateY(-100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .ark-search-initial,
    .ark-search-results {
        padding: 0 24px;
    }
    
    .ark-popular-products,
    .ark-search-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .ark-search-header,
    .ark-search-input-wrapper {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 480px) {
    .ark-popular-products,
    .ark-search-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .ark-search-initial,
    .ark-search-results {
        padding: 0 16px;
    }
}
