/* 
 * BarnYard Search Page Styles
 * This file contains all styles specific to the search page functionality
 */

/* Search Hero Section */
.search-hero {
    background-color: #f8f5f0;
    padding: 60px 0;
    text-align: center;
}

.search-hero h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 30px;
}

.search-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.search-input-wrapper {
    display: flex;
    position: relative;
}

#search-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 5px 0 0 5px;
    transition: border-color 0.3s;
}

#search-input:focus {
    border-color: #5a8d3b;
    outline: none;
}

.search-btn {
    background-color: #5a8d3b;
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #4a7a2e;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f5f5f5;
}

.suggestion-item.selected {
    background-color: #f0f0f0;
}

/* Main Search Content */
.search-content {
    padding: 40px 0;
}

.search-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    min-height: 600px; /* Ensures minimum height for the grid */
}

/* Filters Sidebar */
.filters-sidebar {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 10;
}

.filters-header h3 {
    font-size: 18px;
    margin: 0;
}

.btn-text {
    background: none;
    border: none;
    color: #5a8d3b;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
}

.btn-text:hover {
    color: #4a7a2e;
    text-decoration: underline;
}

.btn-icon {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: #333;
}

.filters-body {
    padding: 10px 0 20px 0;
    overflow-y: auto;
    flex-grow: 1;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
    scroll-padding-top: 15px;
    scroll-padding-bottom: 15px;
}

.filters-body::-webkit-scrollbar {
    width: 8px;
}

.filters-body::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.filters-body::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.filters-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
    background-color: white;
    z-index: 10;
}

#back-to-top {
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.2s ease;
}

#back-to-top:hover {
    transform: translateY(-2px);
    color: #4a7a2e;
}

#back-to-top i {
    font-size: 12px;
}

.filter-group {
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    background-color: white;
}

.filter-header {
    cursor: pointer;
    padding: 10px 15px;
    background-color: white;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
    position: relative;
}

.filter-header:hover {
    background-color: #f5f5f5;
}

.filter-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.toggle-icon {
    font-size: 12px;
}

.filter-header.active {
    border-bottom-color: transparent;
}

.filter-header.active .toggle-icon i {
    transform: rotate(180deg);
}

.toggle-icon i {
    transition: transform 0.3s ease;
}

.filter-options {
    display: none;
    padding: 0;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1;
    position: relative;
}

.filter-options.active {
    display: block !important;
}

.filter-options > div {
    padding: 10px 15px;
}

/* Checkbox Styles */
.checkbox-option {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 10px;
}

.checkbox-option label {
    margin-left: 8px;
    flex-grow: 1;
}

.checkbox-count {
    color: #999;
    font-size: 0.9em;
}

/* Price Range Styles */
.price-range {
    padding: 10px 0;
}

.price-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.price-input-group {
    flex: 1;
}

.price-input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.price-input-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 14px;
}

