/* ==========================================================
   KIVIX PRODUCTS
   CAROUSEL + PRODUCT GRID
========================================================== */


/* ==========================================================
   01. CAROUSEL
========================================================== */

.kivix-product-carousel {
    position: relative;

    width: 100%;

    overflow: hidden;

    padding-bottom: 3px;
}


/* Swiper */

.kivix-product-carousel .swiper-wrapper {
    align-items: stretch;
}


.kivix-product-carousel .swiper-slide {
    height: auto;
}


/* ==========================================================
   02. PRODUCT CARD
   Shared: Carousel + Grid
========================================================== */

.kivix-product-card {
    position: relative;

    display: flex;
    flex-direction: column;

    width: 100%;
    height: 100%;

    min-width: 0;

    margin: 0;
    padding: 0;

    background: #ffffff;

    overflow: hidden;
}


/* ==========================================================
   03. PRODUCT IMAGE
========================================================== */

.kivix-product-image {
    position: relative;

    width: 100%;


    background: #f6f6f6;

    overflow: hidden;
}


.kivix-product-image-link {
    display: block;

    width: 100%;
    height: 100%;

    overflow: hidden;
}


/* Product image */

.kivix-product-image img {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-width: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    object-fit: cover;
    object-position: center;

    transform: scale(1);

    transition:
        transform .65s cubic-bezier(.22, .61, .36, 1);
}


/* Image hover */

.kivix-product-card:hover
.kivix-product-image img {
    transform: scale(1.04);
}


/* ==========================================================
   04. ADD TO CART OVERLAY
========================================================== */

.kivix-cart-overlay {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    z-index: 15;

    width: 100%;

    opacity: 0;
    visibility: hidden;

    transform: translateY(102%);

    transition:
        transform .4s cubic-bezier(.22, .61, .36, 1),
        opacity .3s ease,
        visibility .3s ease;
}


/* Show button */

.kivix-product-card:hover
.kivix-cart-overlay {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}


/* ==========================================================
   05. ADD TO CART BUTTON
   Shared: Carousel + Grid
========================================================== */

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.kivix-cart-overlay .button,

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.kivix-cart-overlay a.button {

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    gap: 8px;

    width: 100% !important;
    max-width: 100% !important;

    min-height: 52px !important;

    margin: 0 !important;

    padding: 12px 15px !important;

    border: 0 !important;
    border-radius: 0 !important;

    box-shadow: none !important;

    background: #ffffff !important;
    background-color: #ffffff !important;

    color: #111111 !important;

    font-family:
        "Inter",
        sans-serif !important;

    font-size: 13px !important;
    font-weight: 600 !important;

    line-height: 1.2 !important;

    letter-spacing: 0 !important;

    text-align: center !important;
    text-decoration: none !important;

    text-transform: uppercase !important;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color .3s ease,
        color .3s ease !important;
}


/* Button hover */

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.kivix-cart-overlay .button:hover,

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.kivix-cart-overlay a.button:hover {

    background: #72101b !important;
    background-color: #72101b !important;

    color: #ffffff !important;
}


/* Hide WooCommerce view cart */

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.kivix-cart-overlay .added_to_cart {

    display: none !important;
}


/* ==========================================================
   06. PRODUCT BADGES
========================================================== */

.kivix-badge {
    position: absolute;

    top: 12px;
    left: 12px;

    z-index: 20;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 22px;

    padding: 5px 9px;

    border-radius: 30px;

    color: #ffffff;

    font-family:
        "Inter",
        sans-serif;

    font-size: 9px;
    font-weight: 700;

    line-height: 1;

    text-transform: uppercase;

    pointer-events: none;
}


/* New */

.kivix-badge-new {
    background: #27943c;
}


/* Sale */

.kivix-badge-sale {
    background: #c91422;
}


/* Best seller */

.kivix-badge-best {
    background: #ee5a1c;
}


/* Limited */

.kivix-badge-limited {
    background: #161616;
}


/* ==========================================================
   07. PRODUCT CONTENT
========================================================== */

