/* ══════════════════════════════════════════════════════════
   Dima Shop - Advanced Search Styles
   نسخه: 1.0.0
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   Search Bar اصلی
   ═══════════════════════════════════════════════════════════ */
.dima-search-wrapper {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.dima-search-bar {
    position: relative;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.dima-search-bar:focus-within {
    box-shadow: 0 15px 50px rgba(0, 191, 165, 0.15);
    border-color: #00bfa5;
    transform: translateY(-2px);
}

.dima-search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 8px;
}

.dima-search-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 20px;
    transition: color 0.3s;
}

.dima-search-bar:focus-within .dima-search-icon {
    color: #00bfa5;
}

.dima-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 12px 0;
    font-family: inherit;
    background: transparent;
    color: #1f2937;
}

.dima-search-input::placeholder {
    color: #9ca3af;
}

.dima-search-clear {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.dima-search-clear:hover {
    background: #e5e7eb;
    color: #ef4444;
}

.dima-search-clear.visible {
    display: flex;
}

.dima-search-submit {
    background: linear-gradient(135deg, #00bfa5, #009688);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dima-search-submit:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 191, 165, 0.4);
}

/* ═══════════════════════════════════════════════════════════
   Live Search Results (Dropdown)
   ═══════════════════════════════════════════════════════════ */
.dima-live-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    animation: slideDown 0.3s ease;
}

.dima-live-results.active {
    display: block;
}

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

.dima-live-results-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 20px 20px 0 0;
}

.dima-live-results-title {
    font-size: 14px;
    font-weight: 700;
    color: #6b7280;
}

.dima-live-results-count {
    background: #00bfa5;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.dima-live-results-body {
    padding: 10px;
}

.dima-live-result-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    border-radius: 14px;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.dima-live-result-item:hover {
    background: #f0fdfa;
    transform: translateX(-4px);
}

.dima-live-result-image {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f9fafb;
}

.dima-live-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dima-live-result-info {
    flex: 1;
    min-width: 0;
}

.dima-live-result-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dima-live-result-title mark {
    background: #fef3c7;
    color: #92400e;
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 800;
}

.dima-live-result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.dima-live-result-category {
    font-size: 12px;
    color: #00bfa5;
    font-weight: 600;
    background: #f0fdfa;
    padding: 3px 10px;
    border-radius: 8px;
}

.dima-live-result-rating {
    font-size: 12px;
    color: #fbbf24;
}

.dima-live-result-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.dima-live-result-price-current {
    font-size: 16px;
    font-weight: 900;
    color: #00bfa5;
}

.dima-live-result-price-old {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
}

.dima-live-result-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ef4444;
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.dima-live-result-empty {
    text-align: center;
    padding: 40px 20px;
}

.dima-live-result-empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.dima-live-result-empty-text {
    color: #6b7280;
    font-size: 14px;
}

.dima-live-result-loading {
    text-align: center;
    padding: 40px 20px;
}

.dima-live-result-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #00bfa5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

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

.dima-live-results-footer {
    padding: 12px 20px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}

.dima-live-results-footer a {
    color: #00bfa5;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.dima-live-results-footer a:hover {
    color: #009688;
}

/* ═══════════════════════════════════════════════════════════
   Search Results Page (صفحه کامل نتایج)
   ═══════════════════════════════════════════════════════════ */
.dima-search-results-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.dima-search-results-header {
    background: linear-gradient(135deg, #00bfa5 0%, #009688 100%);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 40px;
    color: white;
    box-shadow: 0 10px 40px rgba(0, 191, 165, 0.3);
}

.dima-search-results-title {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dima-search-results-query {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 16px;
    border-radius: 12px;
    font-weight: 700;
}

.dima-search-results-stats {
    font-size: 16px;
    opacity: 0.95;
}

.dima-search-results-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* Sidebar فیلترها */
.dima-search-filters {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.dima-filter-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f3f4f6;
}

.dima-filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.dima-filter-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dima-filter-title i {
    color: #00bfa5;
}

.dima-filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dima-filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.dima-filter-option:hover {
    background: #f0fdfa;
}

.dima-filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #00bfa5;
}

.dima-filter-option label {
    flex: 1;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

.dima-filter-option-count {
    font-size: 12px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 6px;
}

.dima-filter-price-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dima-filter-price-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.dima-filter-price-input:focus {
    outline: none;
    border-color: #00bfa5;
}

.dima-filter-apply-btn {
    width: 100%;
    background: linear-gradient(135deg, #00bfa5, #009688);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    margin-top: 15px;
}

.dima-filter-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 191, 165, 0.4);
}

/* Results Grid */
.dima-search-results-content {
    min-height: 400px;
}

.dima-search-results-toolbar {
    background: white;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.dima-search-results-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dima-search-results-sort label {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}

.dima-search-results-sort select {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.dima-search-results-sort select:focus {
    outline: none;
    border-color: #00bfa5;
}

.dima-search-results-view {
    display: flex;
    gap: 8px;
}

.dima-view-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.dima-view-btn.active {
    background: #00bfa5;
    color: white;
}

.dima-view-btn:hover:not(.active) {
    background: #e5e7eb;
}

/* Products Grid */
.dima-search-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.dima-search-products-grid.list-view {
    grid-template-columns: 1fr;
}

.dima-search-products-grid.list-view .dima-search-product-card {
    display: grid;
    grid-template-columns: 200px 1fr;
}

.dima-search-products-grid.list-view .dima-search-product-image {
    aspect-ratio: auto;
    height: 200px;
}

/* Product Card */
.dima-search-product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    border: 1px solid #e5e7eb;
    position: relative;
}

.dima-search-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: #00bfa5;
}

.dima-search-product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f9fafb;
}

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

