/* General Quiz Layout */
.wccq-quiz-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
}

.wccq-quiz-content-wrapper {
    position: relative;
    /* This will hold both parent categories and dynamically loaded content */
}

.category-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 10px;
}

.category-image-wrapper .main-category-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
}

.product-carousel-thumbnails {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Ensure images stay within bounds */
    z-index: 2; /* Above the main category image */
}

.product-carousel-thumbnails img.product-thumbnail-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* Hidden by default, JavaScript will manage display */
}

.product-carousel-thumbnails img.product-thumbnail-image:first-child {
    display: block; /* Show the first image by default */
}


.wccq-quiz-wrapper .subcategory img, .wccq-quiz-wrapper .product img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}


/* Back Button */
.wccq-back-button-container {
    margin-bottom: 20px;
    text-align: left;
}

.wccq-back-button {
background-color: transparent;
    color: var(--uicore-light-color);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition:color 0.3s ease;
}

.wccq-back-button:hover {
color: var(--uicore-secondary-color);
}

.wccq-back-button-container {
    display: flex;
    justify-content: center;
}
.wccq-quiz-content p.loading{
text-align:center;
}
@media(min-width:768px){
/* Subcategories and Products Display */
.subcategories-container:not(:empty) , .products-grid-elementor:not(:empty)  {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 250px));
    gap: 20px;
    justify-content: center;
    text-align: center;
    margin-top: 20px; /* Space from back button */
}
/* Parent Categories Display */
.parent-categories-container:not(:empty)  {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 250px));
    gap: 20px;
    justify-content: center;
    text-align: center;
}

}
@media(max-width:767px){
/* Subcategories and Products Display */
.subcategories-container:not(:empty) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 140px));
    gap: 20px;
    justify-content: center;
    text-align: center;
    margin-top: 20px; /* Space from back button */
}
.products-grid-elementor:not(:empty)  {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 250px));
    gap: 20px;
    justify-content: center;
    text-align: center;
    margin-top: 20px; /* Space from back button */
}
/* Parent Categories Display */
.parent-categories-container:not(:empty)  {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 140px));
    gap: 20px;
    justify-content: center;
    text-align: center;
}

}
.wccq-quiz-content .products-grid-elementor .elementor-invisible {
    visibility: visible;
}