/**
 * Ecommerce Category Templates & Custom Styles
 * Author: ZERO Technology
 */

/* ========================================================
   1. GEOMETRIC BLOCKS (Custom Ratio & Size)
   ======================================================== */
.ect-wrapper {
    position: relative;
    width: 100%;
}

.ect-container {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
}

.ect-header {
    margin-bottom: 25px;
}

.ect-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--tp-common-black, #253D4E);
}

.ect-subtitle {
    font-size: 14px;
    color: #7e7e7e;
    margin-bottom: 0;
}

/* Grid Layout */
.ect-grid {
    display: grid;
    gap: var(--ect-gap, 20px);
    grid-template-columns: repeat(var(--ect-cols, 4), minmax(0, 1fr));
}

@media (max-width: 1200px) {
    .ect-grid {
        grid-template-columns: repeat(var(--ect-cols, 4), minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .ect-grid {
        grid-template-columns: repeat(min(var(--ect-cols, 4), 3), minmax(0, 1fr));
        --ect-gap: 15px;
    }
}

@media (max-width: 767px) {
    .ect-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        --ect-gap: 12px;
    }
}

@media (max-width: 480px) {
    .ect-grid[data-cols-mobile="1"] {
        grid-template-columns: 1fr;
    }
}

/* Tile Item */
.ect-tile {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: var(--ect-item-bg, #f3f5f7);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    color: inherit;
    isolation: isolate;
}

/* Aspect Ratios */
.ect-tile[data-ratio="1:1"] .ect-tile-media { aspect-ratio: 1 / 1; }
.ect-tile[data-ratio="4:3"] .ect-tile-media { aspect-ratio: 4 / 3; }
.ect-tile[data-ratio="16:9"] .ect-tile-media { aspect-ratio: 16 / 9; }
.ect-tile[data-ratio="3:4"] .ect-tile-media { aspect-ratio: 3 / 4; }
.ect-tile[data-ratio="2:1"] .ect-tile-media { aspect-ratio: 2 / 1; }
.ect-tile[data-ratio="custom"] .ect-tile-media {
    min-height: var(--ect-custom-height, 220px);
    aspect-ratio: auto;
}

/* Shapes */
.ect-tile[data-shape="rounded"] { border-radius: 16px; }
.ect-tile[data-shape="squircle"] { border-radius: 28px; }
.ect-tile[data-shape="pill"] { border-radius: 50px; }
.ect-tile[data-shape="square"] { border-radius: 0; }
.ect-tile[data-shape="circle"] {
    border-radius: 50%;
    aspect-ratio: 1 / 1;
}

/* Media Box & Image */
.ect-tile-media {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ect-tile-img {
    width: 100%;
    height: 100%;
    object-fit: var(--ect-fit, cover);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

/* Hover Effects */
.ect-tile[data-hover="zoom"]:hover .ect-tile-img {
    transform: scale(1.08);
}

.ect-tile[data-hover="lift"]:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

.ect-tile[data-hover="shine"]:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    z-index: 2;
    transition: none;
    pointer-events: none;
}

.ect-tile[data-hover="shine"]:hover:before {
    left: 150%;
    transition: left 0.75s ease-in-out;
}

/* Overlay Styles */
/* 1. Gradient Overlay */
.ect-tile[data-overlay="gradient"] .ect-tile-media:after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0) 70%);
    z-index: 1;
    transition: opacity 0.3s ease;
}

.ect-tile[data-overlay="gradient"]:hover .ect-tile-media:after {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.05) 75%);
}

.ect-tile[data-overlay="gradient"] .ect-tile-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 18px;
    z-index: 2;
    color: #ffffff;
}

.ect-tile[data-overlay="gradient"] .ect-tile-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ect-tile[data-overlay="gradient"] .ect-tile-count {
    display: inline-block;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
}

/* 2. Frosted Glass Floating Badge */
.ect-tile[data-overlay="frosted"] .ect-tile-content {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: background 0.3s ease, transform 0.3s ease;
}

.ect-tile[data-overlay="frosted"]:hover .ect-tile-content {
    background: rgba(255, 255, 255, 0.96);
    transform: translateY(-2px);
}

.ect-tile[data-overlay="frosted"] .ect-tile-title {
    font-size: 14px;
    font-weight: 600;
    color: #253D4E;
    margin: 0;
}