.kivix-product-content {
    display: flex;

    flex-direction: column;

    flex: 1;

    width: 100%;

    padding: 14px 2px 8px;
}


/* ==========================================================
   08. PRODUCT TITLE
========================================================== */

.kivix-product-title {
    margin: 0 0 5px !important;

    padding: 0 !important;

    font-family:
        "Inter",
        sans-serif !important;

    font-size: 18px !important;
    font-weight: 600 !important;

    line-height: 1.4 !important;
}


.kivix-product-title a {
    display: -webkit-box;

    overflow: hidden;

    color: #151515 !important;

    font-family:
        "Inter",
        sans-serif !important;

    font-size: 18px !important;
    font-weight: 600 !important;

    line-height: 1.4 !important;

    text-decoration: none !important;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    transition:
        color .25s ease !important;
}


/* Title hover */

.kivix-product-title a:hover {
    color: #72101b !important;
}


/* ==========================================================
   09. PRODUCT DESCRIPTION
========================================================== */

.kivix-product-desc {
    width: 100%;

    margin: 0 0 8px;

    overflow: hidden;

    color: #777777;

    font-family:
        "Inter",
        sans-serif;

    font-size: 12px;
    font-weight: 400;

    line-height: 1.45;

    white-space: nowrap;

    text-overflow: ellipsis;
}


/* ==========================================================
   10. RATING
========================================================== */

.kivix-rating {
    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 5px;

    margin: 0 0 7px;

    font-family:
        "Inter",
        sans-serif;
}


/* Stars */

.kivix-stars {
    display: inline-flex;

    align-items: center;

    gap: 1px;

    color: #f5a400;

    font-size: 14px;

    line-height: 1;
}


.kivix-stars span {
    display: inline-block;

    color: #f5a400;
}


/* 5.0 */

.kivix-rating-value {
    color: #222222;

    font-size: 11px;
    font-weight: 500;

    line-height: 1;
}


/* Review count */

.kivix-review-count {
    color: #777777;

    font-size: 11px;
    font-weight: 400;

    line-height: 1;
}


/* ==========================================================
   11. PRICE
========================================================== */

.kivix-price {
    color: #111111;

    font-family:
        "Inter",
        sans-serif;

    font-size: 14px;
    font-weight: 700;

    line-height: 1.45;
}


/* Normal amount */

.kivix-price
.woocommerce-Price-amount {
    font-weight: 700;
}


/* Old price */

.kivix-price del {
    margin-right: 6px;

    color: #999999;

    font-size: 12px;
    font-weight: 400;

    opacity: 1;
}


/* Sale price */

.kivix-price ins {
    color: #72101b;

    font-weight: 700;

    text-decoration: none;
}


/* ==========================================================
   12. CAROUSEL NAVIGATION
========================================================== */

.kivix-carousel-prev,
.kivix-carousel-next {
    position: absolute;

    top: 40%;

    z-index: 30;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    min-width: 44px;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 50% !important;

    background: #ffffff !important;
    background-color: #ffffff !important;

    color: #111111 !important;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, .10);

    cursor: pointer;

    opacity: 0;

    transform:
        translateY(-50%)
        scale(.92);

    transition:
        opacity .3s ease,
        transform .3s ease,
        background-color .3s ease,
        color .3s ease !important;
}


/* Icons */

.kivix-carousel-prev i,
.kivix-carousel-next i {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    margin: 0 !important;

    color: inherit !important;

    font-size: 18px;

    line-height: 1;
}


/* Previous */

.kivix-carousel-prev {
    left: 12px;
}


/* Next */

.kivix-carousel-next {
    right: 12px;
}


/* Show arrows */

.kivix-product-carousel:hover
.kivix-carousel-prev,

.kivix-product-carousel:hover
.kivix-carousel-next {

    opacity: 1;

    transform:
        translateY(-50%)
        scale(1);
}


/* Arrow hover */

.kivix-carousel-prev:hover,
.kivix-carousel-next:hover {

    background: #72101b !important;
    background-color: #72101b !important;

    color: #ffffff !important;
}


