/* Rozen Advanced Search Styles */

:root {
    --rozen-primary: #3C0C0C;
    --rozen-accent: #E8C5B5;
    --rozen-text: #333;
    --rozen-border: #e0e0e0;
    --rozen-hover: #f9f9f9;
    --rozen-shadow: rgba(0, 0, 0, 0.1);
}

.rozen-search-wrapper {
    width: 100%;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.rozen-search-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* Search Input Wrapper */
.rozen-search-input-wrapper {
    position: relative;
    width: 100%;
}

.rozen-search-input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    font-size: 16px;
    border: 2px solid var(--rozen-border);
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
    color: var(--rozen-text);
    box-sizing: border-box;
}

.rozen-search-input:focus {
    border-color: var(--rozen-accent);
    box-shadow: 0 4px 12px var(--rozen-shadow);
}

.rozen-search-input::placeholder {
    color: #999;
}

/* Search Icon */
.rozen-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rozen-primary);
    pointer-events: none;
}

/* Loading Spinner */
.rozen-search-spinner {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.rozen-search-spinner .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--rozen-border);
    border-top-color: var(--rozen-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Container */
.rozen-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--rozen-shadow);
    max-height: 600px;
    overflow-y: auto;
    z-index: 999999;
    padding: 20px;
    box-sizing: border-box;
    width: max-content;
    min-width: 100%;
    max-width: 95vw;
}

.rozen-search-results::-webkit-scrollbar {
    width: 8px;
}

.rozen-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.rozen-search-results::-webkit-scrollbar-thumb {
    background: var(--rozen-accent);
    border-radius: 10px;
}

.rozen-search-results::-webkit-scrollbar-thumb:hover {
    background: #d4b5a5;
}

/* Section Headers */
.rozen-search-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--rozen-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
    padding: 0 8px;
}

.rozen-search-section-title:not(:first-child) {
    margin-top: 24px;
}

/* Product Items */
.rozen-search-products {
    display: grid;
    gap: 16px;
    margin-bottom: 12px;
    /* grid-template-columns will be set via inline CSS based on admin settings */
    width: max-content;
}

.rozen-search-product-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    background: #fff;
    border: 1px solid transparent;
    min-width: 160px;
    max-width: 200px;
}

.rozen-search-product-item:hover {
    background: var(--rozen-hover);
    border-color: var(--rozen-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--rozen-shadow);
}

.rozen-search-product-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f9f9f9;
}

.rozen-search-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rozen-search-product-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--rozen-text);
    margin: 0 0 6px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rozen-search-product-category {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rozen-search-product-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--rozen-primary);
    margin-top: auto;
}

.rozen-search-product-price .woocommerce-Price-amount {
    font-weight: 600;
}

/* Category Items */
.rozen-search-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.rozen-search-category-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    background: #fff;
    border: 1px solid var(--rozen-border);
}

.rozen-search-category-item:hover {
    background: var(--rozen-hover);
    border-color: var(--rozen-accent);
    transform: translateX(4px);
}

.rozen-search-category-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 12px;
    background: #f9f9f9;
    flex-shrink: 0;
}

.rozen-search-category-info {
    flex: 1;
    min-width: 0;
}

.rozen-search-category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--rozen-text);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rozen-search-category-count {
    font-size: 12px;
    color: #999;
}

/* View All Link */
.rozen-search-view-all {
    display: block;
    text-align: center;
    padding: 14px 20px;
    background: var(--rozen-accent);
    color: var(--rozen-primary);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-top: 16px;
}

.rozen-search-view-all:hover {
    background: #d4b5a5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--rozen-shadow);
}

/* No Results */
.rozen-search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.rozen-search-no-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.rozen-search-no-results-text {
    font-size: 16px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rozen-search-categories {
        grid-template-columns: 1fr;
    }
    
    .rozen-search-results {
        max-height: 500px;
        padding: 16px;
    }
    
    .rozen-search-input {
        font-size: 14px;
        padding: 12px 45px 12px 16px;
    }
}

@media (max-width: 480px) {
    .rozen-search-product-item {
        flex-direction: row;
        align-items: center;
    }
    
    .rozen-search-product-image {
        width: 80px;
        height: 80px;
        margin-right: 12px;
        margin-bottom: 0;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rozen-search-results {
    animation: fadeIn 0.3s ease;
}
