@import url('components/product-card.css');

/* Flexbox Order Definitions for Main Sections */
.page-container {
    display: flex;
    flex-direction: column;
}

.page-container .hero-section { order: 1; }
.page-container .products-section { order: 2; }
.page-container .cta-section { order: 3; }

/* Custom Title Styling */
.custom-title {
    font-size: 48px;
    display: flex;
    flex-direction: row;
    line-height: 1;
    align-items: flex-start;
    margin-top: 30px;
}

.first-letter {
    font-size: 96px;
    color: var(--color-secondary);
    line-height: 0.8;
    margin-right: 5px;
    margin-top: -20px;
}

.rest-of-title {
    padding-top: 10px;
}

/* Filter Sections */
.filter-section {
    padding: 20px;
    border-bottom: 1px solid var(--color-light-gray);
    animation: fadeIn 0.3s ease-out forwards;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section h4 {
    font-size: 1.1rem;
    color: var(--color-secondary);
    margin-bottom: 15px;
    font-weight: 600;
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box input {
    padding-right: 35px;
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-dark-gray);
    cursor: pointer;
    padding: 5px;
    display: none;
}

.search-clear.visible {
    display: block;
}

/* Sort Buttons */
.sort.btn {
    position: relative;
    text-align: left;
    padding-right: 30px;
}

.sort.btn i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

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

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

/* Category Filters */
.category-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Filter Refinements */
.filter-section .form-check {
    margin-bottom: 8px;
}

.filter-section .form-check:last-child {
    margin-bottom: 0;
}

.filter-section .form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-range {
    height: 6px;
    background-color: var(--color-light-gray);
}

.form-range::-webkit-slider-thumb {
    background: var(--color-primary);
    width: 18px;
    height: 18px;
}

.form-range::-moz-range-thumb {
    background: var(--color-primary);
    width: 18px;
    height: 18px;
}

.input-group-text {
    background-color: var(--color-secondary);
    color: var(--color-white);
    border: none;
}

/* Apply/Reset Buttons */
.apply-filters,
.reset-filters {
    width: 100%;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.apply-filters i,
.reset-filters i {
    font-size: 0.9em;
}

/* Pagination Refinements */
.pagination {
    margin-top: 30px;
    gap: 5px;
}

.pagination .page-link {
    border: none;
    padding: 8px 16px;
    color: var(--color-secondary);
    background-color: var(--color-off-white);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.pagination .page-item.disabled .page-link {
    background-color: var(--color-light-gray);
    color: var(--color-dark-gray);
    cursor: not-allowed;
}

/* Empty State */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-dark-gray);
}

.no-results i {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--color-light-gray);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger Animations */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }

.filter-section:nth-child(1) { animation-delay: 0.1s; }
.filter-section:nth-child(2) { animation-delay: 0.2s; }
.filter-section:nth-child(3) { animation-delay: 0.3s; }
.filter-section:nth-child(4) { animation-delay: 0.4s; }

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1;
}

/* Responsive Styles */
@media (max-width: 991px) {
    .product-filters {
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .custom-title {
        font-size: 36px;
    }

    .first-letter {
        font-size: 72px;
    }

    .filter-section {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .custom-title {
        font-size: 28px;
        margin-top: 20px;
    }

    .first-letter {
        font-size: 56px;
        margin-top: -2px;
    }

    .price-inputs {
        flex-direction: column;
    }

    .pagination .page-link {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}