/**
 * Catalog Products Slider Styles
 * 
 * @package TM_Catalog
 * @since 1.0.0
 * @author Templines
 */

/* Slider Wrapper */
.tmr-catalog-slider-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Swiper Container */
.tmr-catalog-swiper {
    position: relative;
    width: 100%;
    overflow: visible;
}

.tmr-catalog-slider-wrapper .tmr-autoplay-indicator {
    --tmr-indicator-size: 56px;
    --tmr-indicator-ring-width: 6px;
    --tmr-indicator-bar-width: 160px;
    --tmr-indicator-bar-height: 6px;
    --tmr-indicator-progress: 0;
    --tmr-indicator-color: #EC6326;
    --tmr-indicator-track-color: rgba(24, 26, 32, 0.15);
    --tmr-indicator-background: rgba(255, 255, 255, 0.85);
    --tmr-indicator-icon-color: #181A20;
    position: absolute;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 5;
    transition: transform 0.3s ease, opacity 0.3s ease;
    outline: none;
    overflow: hidden;
    border-radius: 999px;
    background: var(--tmr-indicator-background);
    box-shadow: 0 6px 20px rgba(24, 26, 32, 0.12);
}

.tmr-catalog-slider-wrapper .tmr-autoplay-indicator:focus-visible {
    box-shadow: 0 0 0 3px rgba(236, 99, 38, 0.35);
}

.tmr-catalog-slider-wrapper .tmr-autoplay-indicator.is-paused {
    opacity: 0.85;
}

.tmr-autoplay-indicator--pos-top-left {
    top: 16px;
    left: 16px;
}

.tmr-autoplay-indicator--pos-top-right {
    top: 16px;
    right: 16px;
}

.tmr-autoplay-indicator--pos-bottom-left {
    bottom: 16px;
    left: 16px;
}

.tmr-autoplay-indicator--pos-bottom-right {
    bottom: 16px;
    right: 16px;
}

.tmr-autoplay-indicator:not(.tmr-autoplay-indicator--bar) {
    width: var(--tmr-indicator-size);
    height: var(--tmr-indicator-size);
}

.tmr-autoplay-indicator:not(.tmr-autoplay-indicator--bar)::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--tmr-indicator-track-color);
}

.tmr-autoplay-indicator:not(.tmr-autoplay-indicator--bar) .tmr-autoplay-indicator__progress {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: conic-gradient(var(--tmr-indicator-color) calc(var(--tmr-indicator-progress) * 360deg), var(--tmr-indicator-track-color) 0deg);
    transition: background 0.12s linear;
    pointer-events: none;
    z-index: 0;
}

.tmr-autoplay-indicator--ring .tmr-autoplay-indicator__progress,
.tmr-autoplay-indicator--ring::before {
    mask: radial-gradient(circle at center, transparent calc(50% - var(--tmr-indicator-ring-width)), black calc(50% - var(--tmr-indicator-ring-width) + 1px));
}

.tmr-autoplay-indicator--circle::before {
    background: rgba(24, 26, 32, 0.14);
}

.tmr-autoplay-indicator--circle .tmr-autoplay-indicator__progress {
    mask: none;
}

.tmr-autoplay-indicator__inner {
    position: relative;
    z-index: 2;
    width: calc(var(--tmr-indicator-size) - (var(--tmr-indicator-ring-width) * 2));
    height: calc(var(--tmr-indicator-size) - (var(--tmr-indicator-ring-width) * 2));
    border-radius: 50%;
    background: var(--tmr-indicator-background);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tmr-autoplay-indicator--circle .tmr-autoplay-indicator__inner {
    width: calc(var(--tmr-indicator-size) - 16px);
    height: calc(var(--tmr-indicator-size) - 16px);
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(24, 26, 32, 0.06);
    position: relative;
    left: 8px;
}

.tmr-autoplay-indicator__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
}

.tmr-autoplay-indicator__icon::before,
.tmr-autoplay-indicator__icon::after {
    content: '';
    display: block;
    background: var(--tmr-indicator-icon-color);
    transition: transform 0.2s ease;
}

.tmr-autoplay-indicator__icon::before {
    width: 4px;
    height: 12px;
    border-radius: 1px;
}