.ect-tile[data-overlay="frosted"] .ect-tile-count {
    font-size: 11px;
    color: #046963;
    font-weight: 600;
    background: rgba(4, 105, 99, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 3. Card Style (Content below image) */
.ect-tile[data-overlay="card"] {
    background: #ffffff;
    border: 1px solid #eaeaea;
}

.ect-tile[data-overlay="card"] .ect-tile-content {
    padding: 14px 16px;
    text-align: center;
}

.ect-tile[data-overlay="card"] .ect-tile-title {
    font-size: 15px;
    font-weight: 600;
    color: #253D4E;
    margin: 0 0 4px;
    transition: color 0.2s ease;
}

.ect-tile[data-overlay="card"]:hover .ect-tile-title {
    color: var(--primary-color, #046963);
}

.ect-tile[data-overlay="card"] .ect-tile-count {
    font-size: 12px;
    color: #888;
}

/* 4. Minimal Style */
.ect-tile[data-overlay="minimal"] .ect-tile-content {
    padding: 12px 10px;
    text-align: center;
}

.ect-tile[data-overlay="minimal"] .ect-tile-title {
    font-size: 15px;
    font-weight: 600;
    color: #253D4E;
    margin: 0;
}

.ect-tile[data-overlay="minimal"] .ect-tile-count {
    font-size: 12px;
    color: #7e7e7e;
    margin-top: 2px;
}

/* ========================================================
   2. WOWY STYLES
   ======================================================== */

/* Wowy Card 1 */
.wowy-cat-card {
    background: var(--ect-wowy-bg, #f4f5f9);
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 20px 15px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease 0s;
    display: block;
    text-decoration: none;
    color: inherit;
}

.wowy-cat-card:hover {
    transform: translateY(-5px);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.05);
    border-color: #BCE3C9;
}

.wowy-cat-card .wowy-cat-thumb {
    margin-bottom: 15px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
}

.wowy-cat-card .wowy-cat-thumb img {
    max-height: 100px;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.wowy-cat-card:hover .wowy-cat-thumb img {
    transform: scale(1.1);
}

.wowy-cat-card .wowy-cat-title {
    font-size: 15px;
    font-weight: 700;
    color: #253D4E;
    margin: 0 0 5px;
    transition: color 0.2s ease;
}

.wowy-cat-card:hover .wowy-cat-title {
    color: #046963;
}

.wowy-cat-card .wowy-cat-count {
    font-size: 12px;
    color: #7e7e7e;
    display: inline-block;
}

/* Wowy Circle */
.wowy-cat-circle {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.wowy-cat-circle:hover {
    transform: translateY(-4px);
}

.wowy-cat-circle .wowy-circle-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    background: #f4f5f9;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.wowy-cat-circle:hover .wowy-circle-avatar {
    border-color: #046963;
    box-shadow: 0 6px 18px rgba(4, 105, 99, 0.15);
}

.wowy-cat-circle .wowy-circle-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.wowy-cat-circle:hover .wowy-circle-avatar img {
    transform: scale(1.12);
}

.wowy-cat-circle .wowy-circle-title {
    font-size: 14px;
    font-weight: 600;
    color: #253D4E;
    margin: 0 0 2px;
}

.wowy-cat-circle:hover .wowy-circle-title {
    color: #046963;
}

.wowy-cat-circle .wowy-circle-count {
    font-size: 11px;
    color: #888;
}

/* Wowy Banner Style */
.wowy-cat-banner {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    align-items: flex-end;
    padding: 24px;
    text-decoration: none;
    color: #ffffff;
    background-size: cover;
    background-position: center;
    isolation: isolate;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.wowy-cat-banner:after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(4, 105, 99, 0.85) 0%, rgba(36, 43, 86, 0.9) 100%);
    z-index: 1;
    transition: opacity 0.3s ease;
}

.wowy-cat-banner:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(4, 105, 99, 0.25);
}

.wowy-cat-banner .wowy-banner-content {
    position: relative;
    z-index: 2;
}

.wowy-cat-banner .wowy-banner-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
}

.wowy-cat-banner .wowy-banner-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #ffd166;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================================
   3. UNIVERSAL SLIDER STYLING (Works with Swiper/Slick)
   ======================================================== */
.ect-slider-container {
    position: relative;
    overflow: hidden;
}

.ect-slider-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ect-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f4f5f9;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #253D4E;
}

