/**
 * EMERE Builder - Categories Carousel Section Stylesheet
 */

.emere-categories-section-wrapper {
    width: 100%;
    margin-bottom: var(--emere-builder-section-spacing, 60px);
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    color: #1e293b;
    overflow: hidden;
}

/* 1. HEADER ROW */
.emere-categories-header-block {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 35px;
    box-sizing: border-box;
}

.emere-categories-tag-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    padding: 5px 12px;
    font-size: 10px;
    font-weight: 800;
    color: #475569;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.emere-categories-tag-badge .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.categories-heading-main {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 10px 0 0 0;
}

.categories-subheading-main {
    font-size: 1.05rem;
    color: #64748b;
    margin: 5px 0 0 0;
}

/* 2. CAROUSEL ENGINE */
.emere-categories-carousel-viewport {
    width: 100%;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.emere-categories-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
    box-sizing: border-box;
}

.emere-category-card-wrapper {
    flex: 0 0 20%; /* 5 Categories visible per viewport default */
    padding: 10px;
    box-sizing: border-box;
}

.emere-category-card-inner {
    position: relative;
    display: block;
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.02);
    overflow: hidden;
    height: 280px;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.3s ease;
}

.emere-category-card-inner:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    border-color: var(--emere-builder-accent, #ea580c);
}

.category-media-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

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

.emere-category-card-inner:hover .category-image {
    transform: scale(1.05);
}

.category-overlay-tint {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 30%, rgba(15, 23, 42, 0.85) 100%);
    z-index: 2;
}

.category-content-frame {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 24px 20px;
    box-sizing: border-box;
    z-index: 3;
    text-align: left;
}

.category-title-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.category-items-count {
    font-size: 11px;
    font-weight: 700;
    color: #ffedd5;
    background-color: rgba(234, 88, 12, 0.9); /* Accent warm orange tag */
    border-radius: 4px;
    padding: 3px 8px;
    display: inline-block;
    letter-spacing: 0.02em;
    margin-bottom: 12px;
}

.category-explore-action {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    opacity: 0.85;
    transition: all 0.2s ease;
}

.emere-category-card-inner:hover .category-explore-action {
    opacity: 1;
    color: #fed7aa;
}

.category-explore-action .action-arrow {
    transition: transform 0.2s ease;
}

.emere-category-card-inner:hover .action-arrow {
    transform: translateX(3px);
}

/* 3. PAGINATION DOTS styling */
.emere-categories-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    width: 100%;
}

.categories-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.categories-dot:hover {
    background-color: #94a3b8;
}

.categories-dot.is-active {
    width: 24px;
    border-radius: 4px;
    background-color: var(--emere-builder-accent, #ea580c);
}

.no-categories-msg {
    width: 100%;
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
    color: #64748b;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1200px) {
    .emere-category-card-wrapper {
        flex: 0 0 25%; /* 4 Cards visible */
    }
}

@media (max-width: 991.98px) {
    .emere-category-card-wrapper {
        flex: 0 0 33.333%; /* 3 Cards visible */
    }
}

@media (max-width: 767.98px) {
    .emere-categories-header-block {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .header-right-col {
        width: 100%;
        justify-content: space-between;
    }
    
    .categories-heading-main {
        font-size: 1.8rem;
    }
    
    /* Touch friendly swipe scrolling carousel support for mobile devices */
    .emere-categories-carousel-viewport {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .emere-categories-carousel-viewport::-webkit-scrollbar {
        display: none;
    }
    
    .emere-categories-carousel-track {
        transform: none !important; /* Strips JS translation so touch swiping takes over */
    }
    
    .emere-category-card-wrapper {
        flex: 0 0 240px; /* Locked responsive card width for mobile horizontal swipe */
    }
    
    }
}

/* 5. FLAT IMAGELESS CATEGORIES STYLES */
.card-flat-no-image {
    display: flex !important;
    flex-direction: column;
    padding: 24px !important;
    height: 180px !important; /* Compact premium size */
    box-sizing: border-box;
    align-items: flex-start;
    justify-content: space-between; /* Spreads layout elements beautifully */
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    border-top: 3px solid #e2e8f0 !important; /* Elegant top highlight border */
    border-radius: 16px !important;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.02) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.card-flat-no-image:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08) !important;
    border-color: var(--emere-builder-accent, #ea580c) !important;
    border-top-color: var(--emere-builder-accent, #ea580c) !important;
    background: #fffcf9 !important; /* Soft warm micro-glow */
}

.category-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #f8fafc;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.category-icon-circle .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.emere-category-card-inner:hover .category-icon-circle {
    background-color: var(--emere-builder-accent, #ea580c);
    color: #ffffff;
    transform: scale(1.08);
}

.category-content-frame-flat {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 14px;
}

.category-title-heading-flat {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
    transition: color 0.2s ease;
    word-break: break-word;
}

.emere-category-card-inner:hover .category-title-heading-flat {
    color: var(--emere-builder-accent, #ea580c);
}

.category-items-count-flat {
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    background-color: #f1f5f9;
    border-radius: 4px;
    padding: 2px 6px;
    display: inline-block;
    width: fit-content;
    margin-top: 4px;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.emere-category-card-inner:hover .category-items-count-flat {
    background-color: #fff7ed;
    color: var(--emere-builder-accent, #ea580c);
}

.category-explore-action-flat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.emere-category-card-inner:hover .category-explore-action-flat {
    color: var(--emere-builder-accent, #ea580c);
}

.category-explore-action-flat .action-arrow {
    transition: transform 0.2s ease;
}

.emere-category-card-inner:hover .category-explore-action-flat .action-arrow {
    transform: translateX(4px);
}

/* 6. SLIDER ARROW OVERRIDES (Force theme/YITH red to match brand orange) */
.emere-categories-section-wrapper .carousel-nav-btn {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    transition: all 0.2s ease !important;
}

.emere-categories-section-wrapper .carousel-nav-btn:hover {
    background-color: var(--emere-builder-accent, #ea580c) !important;
    color: #ffffff !important;
    border-color: var(--emere-builder-accent, #ea580c) !important;
}
