/* Base styling for DS Categories */
.ds-categories-wrapper {
    /* General wrapper styles */
}

.ds-category-item {
    text-align: center;
    /* Common item styles */
}

.ds-category-image-wrap {
    margin-bottom: 10px;
    overflow: hidden; /* Ensures aspect ratio and acts as a container */
    position: relative;
}

.ds-category-image-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    transition: background-color 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.ds-category-image-wrap img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover; /* Ensures image covers the area while maintaining aspect ratio */
}

.ds-category-title {
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.ds-category-title a {
    text-decoration: none;
    color: inherit; /* Inherit color from parent for easier styling */
}

.ds-category-count {
    font-size: 0.9em;
    color: #888;
}

.ds-category-description {
    font-size: 0.85em;
    color: #666;
    margin: 5px 0;
    line-height: 1.4;
}

/* Grid Layout */
.ds-categories-grid {
    display: grid;
    grid-template-columns: repeat(var(--ds-grid-columns, 3), 1fr);
    gap: var(--ds-grid-gap, 20px);
}

/* Equal Height Options */
.ds-categories-grid[data-equal-height="all"] {
    align-items: stretch;
}

.ds-categories-grid[data-equal-height="all"] .ds-category-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ds-categories-grid[data-equal-height="all"] .ds-category-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ds-categories-grid[data-equal-height="row"] {
    align-items: stretch;
}

.ds-categories-grid[data-equal-height="row"] .ds-category-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ds-categories-grid[data-equal-height="row"] .ds-category-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Responsive adjustments for Grid */
@media (max-width: 1024px) { /* Tablet */
    .ds-categories-grid {
        grid-template-columns: repeat(var(--ds-grid-tablet-columns, 2), 1fr);
    }
}

@media (max-width: 767px) { /* Mobile */
    .ds-categories-grid {
        grid-template-columns: repeat(var(--ds-grid-mobile-columns, 1), 1fr);
    }
}


/* List Layout */
.ds-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ds-category-list-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.ds-category-list-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.ds-category-list-item.ds-image-position-left .ds-category-image-wrap {
    flex: 0 0 100px; /* Fixed width for left image */
    margin-right: 15px;
    margin-bottom: 0;
}

.ds-category-list-item.ds-image-position-top {
    flex-direction: column;
}

.ds-category-list-item.ds-image-position-top .ds-category-image-wrap {
    width: 100%;
    margin-right: 0;
    margin-bottom: 10px;
}

.ds-category-list-item .ds-category-content {
    flex-grow: 1;
    text-align: left; /* Adjust text alignment for list */
}

.ds-category-list-item.ds-image-position-none .ds-category-image-wrap {
    display: none;
}

/* Responsive adjustments for List */
@media (max-width: 767px) { /* Mobile */
    .ds-category-list-item.ds-image-position-left {
        flex-direction: column;
    }
    .ds-category-list-item.ds-image-position-left .ds-category-image-wrap {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Carousel Layout (Swiper.js integration) */
.ds-categories-carousel {
    /* Swiper container needs its own styling */
    position: relative;
    overflow: hidden;
}

.ds-categories-carousel .swiper-slide {
    /* Swiper slide content styling */
    display: flex;
    flex-direction: column;
    height: auto; /* Allow height to adjust */
}

/* Swiper navigation arrows */
.ds-categories-carousel .swiper-button-prev,
.ds-categories-carousel .swiper-button-next {
    color: #333; /* Default color */
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    transition: all 0.3s ease;
}

.ds-categories-carousel .swiper-button-prev:hover,
.ds-categories-carousel .swiper-button-next:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* Arrow Types */
.ds-categories-carousel.arrows-circle .swiper-button-prev,
.ds-categories-carousel.arrows-circle .swiper-button-next {
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

.ds-categories-carousel.arrows-square .swiper-button-prev,
.ds-categories-carousel.arrows-square .swiper-button-next {
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
}

.ds-categories-carousel.arrows-minimal .swiper-button-prev,
.ds-categories-carousel.arrows-minimal .swiper-button-next {
    background: transparent;
    color: #333;
    border: 2px solid #333;
    border-radius: 0;
}

.ds-categories-carousel.arrows-minimal .swiper-button-prev:hover,
.ds-categories-carousel.arrows-minimal .swiper-button-next:hover {
    background: #333;
    color: white;
}

/* Swiper pagination dots */
.ds-categories-carousel .swiper-pagination {
    bottom: 10px;
}

.ds-categories-carousel .swiper-pagination-bullet {
    background: #ccc; /* Default color */
    width: 8px; /* Default size */
    height: 8px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.ds-categories-carousel .swiper-pagination-bullet-active {
    background: #007aff; /* Default active color */
    opacity: 1;
    transform: scale(1.2);
}