/* ==========================================================
   13. AJAX ADD TO CART
========================================================== */

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.kivix-cart-overlay
.kivix-add-to-cart {

    gap: 8px;
}


/* ==========================================================
   14. LOADING STATE
========================================================== */

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.kivix-add-to-cart.kivix-is-loading {

    cursor: wait !important;

    pointer-events: none !important;

    background: #ffffff !important;
    background-color: #ffffff !important;

    color: #111111 !important;

    opacity: 1 !important;
}


/* Loading icon */

.kivix-loading-icon {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 16px;
    height: 16px;

    flex: 0 0 16px;

    color: #72101b !important;

    font-size: 15px;

    line-height: 1;

    animation:
        kivixCartSpinner
        .7s
        linear
        infinite;
}


/* Spinner */

@keyframes kivixCartSpinner {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}


/* ==========================================================
   15. ADDED STATE
========================================================== */

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.kivix-add-to-cart.kivix-is-added {

    background: #ffffff !important;
    background-color: #ffffff !important;

    color: #111111 !important;
}


/* Check icon */

.kivix-added-icon {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    color: #72101b !important;

    font-size: 14px;

    line-height: 1;
}


/* Added hover */

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.kivix-add-to-cart.kivix-is-added:hover {

    background: #72101b !important;
    background-color: #72101b !important;

    color: #ffffff !important;
}


/* Added icon hover */

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.kivix-add-to-cart.kivix-is-added:hover
.kivix-added-icon {

    color: #ffffff !important;
}


/* ==========================================================
   16. REMOVE DEFAULT WOOCOMMERCE EFFECT
========================================================== */

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.add_to_cart_button.loading::after,

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.add_to_cart_button.added::after {

    display: none !important;

    content: none !important;
}


/* Woo opacity fix */

:is(
    .kivix-product-carousel,
    .kivix-product-grid
)
.add_to_cart_button.loading {

    opacity: 1 !important;
}


/* Button text */

.kivix-cart-button-text {
    display: inline-block;

    font-family:
        "Inter",
        sans-serif !important;

    line-height: 1.2;
}


/* ==========================================================
   17. PRODUCT GRID
========================================================== */

.kivix-product-grid {
    display: grid !important;

    grid-template-columns:
        repeat(
            var(--kivix-grid-columns, 4),
            minmax(0, 1fr)
        ) !important;

    grid-auto-flow: row;

    align-items: stretch;

    width: 100% !important;
    max-width: 100% !important;

    gap: 35px 20px;
}


/* Grid product */

.kivix-product-grid
> .kivix-product-card {

    width: 100% !important;

    min-width: 0 !important;
    max-width: 100% !important;

    margin: 0 !important;

    float: none !important;

    flex: none !important;
}


/* ==========================================================
   18. TABLET
========================================================== */

@media (max-width: 1024px) {


    /* Grid */

    .kivix-product-grid {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            ) !important;

        gap: 30px 18px;
    }


    /* Navigation always visible */

    .kivix-carousel-prev,
    .kivix-carousel-next {

        opacity: 1;

        transform:
            translateY(-50%)
            scale(1);
    }

}


/* ==========================================================
   19. MOBILE
========================================================== */