.ect-nav-btn:hover {
    background: var(--primary-color, #046963);
    color: #ffffff;
    border-color: var(--primary-color, #046963);
}

/* Slider Box relative container */
.ect-slider-box {
    position: relative;
    width: 100%;
}

/* Floating Navigation Arrows (Shopee / TMĐT Style) */
.ect-nav-btn.ect-nav-floating {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16) !important;
    color: var(--tp-common-black, #171b26) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
}

.ect-nav-btn.ect-nav-floating:hover {
    background: var(--tp-theme-primary, #0989ff) !important;
    color: #ffffff !important;
    border-color: var(--tp-theme-primary, #0989ff) !important;
    box-shadow: 0 6px 20px rgba(9, 137, 255, 0.35) !important;
    opacity: 1;
    transform: translateY(-50%) scale(1.08);
}

.ect-nav-btn.ect-nav-floating.ect-slider-prev {
    left: -15px;
}

.ect-nav-btn.ect-nav-floating.ect-slider-next {
    right: -15px;
}

@media (max-width: 991px) {
    .ect-nav-btn.ect-nav-floating {
        width: 36px;
        height: 36px;
    }
    .ect-nav-btn.ect-nav-floating.ect-slider-prev {
        left: 0;
    }
    .ect-nav-btn.ect-nav-floating.ect-slider-next {
        right: 0;
    }
}

.ect-nav-btn svg {
    width: 20px;
    height: 20px;
    display: block;
    stroke: currentColor;
    stroke-width: 2.4;
    fill: none;
    pointer-events: none;
}

/* Disabled & Lock States for Navigation: Keep visible, never display:none so arrows don't vanish */
.ect-nav-btn.swiper-button-lock {
    opacity: 0.35 !important;
    cursor: default !important;
    display: flex !important;
    pointer-events: none;
}

.ect-nav-btn.swiper-button-disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    display: flex !important;
    pointer-events: none;
}

/* ========================================================
   4. COMPACT ICONS GRID SLIDER (Clean, No-Box, Frameless)
   ======================================================== */
.ect-compact-slider-section {
    position: relative;
    width: 100%;
}

.ect-compact-slider-section .ect-swiper-slider {
    position: relative;
    width: 100%;
}

/* Fallback only before Swiper JS initializes */
.ect-compact-slider-section .ect-swiper-slider:not(.swiper-container-initialized) {
    overflow: hidden;
}

.ect-compact-slider-section .ect-swiper-slider:not(.swiper-container-initialized) .swiper-wrapper {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 20px;
    justify-content: flex-start;
    scrollbar-width: none;
}

.ect-compact-slider-section .ect-swiper-slider:not(.swiper-container-initialized) .swiper-wrapper::-webkit-scrollbar {
    display: none;
}

.ect-compact-slider-section .ect-swiper-slider:not(.swiper-container-initialized) .swiper-slide {
    flex: 0 0 calc((100% - (var(--ect-items-desktop, 5) - 1) * 20px) / var(--ect-items-desktop, 5));
    min-width: 120px;
}

.ect-compact-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    justify-content: center;
}

.ect-compact-item {
    display: flex;
    text-decoration: none;
    color: inherit;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 8px 6px;
    transition: transform 0.25s ease;
    box-sizing: border-box;
    width: 100%;
}

/* Vertical Layout (Icon Top, Centered Text - Sàn TMĐT Style) */
.ect-compact-item.ect-layout-vertical {
    --ect-compact-box: var(--ect-icon-size, 90px);
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: flex-start;
    margin: 0 auto;
    height: 100%;
}

.ect-compact-item.ect-layout-vertical .ect-compact-icon-wrap {
    width: var(--ect-compact-box) !important;
    height: var(--ect-compact-box) !important;
    min-width: var(--ect-compact-box) !important;
    min-height: var(--ect-compact-box) !important;
    max-width: var(--ect-compact-box) !important;
    max-height: var(--ect-compact-box) !important;
    flex: 0 0 var(--ect-compact-box) !important;
    aspect-ratio: 1 / 1;
    margin: 0 auto var(--ect-icon-gap, 4px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.ect-compact-item.ect-layout-vertical .ect-compact-icon-wrap img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 auto !important;
    transition: transform 0.3s ease;
}

.ect-compact-item.ect-layout-vertical:hover .ect-compact-icon-wrap img {
    transform: scale(1.08);
}

.ect-compact-item.ect-layout-vertical .ect-compact-icon-wrap i,
.ect-compact-item.ect-layout-vertical .ect-compact-icon-wrap svg {
    font-size: calc(var(--ect-icon-size, 90px) * 0.6);
    width: calc(var(--ect-icon-size, 90px) * 0.6);
    height: calc(var(--ect-icon-size, 90px) * 0.6);
    max-width: 65%;
    max-height: 65%;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tp-common-black, #171b26);
    transition: transform 0.3s ease, color 0.3s ease;
}

.ect-compact-item.ect-layout-vertical:hover .ect-compact-icon-wrap i,
.ect-compact-item.ect-layout-vertical:hover .ect-compact-icon-wrap svg {
    color: var(--tp-theme-primary, #0989ff);
    transform: scale(1.1);
}

.ect-compact-item.ect-layout-vertical .ect-compact-info {
    width: 100%;
    margin-top: 0;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ect-compact-item.ect-layout-vertical .ect-compact-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 2px;
    min-height: 2.6em; /* Fixed 2-line baseline prevents titles from jumping up and down */
    color: var(--tp-common-black, #171b26);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    transition: color 0.2s ease;
}

.ect-compact-item.ect-layout-vertical .ect-compact-name a {
    color: inherit;
    text-decoration: none;
}

.ect-compact-item.ect-layout-vertical:hover .ect-compact-name,
.ect-compact-item.ect-layout-vertical .ect-compact-name a:hover {
    color: var(--tp-theme-primary, #0989ff);
}

.ect-compact-item.ect-layout-vertical .ect-compact-meta {
    font-size: 13px;
    color: #8b92a0;
    line-height: 1;
    display: block;
}

/* Horizontal Layout (Icon Left, Text Right - Clean, No Frame) */
.ect-compact-item.ect-layout-horizontal {
    flex-direction: row;
    align-items: center;
    text-align: left;
    width: 100%;
}

.ect-compact-item.ect-layout-horizontal .ect-compact-icon-wrap {
    width: calc(var(--ect-icon-size, 90px) * 0.72);
    height: calc(var(--ect-icon-size, 90px) * 0.72);
    flex: 0 0 calc(var(--ect-icon-size, 90px) * 0.72);
    margin-right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    text-decoration: none;
}

.ect-compact-item.ect-layout-horizontal .ect-compact-icon-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.ect-compact-item.ect-layout-horizontal:hover .ect-compact-icon-wrap img {
    transform: scale(1.1);
}

.ect-compact-item.ect-layout-horizontal .ect-compact-info {
    flex: 1 1 auto;
    min-width: 0;
}

.ect-compact-item.ect-layout-horizontal .ect-compact-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
    color: var(--tp-common-black, #171b26);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.ect-compact-item.ect-layout-horizontal .ect-compact-name a {
    color: inherit;
    text-decoration: none;
}

.ect-compact-item.ect-layout-horizontal:hover .ect-compact-name,
.ect-compact-item.ect-layout-horizontal .ect-compact-name a:hover {
    color: var(--tp-theme-primary, #0989ff);
}

.ect-compact-item.ect-layout-horizontal .ect-compact-meta {
    font-size: 13px;
    color: #8b92a0;
    line-height: 1;
    display: block;
}

/* Mobile responsive styles */
@media (max-width: 576px) {
    .ect-compact-item.ect-layout-vertical .ect-compact-icon-wrap {
        width: calc(var(--ect-icon-size, 90px) * 0.7);
        height: calc(var(--ect-icon-size, 90px) * 0.7);
        margin-bottom: 6px;
    }
    .ect-compact-item.ect-layout-vertical .ect-compact-name {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    .ect-compact-item.ect-layout-vertical .ect-compact-meta {
        font-size: 11px;
    }
    .ect-compact-item.ect-layout-horizontal .ect-compact-icon-wrap {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        margin-right: 10px;
    }
    .ect-compact-item.ect-layout-horizontal .ect-compact-name {
        font-size: 13px;
    }
}



/* ========================================================
   5. SMOOTH DRAG (shared by every .ect-swiper-slider)
   ======================================================== */
.ect-swiper-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

.ect-swiper-slider .swiper-wrapper {
    transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.ect-swiper-slider.swiper-container-initialized {
    cursor: grab;
}

.ect-swiper-slider.ect-is-dragging,
.ect-swiper-slider.ect-is-dragging * {
    cursor: grabbing !important;
}

.ect-swiper-slider .swiper-slide {
    height: auto;
    user-select: none;
    -webkit-user-select: none;
}

.ect-swiper-slider img,
.ect-swiper-slider a {
    -webkit-user-drag: none;
    user-select: none;
}

.ect-swiper-slider img {
    pointer-events: none;
}

/* Header navigation layout */
.ect-slider-nav button.ect-nav-btn svg,
.ect-nav-btn svg {
    fill: none;
    stroke: currentColor;
}

/* ========================================================
   6. SHOFY CLEAN SLIDER (Frameless, Transparent, No Background)
   ======================================================== */
.ect-clean-slider-section {
    position: relative;
    width: 100%;
    padding-top: 50px;
    padding-bottom: 30px;
}

.ect-clean-slider-section .ect-clean-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 30px;
}

.ect-clean-slider-section .ect-clean-header .tp-section-title-wrapper {
    margin-bottom: 0;
}

.ect-clean-slider-section .ect-subtitle {
    display: block;
    margin-bottom: 4px;
}

.ect-clean-slider {
    --ect-clean-box: var(--ect-icon-size, 120px);
}

.ect-clean-slider .swiper-wrapper {
    align-items: flex-start !important;
}

.ect-clean-slider .swiper-slide {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

/* Before Swiper initializes: show items in one row with the right width (no layout jump) */
.ect-clean-slider:not(.swiper-container-initialized) .swiper-wrapper {
    display: flex;
    gap: 20px;
}

.ect-clean-slider:not(.swiper-container-initialized) .swiper-slide {
    flex: 0 0 calc((100% - (var(--ect-items-desktop, 5) - 1) * 20px) / var(--ect-items-desktop, 5));
}

/* Item: no box, no background, no border, top-aligned so all thumbs & titles line up */
.ect-clean-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Thumbnail: strict 1:1 square bounding box (--ect-clean-box x --ect-clean-box), zero background */
.ect-clean-thumb {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--ect-clean-box, 120px) !important;
    height: var(--ect-clean-box, 120px) !important;
    min-width: var(--ect-clean-box, 120px) !important;
    min-height: var(--ect-clean-box, 120px) !important;
    max-width: var(--ect-clean-box, 120px) !important;
    max-height: var(--ect-clean-box, 120px) !important;
    flex: 0 0 var(--ect-clean-box, 120px) !important;
    aspect-ratio: 1 / 1;
    margin: 0 auto var(--ect-icon-gap, 12px) !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    text-decoration: none !important;
    position: relative;
}

.ect-clean-thumb img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
    pointer-events: none;
}

.ect-clean-thumb svg,
.ect-clean-thumb i {
    width: 65% !important;
    height: 65% !important;
    font-size: calc(var(--ect-clean-box, 120px) * 0.65);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tp-common-black, #010f1c);
    transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), color 0.3s ease;
    pointer-events: none;
}

@media (hover: hover) {
    .ect-clean-item:hover .ect-clean-thumb img,
    .ect-clean-item:hover .ect-clean-thumb svg,
    .ect-clean-item:hover .ect-clean-thumb i {
        transform: scale(1.08);
    }
    .ect-clean-item:hover .ect-clean-thumb svg,
    .ect-clean-item:hover .ect-clean-thumb i,
    .ect-clean-item:hover .ect-clean-title a {
        color: var(--tp-theme-primary, #0989ff);
    }
}

/* Content: all titles start on the exact same horizontal line */
.ect-clean-content {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 4px !important;
}

.ect-clean-title {
    font-family: var(--primary-font, inherit);
    font-weight: 500;
    font-size: 17px;
    line-height: 1.35 !important;
    min-height: calc(1.35em * 2);
    color: var(--tp-common-black, #010f1c);
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    width: 100%;
    text-align: center !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ect-clean-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease;
}

.ect-clean-count {
    font-family: var(--primary-font, inherit);
    font-size: 14px;
    line-height: 1.4;
    color: var(--tp-text-2, #55585b);
    margin: 0 !important;
    text-align: center;
}

@media (max-width: 991px) {
    .ect-clean-slider {
        --ect-clean-box: min(var(--ect-icon-size, 120px), 120px);
    }
    .ect-clean-slider:not(.swiper-container-initialized) .swiper-slide {
        flex-basis: calc((100% - (var(--ect-items-tablet, 4) - 1) * 16px) / var(--ect-items-tablet, 4));
    }
    .ect-clean-title {
        font-size: 15px;
    }
}

@media (max-width: 575px) {
    .ect-clean-slider-section {
        padding-top: 35px;
        padding-bottom: 20px;
    }
    .ect-clean-slider {
        --ect-clean-box: min(var(--ect-icon-size, 120px), 84px);
    }
    .ect-clean-slider:not(.swiper-container-initialized) .swiper-wrapper {
        gap: 10px;
    }
    .ect-clean-slider:not(.swiper-container-initialized) .swiper-slide {
        flex-basis: calc((100% - (var(--ect-items-mobile, 2) - 1) * 10px) / var(--ect-items-mobile, 2));
    }
    .ect-clean-title {
        font-size: 14px;
    }
    .ect-clean-count {
        font-size: 12px;
    }
}
