/* ==========================================
   CATALOG MAIN PAGE STYLES - CLEAN & PROFESSIONAL
   ========================================== */

/* Page Header */
.catalog-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 3rem 0;
    margin-bottom: 2.5rem;
    position: relative;
}

.catalog-header .breadcrumbs {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1rem;
}

.catalog-header .breadcrumbs a {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.catalog-header .breadcrumbs a:hover {
    opacity: 0.8;
}

.catalog-header .separator {
    margin: 0 0.5rem;
    color: rgba(255, 255, 255, 0.6);
}

.catalog-header .current {
    color: rgba(255, 255, 255, 0.95);
}

.catalog-header .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 1rem 0;
    letter-spacing: 0.5px;
}

.catalog-header .page-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    line-height: 1.6;
}

/* Toolbar */
.catalog-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.search-box {
    flex: 1;
    position: relative;
    max-width: 450px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s;
    background: #ffffff;
}

.search-input:focus {
    outline: none;
    border-color: #1e3c72;
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    border-radius: 4px;
}

.search-clear:hover {
    background: #f8f9fa;
}

.filter-toggle-btn {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.filter-toggle-btn:hover {
    border-color: #1e3c72;
    color: #1e3c72;
}

.filter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc3545;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 992px) {
    .filter-toggle-btn {
        display: flex;
    }
}

/* Main Layout */
.catalog-main {
    padding: 1.5rem 0 3rem;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
}

@media (max-width: 992px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.catalog-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
}

@media (max-width: 992px) {
    .catalog-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .catalog-sidebar.active {
        transform: translateX(0);
    }
}

.filter-section {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

@media (max-width: 992px) {
    .filter-section {
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        border-radius: 0;
        overflow-y: auto;
    }
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #1e3c72;
}

.filter-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.filter-close {
    display: none;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
}

.filter-close:hover {
    background: #f8f9fa;
}

@media (max-width: 992px) {
    .filter-close {
        display: flex;
    }
}

/* Filter Groups */
.filter-group {
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.filter-group:last-of-type {
    border-bottom: none;
}

.filter-group-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    padding: 0.625rem 0;
    cursor: pointer;
}

.filter-group-toggle.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.filter-group-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
    text-align: left;
}

.toggle-icon {
    transition: transform 0.2s ease;
    color: #6c757d;
}

.filter-options {
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-bottom: 0.75rem;
}

.filter-options.collapsed {
    max-height: 0;
    padding-bottom: 0;
}

.filter-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.375rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s;
    border-radius: 4px;
}

.filter-checkbox:hover {
    background-color: #f8f9fa;
}

.filter-checkbox-compact {
    padding: 0.375rem 0.5rem;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 0.625rem;
    cursor: pointer;
    accent-color: #1e3c72;
    flex-shrink: 0;
}

.filter-checkbox span {
    font-size: 0.875rem;
    color: #495057;
}

.btn-reset {
    width: 100%;
    padding: 0.75rem;
    background: #1e3c72;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-reset:hover {
    background: #163159;
}

/* Results Info */
.results-info {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1.25rem;
}

.results-info span {
    color: #1e3c72;
    font-weight: 600;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.75rem;
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Category Card */
.category-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #1e3c72;
}

.category-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-card__image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
    overflow: hidden;
}

.category-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.category-card:hover .category-card__image {
    transform: scale(1.05);
}

.category-card__icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 2;
}

.category-card__icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.category-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.85) 0%, rgba(42, 82, 152, 0.85) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover .category-card__overlay {
    opacity: 1;
}

.overlay-text {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Card Content */
.category-card__content {
    padding: 1.5rem;
}

.category-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.category-card__description {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-card__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.category-card__spec {
    display: inline-flex;
    padding: 0.25rem 0.625rem;
    background: #e3f2fd;
    color: #1565c0;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    white-space: nowrap;
}

.category-card__count {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.category-card__count svg {
    color: #1e3c72;
}

.category-card__button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #1e3c72;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: gap 0.2s;
}

.category-card:hover .category-card__button {
    gap: 0.75rem;
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.no-results svg {
    color: #adb5bd;
}

.no-results p {
    font-size: 1.125rem;
    color: #6c757d;
    margin: 0;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Responsive */
@media (max-width: 1200px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .catalog-header {
        padding: 2.5rem 0;
    }

    .catalog-header .page-title {
        font-size: 2.25rem;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .catalog-header {
        padding: 2rem 0;
    }

    .catalog-header .page-title {
        font-size: 2rem;
    }

    .catalog-header .page-description {
        font-size: 0.9375rem;
    }

    .catalog-toolbar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-box {
        max-width: 100%;
    }

    .filter-toggle-btn {
        width: 100%;
        justify-content: center;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .category-card__image-wrapper {
        height: 180px;
    }
}

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

@media (max-width: 480px) {
    .catalog-header {
        padding: 1.5rem 0;
    }

    .catalog-header .page-title {
        font-size: 1.75rem;
    }

    .catalog-header .page-description {
        font-size: 0.875rem;
    }

    .categories-grid {
        gap: 1.25rem;
    }

    .category-card__image-wrapper {
        height: 160px;
    }

    .category-card__content {
        padding: 1.25rem;
    }

    .category-card__title {
        font-size: 1rem;
    }
}

@media (max-width: 360px) {
    .catalog-header .page-title {
        font-size: 1.5rem;
    }

    .category-card__image-wrapper {
        height: 140px;
    }
}

/* Print */
@media print {
    .catalog-sidebar,
    .catalog-toolbar,
    .category-card__button {
        display: none !important;
    }

    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .category-card {
        break-inside: avoid;
        box-shadow: none;
    }
}