@media (max-width: 767px) {


    /* ======================================================
       GRID
    ====================================================== */

    .kivix-product-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            ) !important;

        gap: 25px 12px;
    }


    /* ======================================================
       CONTENT
    ====================================================== */

    .kivix-product-content {
        padding:
            11px
            1px
            5px;
    }


    /* ======================================================
       TITLE
    ====================================================== */

    .kivix-product-title {
        margin-bottom:
            4px !important;
    }


    .kivix-product-title,
    .kivix-product-title a {

        font-size:
            13px !important;

        line-height:
            1.4 !important;
    }


    /* ======================================================
       DESCRIPTION
    ====================================================== */

    .kivix-product-desc {
        margin-bottom: 6px;

        font-size: 11px;
    }


    /* ======================================================
       RATING
    ====================================================== */

    .kivix-rating {
        gap: 3px;

        margin-bottom: 6px;
    }


    .kivix-stars {
        font-size: 12px;
    }


    .kivix-rating-value,
    .kivix-review-count {

        font-size: 10px;
    }


    /* ======================================================
       PRICE
    ====================================================== */

    .kivix-price {
        font-size: 13px;
    }


    .kivix-price del {
        font-size: 10px;
    }


    /* ======================================================
       ADD TO CART

       Mobile không có hover ổn định:
       luôn hiển thị button.
    ====================================================== */

    .kivix-cart-overlay {
        position: relative;

        left: auto;
        right: auto;
        bottom: auto;

        width: 100%;

        opacity: 1;
        visibility: visible;

        transform: none;
    }


    :is(
        .kivix-product-carousel,
        .kivix-product-grid
    )
    .kivix-cart-overlay .button,

    :is(
        .kivix-product-carousel,
        .kivix-product-grid
    )
    .kivix-cart-overlay a.button {

        min-height: 43px !important;

        padding:
            9px
            8px !important;

        font-size:
            10px !important;
    }


    /* ======================================================
       CAROUSEL NAVIGATION
    ====================================================== */

    .kivix-carousel-prev,
    .kivix-carousel-next {

        display: none !important;
    }

}


/* ==========================================================
   20. SMALL MOBILE
========================================================== */

@media (max-width: 390px) {


    .kivix-product-grid {
        gap:
            22px
            10px;
    }


    .kivix-product-title,
    .kivix-product-title a {

        font-size:
            12px !important;
    }


    :is(
        .kivix-product-carousel,
        .kivix-product-grid
    )
    .kivix-cart-overlay .button,

    :is(
        .kivix-product-carousel,
        .kivix-product-grid
    )
    .kivix-cart-overlay a.button {

        min-height:
            40px !important;

        padding:
            7px
            5px !important;

        font-size:
            9px !important;
    }

}

/* ==========================================================
   KIVIX PRODUCT META
   Rating + Price + SKU + Stock
========================================================== */

.kivix-product-meta {
    width: 100%;

    font-family:
        "Inter",
        sans-serif;
}


/* ==========================================================
   RATING
========================================================== */

.kivix-meta-rating {
    display: flex;

    align-items: center;

    gap: 7px;

    margin-bottom: 8px;

    line-height: 1;
}


/* Stars */

.kivix-meta-stars {
    display: inline-flex;

    align-items: center;

    gap: 1px;

    color: rgb(245, 164, 0);

    font-size: 16px;

    line-height: 1;
}


.kivix-meta-stars span {
    display: inline-block;

    color: rgb(245, 164, 0);

    line-height: 1;
}


/* Rating number */

.kivix-meta-rating-value {
    margin-left: 4px;

    color: #1a1a1a;

    font-family:
        "Inter",
        sans-serif;

    font-size: 14px;
    font-weight: 400;

    line-height: 1;
}


/* Review */

.kivix-meta-review-count {
    color: #1a1a1a;

    font-family:
        "Inter",
        sans-serif;

    font-size: 14px;
    font-weight: 400;

    line-height: 1;
}


/* ==========================================================
   BOTTOM
========================================================== */

.kivix-meta-bottom {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 30px;

    width: 100%;
}


/* ==========================================================
   PRICE
========================================================== */

.kivix-meta-price {
    flex: 0 0 auto;

    color: #111111;

    font-family:
        "Inter",
        sans-serif;

    font-size: 23px;
    font-weight: 500;

    line-height: 1.2;
}


/* Price amount */

.kivix-meta-price
.woocommerce-Price-amount {
    color: #72101B;
    
    font-size: inherit;
    font-weight: inherit;
}


/* Sale price */

.kivix-meta-price ins {
    color: #72101b;

    font-weight: 600;

    text-decoration: none;
}


/* Old price */

.kivix-meta-price del {
    margin-right: 7px;

    color: #999999;

    font-size: .72em;
    font-weight: 400;

    opacity: 1;
}


