/* Search Page Styles */

/* Product Card Equal Height Layout */
.products-grid .product-card,
.search-results-grid .search-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.products-grid .product-card .product-info,
.search-results-grid .search-product-card .product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.products-grid .product-card .product-info-content,
.search-results-grid .search-product-card .product-info-content {
    flex: 1;
    min-height: auto;
}

.search-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.search-page-header {
    text-align: center;
    margin-bottom: 40px;
}

.search-page-header h1 {
    color: #338E5E;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.search-page-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.search-form-container {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.product-search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #338E5E;
}

.search-submit-btn {
    position: absolute;
    right: 8px;
    background: #338E5E;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit-btn:hover {
    background: #1e3d1e;
}

.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #338E5E;
}

.search-results-container {
    min-height: 400px;
}

.search-results-header {
    margin-bottom: 30px;
    text-align: center;
}

.search-results-header h2 {
    color: #338E5E;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.search-results-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.search-product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.search-product-card .product-image-wrapper {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8f9fa;
}

.search-product-card .product-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.search-product-card .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search-product-card:hover .product-image {
    transform: scale(1.05);
}

/* Product Badges for search cards */
.search-product-card .product-badge {
    position: absolute;
    top: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.search-product-card .sale-badge {
    left: 10px;
    background: #ff6b35;
    color: white;
}

.product-info {
    padding: 15px 15px 20px 15px;
}

.product-title {
    margin-bottom: 8px;
    height: 28px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.product-title a {
    color: #333;
    text-decoration: none;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #338E5E;
}

.product-categories {
    margin-bottom: 15px;
}

.product-categories a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.product-categories a:hover {
    color: #338E5E;
}

.regular-price {
    color: #999;
    text-decoration: line-through;
    font-size: 16px;
}

.sale-price,
.current-price {
    color: #338E5E;
    font-weight: 700;
    font-size: 20px;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.add-to-cart-btn {
    flex: 1;
    background: #338E5E;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-to-cart-btn:hover {
    background: #1e3d1e;
}

.search-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.search-pagination .page-numbers {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.search-pagination .page-numbers li {
    margin: 0;
}

.search-pagination .page-numbers a,
.search-pagination .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-pagination .page-numbers a:hover,
.search-pagination .page-numbers .current {
    background: #338E5E;
    color: white;
    border-color: #338E5E;
}

.no-search-results,
.search-placeholder {
    text-align: center;
    padding: 60px 20px;
}

.no-results-icon,
.placeholder-icon {
    margin-bottom: 20px;
    color: #ccc;
}

.no-search-results h3,
.search-placeholder h3 {
    color: #338E5E;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

.no-search-results p,
.search-placeholder p {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
}

.no-results-suggestions {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.no-results-suggestions h4 {
    color: #338E5E;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.no-results-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.no-results-suggestions li {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.no-results-suggestions li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #338E5E;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.notification.success {
    background: #338E5E;
}

.notification.error {
    background: #dc3545;
}

/* Favorite button styles for search page product cards */
.search-product-card .product-image-wrapper {
    position: relative;
}

.search-product-card .favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
    z-index: 10;
}

.search-product-card .favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.search-product-card .favorite-btn.favorite-active {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
}

.search-product-card .favorite-btn.favorite-active svg {
    color: #e74c3c;
}

.search-product-card .favorite-btn.login-required {
    background: rgba(255, 255, 255, 0.9);
    border-color: #ccc;
}

.search-product-card .favorite-btn.login-required svg {
    color: #999;
}

.search-product-card .favorite-btn svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

/* Product rating styles */
.search-product-card .product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.search-product-card .product-rating .stars {
    display: flex;
    gap: 2px;
}

.search-product-card .product-rating .star {
    color: #ddd;
    font-size: 16px;
}

.search-product-card .product-rating .star.filled {
    color: #FFD700;
}

.search-product-card .product-rating .rating-text {
    font-size: 12px;
    color: #666;
}

/* Out of stock styling */
.search-product-card .out-of-stock {
    display: block !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #999 !important;
    text-align: center !important;
    padding: 12px 24px !important;
    background: #f5f5f5 !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    cursor: not-allowed !important;
}

/* Responsive adjustments for search page */
@media (max-width: 768px) {
    .search-page-container {
        padding: 20px 15px;
    }

    .search-page-header h1 {
        font-size: 24px;
    }

    .search-form-container {
        padding: 20px;
    }

    .search-filters {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Maintain aspect ratio on mobile */
    .search-product-card .product-image-wrapper {
        aspect-ratio: 1 / 1;
    }

    .product-info {
        padding: 15px;
    }

    .product-title {
        height: 28px;
    }

    .product-title a {
        font-size: 18px;
    }

    .sale-price,
    .current-price {
        font-size: 18px;
    }
    
    .original-price,
    .regular-price {
        font-size: 14px;
    }
}