/* Location Selects */
.location-selects {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.select-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.select-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

/* Brand Search */
.search-filter {
    margin-bottom: 15px;
}

.search-filter input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.brand-list {
    max-height: 200px;
    overflow-y: auto;
}

/* Star Rating */
.star-rating {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.stars {
    color: #ffc107;
    margin-right: 5px;
}

.rating-text {
    font-size: 14px;
}

/* Search Results */
.search-results {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.results-count {
    font-size: 16px;
    color: #666;
}

.results-count span {
    font-weight: 600;
    color: #333;
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-control label {
    font-size: 14px;
    color: #666;
}

.sort-control select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.view-control {
    display: flex;
    gap: 5px;
}

.view-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.view-btn:hover {
    background-color: #f5f5f5;
}

.view-btn.active {
    background-color: #5a8d3b;
    border-color: #5a8d3b;
    color: white;
}

/* Active Filters */
.active-filters {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.active-filter {
    display: flex;
    align-items: center;
    background-color: #f0f7eb;
    border: 1px solid #d4e5c5;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 14px;
}

.filter-remove {
    background: none;
    border: none;
    color: #5a8d3b;
    cursor: pointer;
    margin-left: 8px;
    font-size: 12px;
}

.filter-remove:hover {
    color: #4a7a2e;
}

/* Product Grid */
.product-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 200px;
    background-color: #f5f5f5;
    position: relative;
    overflow: hidden;
}

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

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #5a8d3b;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #5a8d3b;
    margin-bottom: 8px;
}

.product-location {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.product-seller {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.rating-stars {
    color: #ffc107;
    margin-right: 5px;
}

.rating-count {
    font-size: 12px;
    color: #999;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 15px;
}

.btn-view {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    background-color: #5a8d3b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-view:hover {
    background-color: #4a7a2e;
}

.btn-wishlist {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-left: 10px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.btn-wishlist:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.btn-wishlist.active {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
}

/* List View */
.product-grid.list-view {
    grid-template-columns: 1fr;
}

.product-grid.list-view .product-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    height: auto;
}

.product-grid.list-view .product-image {
    height: 100%;
}

.product-grid.list-view .product-info {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-grid.list-view .product-description {
    display: block;
    margin-bottom: 15px;
}

.product-description {
    display: none;
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    padding: 20px;
    border-top: 1px solid #eee;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background-color: white;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover {
    border-color: #5a8d3b;
    color: #5a8d3b;
}

.pagination-btn.active {
    background-color: #5a8d3b;
    border-color: #5a8d3b;
    color: white;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

.no-results h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.no-results p {
    font-size: 16px;
    color: #666;
}

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #5a8d3b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    font-size: 16px;
    color: #666;
}

/* Mobile Styles */
.mobile-only {
    display: none;
}

@media (max-width: 992px) {
    .search-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
    }
    
    .filters-sidebar.active {
        left: 0;
    }
    
    .filters-body {
        flex: 1;
        overflow-y: auto;
    }
    
    .mobile-only {
        display: block;
    }
    
    .btn-outline {
        border: 1px solid #5a8d3b;
        color: #5a8d3b;
        background: none;
        padding: 8px 15px;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .btn-outline:hover {
        background-color: #5a8d3b;
        color: white;
    }
}

@media (max-width: 768px) {
    .search-hero {
        padding: 40px 0;
    }
    
    .search-hero h2 {
        font-size: 24px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-count {
        margin-bottom: 10px;
    }
    
    .results-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .product-grid.list-view .product-card {
        grid-template-columns: 1fr;
    }
    
    .product-grid.list-view .product-image {
        height: 200px;
    }
    
    .product-grid.list-view .product-info {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }
    
    .product-grid.list-view .product-actions {
        margin-top: auto;
        padding-top: 15px;
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* Product Details for Cattle */
.product-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.detail-item {
    display: flex;
    font-size: 14px;
    margin-bottom: 5px;
}

.detail-label {
    font-weight: 600;
    color: #666;
    margin-right: 5px;
}

.detail-value {
    color: #333;
}

/* Adjust list view for cattle products */
.product-grid.list-view .product-details {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 10px;
}

@media (max-width: 768px) {
    .product-details {
        grid-template-columns: 1fr;
    }
    
    .product-grid.list-view .product-details {
        grid-template-columns: 1fr;
    }
}

/* Animal Filter Styles */
.cattle-filter,
.horse-filter {
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    background-color: white;
}

.cattle-filter .filter-options,
.horse-filter .filter-options {
    max-height: 250px;
    overflow-y: auto;
}

.cattle-filter .filter-options.active,
.horse-filter .filter-options.active {
    display: block !important;
}

/* Proximity Filter Styles */
.proximity-filter {
    padding: 15px 0;
    border-top: 1px solid #eee;
}

.proximity-filter label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #333;
}

.proximity-filter input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
    -webkit-appearance: none;
    height: 5px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
}

.proximity-filter input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.proximity-filter input[type="range"]::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.proximity-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

/* Horse Filter Styles */
.horse-filter {
    margin-bottom: 10px;
}

.horse-filter .filter-options {
    max-height: 250px;
    overflow-y: auto;
}

/* Wishlist Message Notification */
.wishlist-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slide-in 0.3s ease-out;
    max-width: 350px;
}

.wishlist-message.success {
    background-color: #4a7c59;
}

.wishlist-message i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.wishlist-message a {
    margin-left: 10px;
    color: white;
    text-decoration: underline;
    font-weight: bold;
}

.wishlist-message.fade-out {
    animation: fade-out 0.3s ease-in forwards;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fade-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Category and Subcategory Styling */
.category-container {
    margin-bottom: 8px;
}

.category-option {
    font-weight: 500;
}

.inline-subcategories {
    margin-top: 5px;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease-in-out;
}

.inline-subcategories .checkbox-option {
    margin-top: 5px;
    font-size: 0.95em;
}

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

/* Hide specific filters without removing their functionality */
#availability-filter,
#delivery-filter, 
#discount-filter,
#date-filter,
#subcategory-filter {
    display: none !important;
} 