/**
 * WooCommerce Moderne Kategori Filter CSS
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

.wc-modern-filter {
    margin-bottom: 30px;
    font-family: 'Inter', sans-serif;
	border: 1px solid #e3e3e3;
	padding:10px;
	border-radius:6px;
}


.wc-modern-filter-title {
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    text-align: left;
}

.wc-modern-filter-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
}

.wc-modern-filter[data-columns="2"] .wc-modern-filter-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.wc-modern-filter[data-columns="4"] .wc-modern-filter-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.wc-modern-filter-cat-container {
    position: relative;
}

.wc-modern-filter-cat-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.wc-modern-filter-cat {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background-color: #fcfcfc;
    border-radius: 3px;
    transition: all 0.3s ease;
    border: 1px solid #e3e3e3; /* #1E8449 med transparency */
    height: 100%;
}

.wc-modern-filter-cat:hover {
    background-color: #f0f0f0;
}

.wc-modern-filter-cat-image {
    overflow: hidden;
    border-radius: 6px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    position: relative;
}

.wc-modern-filter-cat-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.wc-modern-filter-cat:hover .wc-modern-filter-cat-image img {
    transform: scale(1.05);
}

.wc-modern-filter-cat-info {
    flex-grow: 1;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 15px;
}

.wc-modern-filter-cat-name {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
	color:#4d4d4d;
}

.wc-modern-filter-count {
    font-size: 11px;
    color: white;
    margin-left: 8px;
    background-color: rgba(30, 132, 73, 0.6);
    border-radius: 50px;
    padding: 3px 8px;
    min-width: 24px;
    text-align: center;
    display: inline-block;
}

/* Underkategori styling */
.wc-modern-filter-subcats {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.6s ease, max-height 0.7s ease, margin-top 0.6s ease;
    margin-top: 0;
    pointer-events: none;
}

.wc-modern-filter-cat-container:hover .wc-modern-filter-subcats {
    opacity: 1;
    max-height: 500px; /* Højt nok til at vise alle underkategorier */
    margin-top: 0px;
    pointer-events: auto;
    transition: opacity 0.6s ease, max-height 0.7s ease, margin-top 0.6s ease;
}

/* Hurtigere hover-out animation */
.wc-modern-filter-cat-container:not(:hover) .wc-modern-filter-subcats {
    transition: opacity 0.25s ease, max-height 0.3s ease, margin-top 0.25s ease;
}

/* Klasse til ekstra hurtig fade-out (bruges via JavaScript) */
.wc-modern-filter-fade-out {
    opacity: 0 !important;
    max-height: 0 !important;
    margin-top: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.25s ease, max-height 0.3s ease, margin-top 0.25s ease !important;
}

.wc-modern-filter-subcats ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wc-modern-filter-subcats li {
    padding: 0;
    margin: 0;
}

.wc-modern-filter-subcats a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.5s ease, transform 0.6s ease;
    margin-bottom: 3px;
    transform: translateY(-5px);
    opacity: 0;
    border-radius: 3px;
    background-color: #f7f7f7;
    border: 1px solid #e3e3e3;
    font-size: 13px;
}

.wc-modern-filter-cat-container:hover .wc-modern-filter-subcats a {
    transform: translateY(0);
    opacity: 1;
    transition-delay: calc(var(--item-index, 0) * 0.08s);
}

/* Hurtigere hover-out animation for links */
.wc-modern-filter-cat-container:not(:hover) .wc-modern-filter-subcats a {
    transform: translateY(-5px);
    opacity: 0;
    transition: all 0.2s ease;
    transition-delay: 0s !important; /* Fjerner alle delays ved hover-out */
}

/* Hurtigere fade-out af links via JavaScript klasse */
.wc-modern-filter-fade-out a {
    transform: translateY(-5px) !important;
    opacity: 0 !important;
    transition: all 0.2s ease !important;
    transition-delay: 0s !important;
}

.wc-modern-filter-subcats a:hover {
    background-color: #f0f0f0;
    transform: translateX(3px);
    border-color: #e3e3e3;
    transition: all 0.3s ease;
}

.wc-modern-filter-subcats .wc-modern-filter-count {
    font-size: 10px;
    padding: 2px 6px;
    min-width: 18px;
}

/* Fix for at sikre konsistent mellemrum */
.wc-modern-filter-cat-container {
    margin-bottom: 0;
}