.dima-search-product-card:hover .dima-search-product-image img {
    transform: scale(1.08);
}

.dima-search-product-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dima-search-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.dima-search-badge-sale {
    background: #ef4444;
}

.dima-search-badge-new {
    background: #00bfa5;
}

.dima-search-badge-hot {
    background: #f59e0b;
}

.dima-search-product-actions {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s;
}

.dima-search-product-card:hover .dima-search-product-actions {
    opacity: 1;
    transform: translateX(0);
}

.dima-search-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    color: #4b5563;
}

.dima-search-action-btn:hover {
    background: #00bfa5;
    color: white;
    transform: scale(1.1);
}

.dima-search-action-btn.wishlist.active {
    background: #ef4444;
    color: white;
}

.dima-search-product-info {
    padding: 18px;
}

.dima-search-product-category {
    display: inline-block;
    background: #f0fdfa;
    color: #00bfa5;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

.dima-search-product-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.5;
    height: 45px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dima-search-product-title mark {
    background: #fef3c7;
    color: #92400e;
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 800;
}

.dima-search-product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.dima-search-product-title a:hover {
    color: #00bfa5;
}

.dima-search-product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.dima-search-product-stars {
    display: flex;
    gap: 2px;
    color: #fbbf24;
    font-size: 13px;
}

.dima-search-product-stars .empty {
    color: #d1d5db;
}

.dima-search-product-rating-count {
    font-size: 12px;
    color: #6b7280;
}

.dima-search-product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.dima-search-product-price-current {
    font-size: 20px;
    font-weight: 900;
    color: #00bfa5;
}

.dima-search-product-price-old {
    font-size: 14px;
    color: #9ca3af;
    text-decoration: line-through;
}

.dima-search-product-currency {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.dima-search-product-add-btn {
    width: 100%;
    background: linear-gradient(135deg, #00bfa5, #009688);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dima-search-product-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 191, 165, 0.4);
}

.dima-search-product-add-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Empty State */
.dima-search-empty {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.dima-search-empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.dima-search-empty-title {
    font-size: 24px;
    font-weight: 900;
    color: #1f2937;
    margin-bottom: 10px;
}

.dima-search-empty-text {
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 30px;
}

.dima-search-empty-suggestions {
    max-width: 500px;
    margin: 0 auto;
}

.dima-search-suggestion-title {
    font-size: 14px;
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 12px;
}

.dima-search-suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.dima-search-suggestion-tag {
    background: #f0fdfa;
    color: #00bfa5;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.dima-search-suggestion-tag:hover {
    background: #00bfa5;
    color: white;
    border-color: #00bfa5;
}

/* Pagination */
.dima-search-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.dima-search-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    margin: 0 4px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: #4b5563;
    font-weight: 600;
    transition: all 0.2s;
}

.dima-search-pagination .page-numbers:hover,
.dima-search-pagination .page-numbers.current {
    background: #00bfa5;
    color: white;
    border-color: #00bfa5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 191, 165, 0.3);
}

/* Loading Skeleton */
.dima-search-skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 12px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 1024px) {
    .dima-search-results-layout {
        grid-template-columns: 1fr;
    }
    
    .dima-search-filters {
        position: static;
    }
}

@media (max-width: 768px) {
    .dima-search-results-header {
        padding: 25px;
    }
    
    .dima-search-results-title {
        font-size: 24px;
    }
    
    .dima-search-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .dima-search-product-info {
        padding: 12px;
    }
    
    .dima-search-product-title {
        font-size: 13px;
        height: 40px;
    }
    
    .dima-search-product-price-current {
        font-size: 16px;
    }
    
    .dima-search-results-toolbar {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .dima-search-products-grid {
        grid-template-columns: 1fr;
    }
    
    .dima-search-submit {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Scrollbar Styling */
.dima-live-results::-webkit-scrollbar,
.dima-search-filters::-webkit-scrollbar {
    width: 6px;
}

.dima-live-results::-webkit-scrollbar-track,
.dima-search-filters::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.dima-live-results::-webkit-scrollbar-thumb,
.dima-search-filters::-webkit-scrollbar-thumb {
    background: #00bfa5;
    border-radius: 10px;
}

.dima-live-results::-webkit-scrollbar-thumb:hover,
.dima-search-filters::-webkit-scrollbar-thumb:hover {
    background: #009688;
}