/* ==========================================================
   SKU + STOCK
========================================================== */

.kivix-meta-product-info {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    flex-wrap: wrap;

    gap: 9px;

    margin-left: auto;

    font-family:
        "Inter",
        sans-serif;

    font-size: 13px;

    line-height: 1.3;
}


/* SKU */

.kivix-meta-sku {
    display: inline-flex;

    align-items: center;

    gap: 4px;

    color: #444444;
}


/* SKU label */

.kivix-meta-label {
    color: #333333;

    font-weight: 600;

    text-transform: uppercase;
}


/* SKU value */

.kivix-meta-sku-value {
    color: #555555;

    font-weight: 600;
}


/* Divider */

.kivix-meta-divider {
    color: #c8c8c8;

    font-weight: 400;
}


/* ==========================================================
   STOCK
========================================================== */

.kivix-meta-stock {
    font-weight: 600;

    white-space: nowrap;
}


/* In stock */

.kivix-meta-stock-in {
    color: #078c36;
}


/* Out of stock */

.kivix-meta-stock-out {
    color: #c91422;
}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 1024px) {

    .kivix-meta-bottom {
        gap: 20px;
    }


    .kivix-meta-price {
        font-size: 21px;
    }

}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 767px) {

    .kivix-meta-rating {
        margin-bottom: 10px;
    }


    .kivix-meta-stars {
        font-size: 14px;
    }


    .kivix-meta-rating-value,
    .kivix-meta-review-count {

        font-size: 12px;
    }


    .kivix-meta-bottom {
        align-items: flex-start;

        flex-direction: column;

        gap: 9px;
    }


    .kivix-meta-price {
        font-size: 20px;
    }


    .kivix-meta-product-info {
        justify-content: flex-start;

        margin-left: 0;

        font-size: 12px;
    }

}

/* ==========================================================
   KIVIX SINGLE PRODUCT GALLERY
   SWIPER VERSION
========================================================== */

.kivix-single-gallery {
    --kivix-thumb-size: 67px;
    --kivix-thumb-gap: 10px;

    position: relative;

    display: grid;

    grid-template-columns:
        var(--kivix-thumb-size)
        minmax(0, 1fr);

    align-items: start;

    gap: 22px;

    width: 100%;

    min-width: 0;
}


/* ==========================================================
   THUMB COLUMN
========================================================== */

.kivix-gallery-thumbs-wrap {
    position: relative;

    width:
        var(--kivix-thumb-size);

    height:
        calc(
            (var(--kivix-thumb-size) * 8)
            +
            (var(--kivix-thumb-gap) * 7)
        );

    max-height:
        calc(
            (var(--kivix-thumb-size) * 8)
            +
            (var(--kivix-thumb-gap) * 7)
        );

    overflow: hidden;
}


/* ==========================================================
   THUMB SWIPER
========================================================== */

.kivix-gallery-thumbs-swiper {
    position: relative;

    width: 100%;
    height: 100%;

    overflow: hidden;
}


.kivix-gallery-thumbs-swiper
.swiper-wrapper {
    align-items: stretch;
}


/* ==========================================================
   THUMB SLIDE
========================================================== */

.kivix-gallery-thumbs-swiper
.kivix-gallery-thumb-slide {

    width:
        var(--kivix-thumb-size);

    height:
        var(--kivix-thumb-size) !important;

    min-width:
        var(--kivix-thumb-size);

    margin: 0;
}


/* ==========================================================
   THUMB BUTTON
========================================================== */

.kivix-gallery-thumb {
    position: relative;

    display: flex !important;

    align-items: center;
    justify-content: center;

    width: 100% !important;
    height: 100% !important;

    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden;

    border:
        1px
        solid
        transparent !important;

    border-radius:
        6px !important;

    background:
        #f1f2f3 !important;

    box-shadow: none !important;

    cursor: pointer;

    opacity: .65;

    transform: translateZ(0);

    transition:
        opacity .25s ease,
        border-color .25s ease,
        background-color .25s ease !important;
}