/* Active category styling */
.wc-modern-filter-current-cat {
    background-color: rgba(30, 132, 73, 0.1);
    border-color: rgba(30, 132, 73, 0.6);
    box-shadow: 0 3px 8px rgba(30, 132, 73, 0.15);
}

/* Keep subcategories visible when active */
.wc-modern-filter-subcats-active {
    opacity: 1 !important;
    max-height: 500px !important;
    margin-top: 10px !important;
    pointer-events: auto !important;
    transition: opacity 0.6s ease, max-height 0.7s ease, margin-top 0.6s ease;
}

.wc-modern-filter-subcats-active a {
    transform: translateY(0) !important;
    opacity: 1 !important;
    transition-delay: calc(var(--item-index, 0) * 0.08s);
}

/* Active subcategory styling */
.wc-modern-filter-active-subcat {
    background-color: rgba(30, 132, 73, 0.1);
    border-color: rgba(30, 132, 73, 0.5);
    transform: translateX(3px);
    font-weight: 500;
}

/* Additional CSS to ensure subcategories remain visible properly */
.wc-modern-filter-cat-active:not(:hover) .wc-modern-filter-subcats-active {
    opacity: 1 !important;
    max-height: 500px !important;
    margin-top: 10px !important;
    pointer-events: auto !important;
}

.wc-modern-filter-cat-active:not(:hover) .wc-modern-filter-subcats-active a {
    transform: translateY(0) !important;
    opacity: 1 !important;
}



/* Europa-filter styling */
.wc-modern-europe-filter {
    margin: 15px 0px;
    text-align: center;
	border-bottom:1px solid #e3e3e3;
	padding-bottom:10px!important;
}

.wc-modern-europe-filter-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.wc-modern-europe-filter-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background-color: #f0f0f0;
    border-radius: 3px;
    transition: all 0.3s ease;
    border: 1px solid rgba(30, 132, 73, 0.4);
}

.wc-modern-europe-filter-badge:hover {
    background-color: #e0e0e0;
    box-shadow: 0 3px 8px rgba(30, 132, 73, 0.15);
}

.wc-modern-europe-filter-active .wc-modern-europe-filter-badge {
    background-color: rgba(30, 132, 73, 0.15);
    border-color: rgba(30, 132, 73, 0.6);
}

.wc-modern-europe-filter-icon {
    margin-right: 8px;
    font-size: 18px;
}

.wc-modern-europe-filter-text {
    font-weight: 500;
    font-size: 14px;
}

.wc-modern-europe-filter-remove {
    margin-left: 8px;
    font-size: 16px;
    font-weight: bold;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.wc-modern-europe-filter-remove:hover {
    opacity: 1;
}

/* Checkbox version af Europa-filteret */
.wc-modern-europe-filter-checkbox {
    margin: 15px 0;
    text-align: left;
    width: 100% !important;
}

.wc-modern-europe-checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 15px;
    border-radius: 3px;
    background-color: #f7f7f7;
    border: 1px solid #e3e3e3;
}

.wc-modern-europe-checkbox-label:hover {
    background-color: #f0f0f0;
    border-color: #e3e3e3;
}

.wc-modern-europe-checkbox {
    margin-right: 10px;
    cursor: pointer;
    width: 15px;
    height: 15px;
    accent-color: rgba(30, 132, 73, 0.8);
}

.wc-modern-europe-checkbox-text {
    font-size: 12px;
    color: #333;
    transition: all 0.3s ease;
    margin-right: 5px; /* Tilføj lidt margin mellem tekst og flag */
}

/* Styling for EU-flaget i checkbox-versionen */
.wc-modern-europe-flag {
    margin-left: 8px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
}

/* Responsive-styling */
@media (max-width: 480px) {
    .wc-modern-europe-filter-badge {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .wc-modern-europe-filter-icon {
        font-size: 16px;
    }
    
    .wc-modern-europe-checkbox-label {
        padding: 6px 12px;
    }
    
    .wc-modern-europe-checkbox-text {
        font-size: 13px;
    }
    
    .wc-modern-europe-flag {
        font-size: 12px;
    }
}




@media (max-width: 768px) {
    .wc-modern-filter-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wc-modern-filter[data-columns="2"] .wc-modern-filter-wrapper,
    .wc-modern-filter[data-columns="4"] .wc-modern-filter-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .wc-modern-filter-wrapper {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .wc-modern-filter[data-columns="2"] .wc-modern-filter-wrapper,
    .wc-modern-filter[data-columns="4"] .wc-modern-filter-wrapper {
        grid-template-columns: repeat(1, 1fr);
    }
}