/*
 * Elementor Page Catalog - Frontend Styles
 */

#epc-catalog-wrapper {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.epc-filters {
    flex: 0 0 250px; /* Fixed width for the filter sidebar */
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 5px;
    align-self: flex-start; /* Align to the top */
    background: #f9f9f9;
}

.epc-filter-group {
    margin-bottom: 20px;
}

.epc-filter-group h4 {
    cursor: pointer;
    position: relative;
    user-select: none; /* Prevent text selection on click */
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.epc-filter-group h4::after {
    content: '\25B2'; /* Up arrow */
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.epc-filter-group.collapsed h4::after {
    transform: translateY(-50%) rotate(180deg); /* Down arrow */
}

.epc-filter-options {
    display: block;
    max-height: 1000px; /* Large value for open state */
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
    padding-top: 10px;
}

.epc-filter-group.collapsed .epc-filter-options {
    max-height: 0;
    padding-top: 0;
}

.epc-filter-group label {
    display: flex;
    align-items: center; /* Vertically center align checkbox and text */
    margin-bottom: 8px;
    font-weight: normal;
    cursor: pointer;
    line-height: 1.4;
}

.epc-filter-group input[type="checkbox"] {
    flex-shrink: 0;
    margin-right: 8px;
}

.epc-product-grid {
    flex: 1; /* Takes up the remaining space */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    transition: opacity 0.3s ease-in-out;
}

.epc-product-card {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

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

.epc-card-image-link {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f0f0f0;
}

.epc-card-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.epc-card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.epc-card-title {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.epc-card-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

.epc-card-title a:hover {
    color: #0073aa;
}

.epc-card-attributes {
    margin-top: auto; /* Pushes attributes to the bottom */
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
    color: #666;
}

.epc-card-attributes .epc-attribute {
    display: block;
    margin-bottom: 4px;
}

.epc-card-attributes .epc-attribute:last-child {
    margin-bottom: 0;
}


/* Breadcrumb */
.epc-breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.epc-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.epc-breadcrumb a:hover {
    color: #005a87;
}

.epc-breadcrumb-separator {
    margin: 0 8px;
    color: #999;
}

.epc-breadcrumb-current {
    color: #333;
    font-weight: 500;
}


/* Responsive */
@media (max-width: 768px) {
    #epc-catalog-wrapper {
        flex-direction: column;
    }

    .epc-filters {
        flex-basis: auto; /* Full width */
        width: 100%;
    }

    .epc-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}
