/*
 * JIDIAN PRODUCT SIX-VIEW GALLERY
 * Desktop: up to 6 views per row
 * Tablet: 3
 * Mobile: 2
 */

.jd-six-view-section {
    width: 100% !important;
}

.jd-six-view-gallery {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 18px !important;

    width: 100% !important;
    max-width: 1320px !important;

    margin-left: auto !important;
    margin-right: auto !important;

    align-items: stretch !important;
    justify-content: center !important;

    box-sizing: border-box !important;
}

.jd-six-view-card {
    min-width: 0 !important;

    background: #ffffff !important;

    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 18px !important;

    padding: 14px !important;

    box-sizing: border-box !important;

    overflow: hidden !important;

    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;

    box-shadow:
        0 8px 24px
        rgba(15, 23, 42, 0.045) !important;
}


/* ----------------------------------------------
   Product image itself
   ---------------------------------------------- */

.jd-six-view-card img {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;

    height: 280px !important;
    min-height: 280px !important;

    object-fit: contain !important;
    object-position: center center !important;

    margin: 0 auto !important;

    background: #ffffff !important;

    border-radius: 12px !important;

    transform: none !important;
}


/* ----------------------------------------------
   Labels
   ---------------------------------------------- */

.jd-six-view-card figcaption,
.jd-six-view-card > p,
.jd-six-view-card > span,
.jd-six-view-card > div:last-child {
    margin-top: 10px !important;

    text-align: center !important;

    font-size: 14px !important;
    line-height: 1.4 !important;

    font-weight: 600 !important;

    color: #334155 !important;
}


/* ----------------------------------------------
   5 actual views
   Do not stretch them to huge cards
   ---------------------------------------------- */

.jd-six-view-gallery[data-jd-view-count="5"] {
    grid-template-columns:
        repeat(5, minmax(0, 190px)) !important;

    max-width: 1070px !important;
}


/* ----------------------------------------------
   4 actual views
   This directly fixes the oversized layout
   shown in the screenshot.
   ---------------------------------------------- */

.jd-six-view-gallery[data-jd-view-count="4"] {
    grid-template-columns:
        repeat(4, minmax(0, 205px)) !important;

    max-width: 930px !important;
}


/* ----------------------------------------------
   3 views
   ---------------------------------------------- */

.jd-six-view-gallery[data-jd-view-count="3"] {
    grid-template-columns:
        repeat(3, minmax(0, 220px)) !important;

    max-width: 760px !important;
}


/* ----------------------------------------------
   2 views
   ---------------------------------------------- */

.jd-six-view-gallery[data-jd-view-count="2"] {
    grid-template-columns:
        repeat(2, minmax(0, 240px)) !important;

    max-width: 540px !important;
}


/* ----------------------------------------------
   Prevent old gallery CSS from enlarging images
   ---------------------------------------------- */

.jd-six-view-gallery figure,
.jd-six-view-gallery article,
.jd-six-view-gallery .card {
    width: auto !important;
    max-width: none !important;

    margin: 0 !important;

    box-sizing: border-box !important;
}


/* ----------------------------------------------
   Tablet
   ---------------------------------------------- */

@media (max-width: 1180px) {

    .jd-six-view-gallery,
    .jd-six-view-gallery[data-jd-view-count] {
        grid-template-columns:
            repeat(3, minmax(0, 1fr)) !important;

        max-width: 900px !important;
    }

    .jd-six-view-card img {
        height: 260px !important;
        min-height: 260px !important;
    }
}


/* ----------------------------------------------
   Mobile
   ---------------------------------------------- */

@media (max-width: 720px) {

    .jd-six-view-gallery,
    .jd-six-view-gallery[data-jd-view-count] {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        gap: 12px !important;

        max-width: 100% !important;
    }

    .jd-six-view-card {
        padding: 10px !important;
        border-radius: 14px !important;
    }

    .jd-six-view-card img {
        height: 210px !important;
        min-height: 210px !important;
    }

    .jd-six-view-card figcaption,
    .jd-six-view-card > p,
    .jd-six-view-card > span {
        font-size: 13px !important;
    }
}


/* ----------------------------------------------
   Small phones
   ---------------------------------------------- */

@media (max-width: 420px) {

    .jd-six-view-gallery,
    .jd-six-view-gallery[data-jd-view-count] {
        gap: 8px !important;
    }

    .jd-six-view-card {
        padding: 8px !important;
    }

    .jd-six-view-card img {
        height: 175px !important;
        min-height: 175px !important;
    }
}
