/**
 * Subcategory Product Sliders - All Styles
 * Loaded via preload in <head> to prevent FOUC
 */

/* ========== Subcategory Slider Styles ========== */
.mi-subcategory-slider-section {
    padding: 40px 0;
    background: #fff;
}
.mi-subcategory-slider-section + .mi-subcategory-slider-section {
    padding-top: 0;
}
.mi-subcategory-slider-section:first-of-type {
    padding-top: 20px;
}

/* Header */
.mi-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.mi-slider-title {
    font-size: 24px;
    font-weight: 600;
    color: #222;
    margin: 0;
    text-transform: capitalize;
}
.mi-view-all-link {
    font-size: 14px;
    font-weight: 500;
    color: #FF7396;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}
.mi-view-all-link:hover {
    color: #e85a7f;
}
.mi-view-all-link .mi-arrow {
    font-size: 16px;
}

/* Slider Wrapper */
.mi-slider-wrapper {
    position: relative;
    padding: 0;
}

/* Carousel */
.mi-subcat-carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
}
.mi-subcat-carousel::-webkit-scrollbar {
    display: none;
}

/* Carousel Items - Desktop shows 5 items */
.mi-carousel-item {
    flex: 0 0 auto;
    width: calc(20% - 13px);
}

/* Product Card Base */
.mi-product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}
.mi-product-card:hover {
    transform: translateY(-4px);
}
.mi-product-card:active,
.mi-product-card:focus,
.mi-product-card:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Card Thumbnail */
.mi-card-thumb,
.mi-product-card .wvp-thumb {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
}
.mi-card-thumb img,
.mi-product-card .wvp-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 9/16;
    object-fit: cover;
    display: block;
}
.mi-pdf-card {
    cursor: pointer;
}

/* Video Play Button */
.mi-product-card .wvp-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.mi-product-card .wvp-thumb:hover .wvp-play {
    background: rgba(0,0,0,0.7);
}
.mi-product-card .wvp-play svg {
    width: 22px;
    height: 22px;
}

/* Card Body */
.mi-card-body {
    padding: 12px 8px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Card Title - Fixed height with ellipsis */
.mi-card-title {
    font-size: 13px;
    font-weight: 400;
    color: #333;
    margin: 0 0 10px;
    line-height: 1.4;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Card Button */
.mi-card-btn {
    display: inline-block;
    background: #FF7396;
    color: #fff !important;
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.2s, opacity 0.15s;
    margin-top: auto;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}
.mi-card-btn:hover {
    background: #e85a7f;
}
.mi-card-btn:active,
.mi-card-btn:focus,
.mi-card-btn:focus-visible {
    opacity: 0.7;
    outline: none !important;
    box-shadow: none !important;
}

/* View All Card */
.mi-view-all-item {
    display: flex;
}
.mi-view-all-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    background: linear-gradient(145deg, #FF7396 0%, #ff8fa8 50%, #ffa5b8 100%);
    border-radius: 12px;
    text-decoration: none !important;
    color: #fff !important;
    aspect-ratio: 9/16;
    transition: transform 0.2s, box-shadow 0.2s;
}
.mi-view-all-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255,115,150,0.35);
}
.mi-view-all-content {
    text-align: center;
    padding: 20px;
}
.mi-view-all-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    margin: 0 auto 16px;
}
.mi-view-all-label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}
.mi-view-all-count {
    display: block;
    font-size: 13px;
    opacity: 0.9;
}

/* Navigation Buttons - Overlaid on slider */
.mi-slider-nav {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    padding: 0;
}
.mi-slider-nav svg {
    width: 24px;
    height: 24px;
    display: block;
    flex-shrink: 0;
}
.mi-slider-nav:hover {
    background: #FF7396;
    box-shadow: 0 4px 16px rgba(255,115,150,0.4);
}
.mi-slider-nav:hover svg path {
    stroke: #fff;
}
.mi-slider-prev {
    left: 12px;
}
.mi-slider-next {
    right: 12px;
}

/* Responsive */
@media (max-width: 1400px) {
    .mi-carousel-item {
        width: calc(25% - 12px);
    }
}
@media (max-width: 1200px) {
    .mi-carousel-item {
        width: calc(33.33% - 11px);
    }
}
@media (max-width: 991px) {
    .mi-carousel-item {
        width: calc(33.33% - 11px);
    }
    .mi-slider-wrapper {
        padding: 0;
    }
    .mi-slider-title {
        font-size: 20px;
    }
}
@media (max-width: 767px) {
    .mi-subcategory-slider-section {
        padding: 30px 0;
    }
    .mi-carousel-item {
        width: calc(45% - 8px);
    }
    .mi-slider-wrapper {
        padding: 0;
    }
    .mi-slider-prev {
        left: 8px;
    }
    .mi-slider-next {
        right: 8px;
    }
    .mi-slider-nav {
        width: 32px;
        height: 32px;
    }
    .mi-slider-nav svg {
        width: 16px;
        height: 16px;
    }
    .mi-slider-title {
        font-size: 18px;
    }
    .mi-card-title {
        font-size: 12px;
        height: 34px;
    }
    .mi-card-btn {
        font-size: 12px;
        padding: 8px 14px;
    }
    .mi-view-all-icon {
        width: 50px;
        height: 50px;
    }
    .mi-view-all-icon svg {
        width: 28px;
        height: 28px;
    }
    .mi-view-all-label {
        font-size: 15px;
    }
}

/* Popup button styles - match subcategory page exactly */
.mi-carousel-item .product-gallery-popup-wrapper .button_section a,
.mi-carousel-item .product-gallery-popup-wrapper .button_section a.popup-edit-button {
    color: #fff;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}
.mi-carousel-item .product-gallery-popup-wrapper .button_section a:hover,
.mi-carousel-item .product-gallery-popup-wrapper .button_section a:focus,
.mi-carousel-item .product-gallery-popup-wrapper .button_section a:active,
.mi-carousel-item .product-gallery-popup-wrapper .button_section a:focus-visible,
.mi-carousel-item .product-gallery-popup-wrapper .button_section a.popup-edit-button:hover,
.mi-carousel-item .product-gallery-popup-wrapper .button_section a.popup-edit-button:focus,
.mi-carousel-item .product-gallery-popup-wrapper .button_section a.popup-edit-button:active,
.mi-carousel-item .product-gallery-popup-wrapper .button_section a.popup-edit-button:focus-visible {
    color: #000;
    background: transparent;
    border-color: #000;
    box-shadow: none !important;
    outline: none !important;
    opacity: 0.85;
}

/* Popup body lock */
body.popup-open {
    overflow: hidden;
}