.tmr-autoplay-indicator__icon::after {
    width: 4px;
    height: 12px;
    border-radius: 1px;
    margin-left: 4px;
}

.tmr-autoplay-indicator.is-paused .tmr-autoplay-indicator__icon::before {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 7px 0 7px 11px;
    border-color: transparent transparent transparent var(--tmr-indicator-icon-color);
    margin: 0;
    border-radius: 0;
}

.tmr-autoplay-indicator.is-paused .tmr-autoplay-indicator__icon::after {
    display: none;
}

.tmr-autoplay-indicator--bar {
    width: var(--tmr-indicator-bar-width);
    height: var(--tmr-indicator-bar-height);
    border-radius: 999px;
    background: var(--tmr-indicator-track-color);
    overflow: hidden;
}

.tmr-autoplay-indicator--bar .tmr-autoplay-indicator__progress {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: calc(var(--tmr-indicator-progress) * 100%);
    background: var(--tmr-indicator-color);
    transition: width 0.12s linear;
}

.tmr-autoplay-indicator--bar .tmr-autoplay-indicator__inner,
.tmr-autoplay-indicator--bar .tmr-autoplay-indicator__icon {
    display: none;
}

.tmr-autoplay-indicator--bar::before {
    display: none;
}

.tmr-catalog-swiper .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.tmr-catalog-swiper .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
}

.tmr-catalog-swiper .tmr-slide-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Navigation Arrows */
.tmr-slider-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 50px;
}

.tmr-slider-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    padding: 0;
}

.tmr-slider-arrow svg {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.tmr-slider-arrow:hover svg {
    transform: scale(1.1);
}

.tmr-slider-arrow.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Pagination */
.swiper-pagination {
    position: relative;
    margin-top: 30px;
    text-align: center;
}

.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #D1D5DB;
    opacity: 1;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    width: 30px;
    border-radius: 5px;
    background: #EC6326;
}

/* Pagination Fraction */
.swiper-pagination-fraction {
    font-size: 14px;
    font-weight: 500;
    color: #181A20;
}

/* Pagination Progress Bar */
.swiper-pagination-progressbar {
    background: #E5E7EB;
    height: 4px;
}

.swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
    background: #EC6326;
}

/* Fallback Card Styles */
.tmr-fallback-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.tmr-fallback-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.tmr-card-image {
    position: relative;
    width: 100%;
    padding-top: 60%;
    overflow: hidden;
    background: #F3F4F6;
}

.tmr-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tmr-fallback-card:hover .tmr-card-image img {
    transform: scale(1.05);
}

.tmr-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tmr-card-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.tmr-card-title a {
    color: #181A20;
    text-decoration: none;
    transition: color 0.3s ease;
}

.tmr-card-title a:hover {
    color: #EC6326;
}

/* Responsive Design */
@media (max-width: 991px) {
    .tmr-slider-navigation {
        margin-top: 40px;
        gap: 15px;
    }
    
    .tmr-slider-arrow {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 767px) {
    .tmr-slider-navigation {
        margin-top: 30px;
        gap: 10px;
    }
    
    .tmr-slider-arrow {
        width: 35px;
        height: 35px;
    }
    
    .swiper-pagination {
        margin-top: 20px;
    }
    
    .tmr-card-title {
        font-size: 16px;
    }
}

/* Animation for slides */
.tmr-catalog-swiper .swiper-slide {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.tmr-catalog-swiper .swiper-slide-active {
    opacity: 1;
}

/* Loading State */
.tmr-catalog-slider-wrapper.loading {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tmr-catalog-slider-wrapper.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #E5E7EB;
    border-top-color: #EC6326;
    border-radius: 50%;
    animation: tmr-spinner 0.8s linear infinite;
}

@keyframes tmr-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Elementor Editor Support */
.elementor-editor-active .tmr-catalog-swiper {
    overflow: visible;
}

/* RTL Support */
[dir="rtl"] .tmr-slider-arrow svg {
    transform: scaleX(-1);
}

[dir="rtl"] .tmr-slider-arrow:hover svg {
    transform: scaleX(-1) scale(1.1);
}
