/* =========================================================
   OFFICE STORE
   Related Products Carousel
   ---------------------------------------------------------
   Desktop : 3 products
   Tablet  : 2 products
   Mobile  : 1 product

   Visual goal:
   - Large product images
   - Compact card
   - Clean carousel
   - Independent from Flatsome product-card styling
========================================================= */


/* =========================================================
   Main Section
========================================================= */

.office-related-products {
    width: 100%;
    margin: 35px auto 30px;
    overflow: hidden;
}


/* =========================================================
   Section Title
========================================================= */

.office-related-products__title {
    margin: 0 0 25px;
    padding: 0;

    color: #171717;

    font-size: 27px;
    font-weight: 700;
    line-height: 1.6;

    text-align: center;
}


/* =========================================================
   Carousel Wrapper
========================================================= */

.office-related-products__carousel {
    position: relative;

    width: 100%;
    margin: 0;

    padding: 0 52px 8px;

    box-sizing: border-box;

    overflow: hidden;

    direction: rtl;
}


/* =========================================================
   Before Flickity Initialization
========================================================= */

.office-related-products__carousel:not(.flickity-enabled) {

    display: flex;

    flex-wrap: nowrap;

    gap: 18px;

    box-sizing: border-box;
}


/* =========================================================
   Product Card
========================================================= */

.office-related-product {

    position: relative;

    flex: 0 0 calc((100% - 36px) / 3);

    width: calc((100% - 36px) / 3);

    min-width: 0;

    box-sizing: border-box;

    direction: rtl;

    overflow: hidden;

    border: 1px solid #e7e7e7;

    border-radius: 14px;

    background: #fff;

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}


/* =========================================================
   Hover
========================================================= */

.office-related-product:hover {

    transform: translateY(-3px);

    border-color: #dddddd;

    box-shadow:
        0 10px 28px rgba(0, 0, 0, .08);
}


/* =========================================================
   Flickity State
========================================================= */

.office-related-products__carousel.flickity-enabled {

    display: block;

    width: 100%;

    padding: 0 52px 8px;

    box-sizing: border-box;

    overflow: hidden;

    direction: rtl;
}


.office-related-products__carousel
.flickity-viewport {

    width: 100%;

    overflow: hidden;
}


.office-related-products__carousel
.flickity-slider {

    width: 100%;
}


/* =========================================================
   Flickity Product Cards
========================================================= */

.office-related-products__carousel
.flickity-slider
.office-related-product {

    width: calc((100% - 36px) / 3);

    margin-left: 18px;

    direction: rtl;
}


.office-related-products__carousel
.flickity-slider
.office-related-product:last-child {

    margin-left: 0;
}


/* =========================================================
   Product Link
========================================================= */

.office-related-product__link {

    display: block;

    width: 100%;
    height: 100%;

    color: inherit;

    text-decoration: none;
}


/* =========================================================
   PRODUCT IMAGE AREA
   ---------------------------------------------------------
   کارت همان اندازه قبلی می‌ماند.
   فضای خالی اطراف تصویر کم شده تا خود محصول بزرگ‌تر
   دیده شود.
========================================================= */

.office-related-product__image-wrap {

    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;

    height: 285px;

    /*
     * قبلاً 16px بود.
     * کاهش padding باعث می‌شود فضای بیشتری برای
     * تصویر محصول داشته باشیم.
     */
    padding: 3px;

    box-sizing: border-box;

    background: #fff;

    overflow: hidden;
}


/* =========================================================
   PRODUCT IMAGE
========================================================= */

.office-related-products__image {

    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    /*
     * مهم‌ترین تغییر:
     * خود محصول داخل تصویر 20٪ بزرگ‌تر می‌شود.
     */
    transform: scale(1.20);

    transform-origin: center center;

    transition:
        transform .3s ease;
}


/* Hover zoom */

.office-related-product:hover
.office-related-products__image {

    transform: scale(1.23);
}


/* =========================================================
   Sale Badge
========================================================= */

.office-related-product__sale {

    position: absolute;

    top: 15px;
    right: 15px;

    z-index: 5;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 55px;
    height: 55px;

    border-radius: 50%;

    background: #0798d1;

    color: #fff;

    font-size: 13px;
    font-weight: 700;

    line-height: 1;

    white-space: nowrap;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, .08);
}


/* =========================================================
   Product Content
========================================================= */

.office-related-product__content {

    padding: 10px 16px 18px;

    text-align: center;
}


/* =========================================================
   Product Category
========================================================= */