/* Thumb image */

.kivix-gallery-thumb img {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-width: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    object-fit: cover;
    object-position: center;

    pointer-events: none;

    user-select: none;

    -webkit-user-drag: none;
}


/* Thumb hover */

.kivix-gallery-thumb:hover {
    opacity: .9;
}


/* Active */

.kivix-gallery-thumb.is-active {
    opacity: 1;

    border-color:
        #222222 !important;
}


/* ==========================================================
   MAIN COLUMN
========================================================== */

.kivix-gallery-main {
    position: relative;

    width: 100%;

    min-width: 0;

    overflow: hidden;
}


/* ==========================================================
   MAIN SWIPER
========================================================== */

.kivix-gallery-main-swiper {
    position: relative;

    display: block;

    width: 100%;

    aspect-ratio: 1 / 1;

    overflow: hidden;

    border-radius: 10px;

    background:
        #f1f2f3;

    cursor: grab;
}


.kivix-gallery-main-swiper:active {
    cursor: grabbing;
}


/* ==========================================================
   MAIN WRAPPER
========================================================== */

.kivix-gallery-main-swiper
.swiper-wrapper {

    align-items: stretch;

    /*
     * Swiper vẫn quản lý transform.
     * Chỉ thay easing để chuyển động mềm hơn.
     */

    transition-timing-function:
        cubic-bezier(
            .22,
            .61,
            .36,
            1
        ) !important;
}


/* ==========================================================
   MAIN SLIDE
========================================================== */

.kivix-gallery-main-swiper
.kivix-gallery-main-slide {

    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 100% !important;
    height: auto;

    aspect-ratio: 1 / 1;

    overflow: hidden;
}


/* ==========================================================
   MAIN IMAGE WRAPPER
========================================================== */

.kivix-gallery-main-image {
    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    aspect-ratio: 1 / 1;

    overflow: hidden;

    background:
        #d2dae3;
}


/* ==========================================================
   MAIN IMAGE
========================================================== */

.kivix-gallery-main-image img {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-width: 100% !important;
    max-height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    object-fit: contain;
    object-position: center;

    pointer-events: none;

    user-select: none;

    -webkit-user-drag: none;

    backface-visibility: hidden;

    transform: translateZ(0);
}


/* ==========================================================
   GALLERY CONTROLS
========================================================== */

.kivix-gallery-controls {
    position: absolute;

    right: 26px;
    bottom: 26px;

    z-index: 30;

    display: flex;

    align-items: center;

    gap: 10px;

    pointer-events: none;
}


/* ==========================================================
   CONTROL BUTTON
========================================================== */

.kivix-gallery-control {
    display: inline-flex !important;

    align-items: center;
    justify-content: center;

    flex:
        0
        0
        40px;

    width: 40px !important;
    height: 40px !important;

    min-width: 40px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    border-radius:
        9px !important;

    background:
        #171717 !important;

    color:
        #ffffff !important;

    box-shadow: none !important;

    cursor: pointer;

    pointer-events: auto;

    transition:
        background-color .25s ease,
        border-color .25s ease,
        color .25s ease,
        transform .25s ease !important;
}


.kivix-gallery-control i {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    margin: 0 !important;

    color: inherit !important;

    font-size: 14px;

    line-height: 1;

    pointer-events: none;
}


/* ==========================================================
   ZOOM
========================================================== */

.kivix-gallery-zoom {
    margin-right:
        2px !important;

    border:
        1px
        solid
        #d7d7d7 !important;

    background:
        #ffffff !important;

    color:
        #111111 !important;
}


/* ==========================================================
   CONTROL HOVER
========================================================== */

.kivix-gallery-control:hover {
    background:
        #72101b !important;

    color:
        #ffffff !important;

    transform:
        translateY(-2px);
}


.kivix-gallery-zoom:hover {
    border-color:
        #72101b !important;
}


/* ==========================================================
   DISABLED
   Trường hợp chỉ có 1 ảnh
========================================================== */

.kivix-gallery-control.swiper-button-disabled {
    opacity: .35;

    cursor: default;

    pointer-events: none;
}


/* ==========================================================
   LIGHTBOX
========================================================== */

.kivix-gallery-lightbox {
    position: fixed;

    inset: 0;

    z-index: 999999;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 50px;

    background:
        rgba(
            0,
            0,
            0,
            .88
        );

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity .3s ease,
        visibility .3s ease;
}


/* Lightbox open */

.kivix-gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;
}


/* Lightbox image */

.kivix-gallery-lightbox-image {
    display: block !important;

    width: auto !important;
    height: auto !important;

    max-width: 90vw !important;
    max-height: 88vh !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: contain;

    opacity: 1;

    transform:
        scale(.96);

    transition:
        transform
        .35s
        cubic-bezier(
            .22,
            .61,
            .36,
            1
        );
}


.kivix-gallery-lightbox.is-open
.kivix-gallery-lightbox-image {

    transform:
        scale(1);
}


/* ==========================================================
   LIGHTBOX CLOSE
========================================================== */

.kivix-gallery-lightbox-close {
    position: absolute;

    top: 24px;
    right: 24px;

    display: flex !important;

    align-items: center;
    justify-content: center;

    width: 44px !important;
    height: 44px !important;

    min-width: 44px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    border-radius:
        50% !important;

    background:
        #ffffff !important;

    color:
        #111111 !important;

    cursor: pointer;
}


.kivix-gallery-lightbox-close i {
    margin: 0 !important;

    font-size: 18px;

    line-height: 1;
}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 1024px) {

    .kivix-single-gallery {
        --kivix-thumb-size: 58px;
        --kivix-thumb-gap: 8px;

        gap: 16px;
    }


    .kivix-gallery-thumbs-wrap {
        height:
            calc(
                (var(--kivix-thumb-size) * 8)
                +
                (var(--kivix-thumb-gap) * 7)
            );

        max-height:
            calc(
                (var(--kivix-thumb-size) * 8)
                +
                (var(--kivix-thumb-gap) * 7)
            );
    }


    .kivix-gallery-controls {
        right: 18px;
        bottom: 18px;
    }

}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 767px) {

    .kivix-single-gallery {
        --kivix-thumb-size: 62px;
        --kivix-thumb-gap: 8px;

        display: flex;

        flex-direction: column;

        gap: 12px;
    }


    /* Main trước */

    .kivix-gallery-main {
        order: 1;

        width: 100%;
    }


    /* Thumbnails xuống dưới */

    .kivix-gallery-thumbs-wrap {
        order: 2;

        width: 100%;

        height:
            var(--kivix-thumb-size);

        max-height:
            var(--kivix-thumb-size);

        overflow: hidden;
    }


    .kivix-gallery-thumbs-swiper {
        width: 100%;

        height:
            var(--kivix-thumb-size);
    }


    .kivix-gallery-thumbs-swiper
    .swiper-wrapper {

        flex-direction: row;
    }


    .kivix-gallery-controls {
        right: 12px;
        bottom: 12px;

        gap: 7px;
    }


    .kivix-gallery-control {
        flex:
            0
            0
            36px;

        width: 36px !important;
        height: 36px !important;

        min-width: 36px !important;

        border-radius:
            7px !important;
    }


    .kivix-gallery-lightbox {
        padding: 20px;
    }

}


/* ==========================================================
   SMALL MOBILE
========================================================== */

@media (max-width: 390px) {

    .kivix-single-gallery {
        --kivix-thumb-size: 55px;
    }


    .kivix-gallery-controls {
        right: 10px;
        bottom: 10px;
    }

}


/* ==========================================================
   REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {

    .kivix-gallery-main-swiper
    .swiper-wrapper,

    .kivix-gallery-thumbs-swiper
    .swiper-wrapper {

        transition-duration:
            .01ms !important;
    }


    .kivix-gallery-control,
    .kivix-gallery-lightbox-image {

        transition-duration:
            .01ms !important;
    }

}