.office-related-product__category {

    margin: 0 0 4px;

    color: #777;

    font-size: 13px;
    font-weight: 400;

    line-height: 1.7;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================================================
   Product Title
========================================================= */

.office-related-product__name {

    margin: 0;

    color: #222;

    font-size: 16px;
    font-weight: 600;

    line-height: 1.8;

    display: -webkit-box;

    -webkit-box-orient: vertical;

    /*
     * چهار خط به جای سه خط
     * تا عنوان محصولات فارسی کامل‌تر دیده شود.
     */
    -webkit-line-clamp: 4;

    overflow: hidden;
}


/* =========================================================
   Hover Title
========================================================= */

.office-related-product:hover
.office-related-product__name {

    color: #0073aa;
}


/* =========================================================
   Flickity Navigation
========================================================= */

.office-related-products__carousel
.flickity-prev-next-button {

    position: absolute;

    z-index: 20;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;

    margin: 0;
    padding: 0;

    border: 1px solid #dce2e9;

    border-radius: 50%;

    background: #fff;

    color: #172033;

    box-shadow:
        0 6px 20px rgba(15, 31, 51, .14);

    opacity: 1;

    visibility: visible;

    transition:
        background-color .2s ease,
        border-color .2s ease,
        box-shadow .2s ease,
        opacity .2s ease,
        transform .2s ease;
}


/* =========================================================
   RTL Arrow Position
========================================================= */

.office-related-products__carousel
.flickity-prev-next-button.previous {

    right: 2px;

    left: auto;
}


.office-related-products__carousel
.flickity-prev-next-button.next {

    left: 2px;

    right: auto;
}


/* =========================================================
   Arrow SVG
========================================================= */

.office-related-products__carousel
.flickity-prev-next-button svg {

    fill: #172033;

    width: 18px;
    height: 18px;
}


/* =========================================================
   Arrow Hover
========================================================= */

.office-related-products__carousel
.flickity-prev-next-button:hover {

    background: #e64a00;

    border-color: #e64a00;

    box-shadow:
        0 9px 24px rgba(15, 31, 51, .18);

    transform: scale(1.04);
}


.office-related-products__carousel
.flickity-prev-next-button:hover svg {

    fill: #fff;
}


/* =========================================================
   Disabled Arrow
========================================================= */

.office-related-products__carousel
.flickity-prev-next-button:disabled {

    opacity: .25;

    cursor: default;

    pointer-events: none;
}


/* =========================================================
   Keyboard Focus
========================================================= */

.office-related-products__carousel
.flickity-prev-next-button:focus-visible {

    outline:
        3px solid rgba(230, 74, 0, .25);

    outline-offset: 2px;
}


/* =========================================================
   Hide Pagination Dots
========================================================= */

.office-related-products__carousel
.flickity-page-dots {

    display: none !important;
}


/* =========================================================
   Drag Cursor
========================================================= */

.office-related-products__carousel
.flickity-enabled.is-draggable
.flickity-viewport {

    cursor: grab;
}


.office-related-products__carousel
.flickity-enabled.is-draggable
.flickity-viewport.is-pointer-down {

    cursor: grabbing;
}


/* =========================================================
   TABLET
========================================================= */

@media (min-width: 641px) and (max-width: 1050px) {

    .office-related-products__title {

        font-size: 24px;

        margin-bottom: 22px;
    }


    .office-related-products__carousel {

        padding-right: 48px;
        padding-left: 48px;
    }


    .office-related-products__carousel.flickity-enabled {

        padding-right: 48px;
        padding-left: 48px;
    }


    /*
     * Two products
     */

    .office-related-product {

        flex-basis:
            calc((100% - 18px) / 2);

        width:
            calc((100% - 18px) / 2);
    }


    .office-related-products__carousel
    .flickity-slider
    .office-related-product {

        width:
            calc((100% - 18px) / 2);

        margin-left: 18px;
    }


    /* Image */

    .office-related-product__image-wrap {

        height: 250px;

        padding: 2px;
    }


    .office-related-products__image {

        transform: scale(1.18);
    }


    .office-related-product:hover
    .office-related-products__image {

        transform: scale(1.21);
    }


    /* Text */

    .office-related-product__name {

        font-size: 16px;
    }


    /* Badge */

    .office-related-product__sale {

        width: 52px;
        height: 52px;

        top: 14px;
        right: 14px;
    }


    /* Arrows */

    .office-related-products__carousel
    .flickity-prev-next-button {

        width: 44px;
        height: 44px;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 640px) {

    .office-related-products {

        margin-top: 26px;

        margin-bottom: 24px;
    }


    .office-related-products__title {

        margin-bottom: 18px;

        font-size: 21px;

        line-height: 1.6;
    }


    .office-related-products__carousel {

        padding-right: 44px;
        padding-left: 44px;
    }


    .office-related-products__carousel.flickity-enabled {

        padding-right: 44px;
        padding-left: 44px;
    }


    /* =====================================================
       One Product Per View
    ===================================================== */

    .office-related-product {

        flex:
            0 0 100%;

        width:
            100%;

        border-radius: 12px;
    }


    .office-related-products__carousel
    .flickity-slider
    .office-related-product {

        width: 100%;

        margin-left: 0;
    }


    /* =====================================================
       Mobile Image
    ===================================================== */

    .office-related-product__image-wrap {

        height: 250px;

        padding: 2px;
    }


    .office-related-products__image {

        transform: scale(1.18);
    }


    .office-related-product:hover
    .office-related-products__image {

        transform: scale(1.21);
    }


    /* =====================================================
       Mobile Content
    ===================================================== */

    .office-related-product__content {

        padding: 9px 12px 15px;
    }


    .office-related-product__category {

        margin-bottom: 3px;

        font-size: 11px;

        line-height: 1.6;
    }


    .office-related-product__name {

        font-size: 15px;

        line-height: 1.75;

        -webkit-line-clamp: 4;
    }


    /* =====================================================
       Mobile Sale Badge
    ===================================================== */

    .office-related-product__sale {

        top: 11px;
        right: 11px;

        width: 48px;
        height: 48px;

        font-size: 11px;
    }


    /* =====================================================
       Mobile Arrows
    ===================================================== */

    .office-related-products__carousel
    .flickity-prev-next-button {

        width: 40px;
        height: 40px;
    }


    .office-related-products__carousel
    .flickity-prev-next-button.previous {

        right: 1px;

        left: auto;
    }


    .office-related-products__carousel
    .flickity-prev-next-button.next {

        left: 1px;

        right: auto;
    }


    .office-related-products__carousel
    .flickity-prev-next-button svg {

        width: 16px;
        height: 16px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .office-related-products__title {

        font-size: 19px;
    }


    .office-related-products__carousel {

        padding-right: 40px;
        padding-left: 40px;
    }


    .office-related-products__carousel.flickity-enabled {

        padding-right: 40px;
        padding-left: 40px;
    }


    .office-related-product__image-wrap {

        height: 225px;

        padding: 2px;
    }


    .office-related-products__image {

        transform: scale(1.15);
    }


    .office-related-product:hover
    .office-related-products__image {

        transform: scale(1.18);
    }


    .office-related-product__name {

        font-size: 14px;
    }


    .office-related-product__sale {

        width: 44px;
        height: 44px;

        font-size: 10px;
    }


    .office-related-products__carousel
    .flickity-prev-next-button {

        width: 36px;
        height: 36px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .office-related-product,
    .office-related-products__image,
    .office-related-products__carousel
    .flickity-prev-next-button {

        transition: none;
    }
}
/* =========================================================
   FINAL TUNING
   Use the full article content width
========================================================= */


/* ---------------------------------------------------------
   Use the entire available content width
   Do NOT reserve 52px on both sides
--------------------------------------------------------- */

.office-related-products__carousel,
.office-related-products__carousel.flickity-enabled {

    width: 100%;

    padding-left: 0;
    padding-right: 0;

    box-sizing: border-box;
}


/* ---------------------------------------------------------
   Make the 3 cards actually wider
--------------------------------------------------------- */

.office-related-products__carousel
.flickity-slider
.office-related-product {

    width: calc((100% - 36px) / 3);

    margin-left: 18px;
}


/* ---------------------------------------------------------
   Give the product image more visual size
--------------------------------------------------------- */

.office-related-product__image-wrap {

    height: 285px;

    padding: 0;
}


.office-related-products__image {

    transform: scale(1.35);

    transform-origin: center center;
}


.office-related-product:hover
.office-related-products__image {

    transform: scale(1.39);
}


/* ---------------------------------------------------------
   Keep badge above the enlarged image
--------------------------------------------------------- */

.office-related-product__sale {

    top: 14px;
    right: 14px;

    z-index: 10;
}


/* ---------------------------------------------------------
   Put arrows over the edges instead of reserving space
--------------------------------------------------------- */

.office-related-products__carousel
.flickity-prev-next-button.previous {

    right: 4px;
    left: auto;
}


.office-related-products__carousel
.flickity-prev-next-button.next {

    left: 4px;
    right: auto;
}


/* =========================================================
   MOBILE
   One card, full available width
========================================================= */

@media (max-width: 640px) {

    .office-related-products__carousel,
    .office-related-products__carousel.flickity-enabled {

        padding-left: 0;
        padding-right: 0;
    }


    .office-related-products__carousel
    .flickity-slider
    .office-related-product {

        width: 100%;

        margin-left: 0;
    }


    .office-related-product__image-wrap {

        height: 250px;

        padding: 0;
    }


    .office-related-products__image {

        transform: scale(1.25);
    }


    .office-related-product:hover
    .office-related-products__image {

        transform: scale(1.28);
    }


    .office-related-products__carousel
    .flickity-prev-next-button.previous {

        right: 4px;
        left: auto;
    }


    .office-related-products__carousel
    .flickity-prev-next-button.next {

        left: 4px;
        right: auto;
    }
}