/* ============================================================
   SẢN PHẨM HỌC SINH
============================================================ */

body.student-products-open {
    overflow: hidden;
}


/* ============================================================
   DIALOG
============================================================ */

.student-products-dialog {
    width: min(97vw, 1580px);
    max-width: 1580px;
    max-height: 96dvh;

    margin: auto;
    padding: 0;

    border: 0;
    border-radius: 28px;

    background: #fff;

    color: #183c5d;

    overflow: hidden;

    box-shadow:
        0 28px 100px
        rgba(0, 35, 82, 0.38);
}


.student-products-dialog::backdrop {
    background:
        rgba(5, 25, 58, 0.72);

    backdrop-filter:
        blur(7px);
}


.student-products-shell {
    display: flex;
    flex-direction: column;

    width: 100%;
    max-height: 96dvh;

    background: #fff;
}


/* ============================================================
   HEADER
============================================================ */

.student-products-header {
    position: relative;

    z-index: 20;

    flex: 0 0 auto;

    min-height: 92px;

    padding:
        18px
        86px
        17px
        24px;

    display: flex;

    align-items: center;

    border-bottom:
        1px solid #cde9f4;

    background:
        linear-gradient(
            115deg,
            #e9f9ff 0%,
            #f7eeff 46%,
            #fff4ca 100%
        );
}


.student-products-heading {
    display: flex;

    align-items: center;

    gap: 14px;

    min-width: 0;
}


.student-products-heading-icon {
    flex: 0 0 auto;

    width: 52px;
    height: 52px;

    display: grid;

    place-items: center;

    border:
        3px solid
        rgba(255, 255, 255, 0.86);

    border-radius: 17px;

    background:
        linear-gradient(
            145deg,
            #fff3a7,
            #ffd7f1
        );

    font-size: 29px;

    box-shadow:
        0 5px 15px
        rgba(66, 65, 135, 0.15);

    transform:
        rotate(-3deg);
}


.student-products-title {
    margin: 0;

    color: #083f91;

    font-size:
        clamp(
            23px,
            2.7vw,
            34px
        );

    line-height: 1.2;

    font-weight: 950;
}


.student-products-subtitle {
    margin:
        6px 0 0;

    color: #526e85;

    font-size: 14px;
}


/* ============================================================
   CLOSE
============================================================ */

.student-products-close {
    position: absolute;

    top: 14px;
    right: 17px;

    z-index: 50;

    width: 58px;
    height: 58px;

    padding: 0;

    display: grid;

    place-items: center;

    border: 0;

    background: transparent;

    cursor: pointer;

    transition:
        transform 150ms ease,
        filter 150ms ease;
}


.student-products-close:hover {
    transform:
        scale(1.09)
        rotate(-5deg);

    filter:
        drop-shadow(
            0 8px 8px
            rgba(170, 0, 0, 0.23)
        );
}


.student-products-close:active {
    transform:
        scale(0.90)
        rotate(3deg);
}


.student-products-close:focus-visible {
    outline:
        4px solid
        rgba(42, 142, 231, 0.25);

    outline-offset: 1px;

    border-radius: 15px;
}


.student-products-close-icon {
    width: 52px;
    height: 52px;

    display: block;

    pointer-events: none;
}


/* ============================================================
   BODY
============================================================ */

.student-products-body {
    flex: 1;

    min-height: 0;

    padding: 14px;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;

    scrollbar-gutter: stable;

    background:

        radial-gradient(
            circle at 15px 15px,
            rgba(91, 187, 246, 0.12) 2px,
            transparent 2.5px
        ),

        linear-gradient(
            135deg,
            #f5fcff,
            #fff9ef 50%,
            #f8f2ff
        );

    background-size:
        34px 34px,
        auto;
}


/* ============================================================
   ALBUM
============================================================ */

.student-products-album {
    position: relative;

    width: 100%;

    min-height: 100%;

    padding:
        clamp(
            12px,
            2vw,
            24px
        );

    border:
        2px dashed
        rgba(65, 163, 220, 0.22);

    border-radius: 24px;

    background:
        rgba(255, 255, 255, 0.64);
}


.student-products-album::before {
    content: "⭐";

    position: absolute;

    right: 78px;
    top: 8px;

    z-index: 1;

    font-size: 31px;

    transform:
        rotate(13deg);

    pointer-events: none;
}


.student-products-album::after {
    content: "✏️";

    position: absolute;

    left: 8px;
    bottom: 8px;

    z-index: 1;

    font-size: 30px;

    transform:
        rotate(-18deg);

    pointer-events: none;
}


/* ============================================================
   ALBUM HEADER
============================================================ */

.student-products-album-head {
    position: relative;

    z-index: 2;

    margin-bottom: 15px;

    padding:
        13px
        16px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    border:
        1px solid #cde7f5;

    border-radius: 18px;

    background:
        rgba(255, 255, 255, 0.95);

    box-shadow:
        0 5px 18px
        rgba(32, 99, 143, 0.08);
}


.student-products-kicker {
    display: inline-block;

    margin-bottom: 4px;

    color: #d54b83;

    font-size: 13px;

    font-weight: 900;
}


.student-products-album-head h3 {
    margin: 0;

    color: #104f91;

    font-size:
        clamp(
            17px,
            2vw,
            23px
        );

    line-height: 1.35;

    font-weight: 900;
}


.student-products-count {
    flex: 0 0 auto;

    min-width: 78px;

    padding:
        7px
        11px;

    display: flex;

    flex-direction: column;

    align-items: center;

    border:
        2px solid #ffca59;

    border-radius: 17px;

    background: #fff9d9;

    color: #8a5a00;
}


.student-products-count strong {
    font-size: 23px;

    line-height: 1;
}


.student-products-count span {
    margin-top: 3px;

    font-size: 10px;

    font-weight: 800;
}


/* ============================================================
   GALLERY
============================================================ */

.student-products-gallery {
    position: relative;

    z-index: 2;

    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    grid-auto-flow:
        row dense;

    align-items: start;

    gap: 13px;

    width: 100%;
}


.student-product-stamp.is-measuring {
    grid-column:
        1 / -1;
}


.student-product-stamp.is-portrait,
.student-product-stamp.is-square {
    grid-column:
        span 1;
}


.student-product-stamp.is-landscape,
.student-product-stamp.is-unpaired-portrait,
.student-product-stamp.is-missing {
    grid-column:
        1 / -1;
}


/* ============================================================
   CARD
============================================================ */

.student-product-stamp {
    position: relative;

    width: 100%;

    min-width: 0;

    padding: 8px;

    border:
        1px solid
        rgba(25, 105, 160, 0.13);

    border-radius: 19px;

    background: #fff;

    box-shadow:
        0 8px 23px
        rgba(18, 77, 119, 0.13);

    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}


.student-product-stamp:hover {
    transform:
        translateY(-2px);

    box-shadow:
        0 13px 30px
        rgba(18, 77, 119, 0.18);
}


.student-product-stamp:nth-child(4n + 1) {
    background: #fff7fb;
}


.student-product-stamp:nth-child(4n + 2) {
    background: #f3fbff;
}


.student-product-stamp:nth-child(4n + 3) {
    background: #fffbea;
}


.student-product-stamp:nth-child(4n + 4) {
    background: #f6fff2;
}


/* ============================================================
   TAPE
============================================================ */

.student-product-tape {
    position: absolute;

    top: -7px;
    left: 50%;

    z-index: 5;

    width: 72px;
    height: 18px;

    border:
        1px solid
        rgba(194, 145, 25, 0.16);

    background:
        rgba(255, 230, 117, 0.78);

    transform:
        translateX(-50%)
        rotate(-2deg);

    pointer-events: none;
}


/* ============================================================
   IMAGE BUTTON
============================================================ */

.student-product-open {
    position: relative;

    display: block;

    width: 100%;

    padding: 0;

    border: 0;

    border-radius: 14px;

    background: transparent;

    cursor: zoom-in;

    overflow: hidden;
}


.student-product-open:disabled {
    cursor: default;
}


.student-product-open:focus-visible {
    outline:
        4px solid
        rgba(48, 155, 229, 0.24);

    outline-offset: 3px;
}


/* ============================================================
   IMAGE AREA
============================================================ */

.student-product-media {
    position: relative;

    display: grid;

    place-items: center;

    width: 100%;

    min-height: 100px;

    border:
        1px solid #dfeef5;

    border-radius: 14px;

    background: #fff;

    overflow: hidden;
}


.student-product-image {
    display: block;

    width: 100%;
    max-width: 100%;

    height: auto;

    object-fit: contain;

    object-position: center;

    user-select: none;
}


/* ============================================================
   MISSING IMAGE
============================================================ */

.student-product-missing {
    width: 100%;

    min-height: 160px;

    padding: 18px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 7px;

    color: #7b8590;

    background:
        repeating-linear-gradient(
            -45deg,
            #fbfcfd,
            #fbfcfd 11px,
            #f2f5f7 11px,
            #f2f5f7 22px
        );
}


.student-product-missing[hidden] {
    display: none;
}


.student-product-missing-icon {
    font-size: 32px;
}


/* ============================================================
   EMPTY
============================================================ */

.student-products-empty {
    width:
        min(
            100%,
            700px
        );

    margin:
        20px auto;

    padding:
        34px 22px;

    border:
        2px dashed #bcdce9;

    border-radius: 22px;

    background:
        rgba(255, 255, 255, 0.86);

    color: #637e91;

    text-align: center;

    line-height: 1.65;
}


.student-products-empty-icon {
    margin-bottom: 8px;

    font-size: 42px;
}


.student-products-empty strong {
    display: block;

    color: #31698e;

    font-size: 17px;
}


.student-products-empty p {
    margin:
        8px auto 0;

    max-width: 500px;
}


/* ============================================================
   FULL SCREEN VIEWER
============================================================ */

.student-products-viewer {
    position: fixed;

    inset: 0;

    z-index: 9999;

    padding:
        54px
        80px
        28px;

    display: grid;

    grid-template-columns:
        64px
        minmax(0, 1fr)
        64px;

    align-items: center;

    gap: 12px;

    background:
        rgba(5, 18, 42, 0.95);

    backdrop-filter:
        blur(12px);
}


.student-products-viewer[hidden] {
    display: none;
}


.student-products-viewer-content {
    min-width: 0;
    min-height: 0;

    display: flex;

    align-items: center;

    justify-content: center;
}


.student-products-viewer-image {
    display: block;

    width: auto;
    height: auto;

    max-width: 100%;

    max-height:
        calc(
            100dvh -
            90px
        );

    object-fit: contain;

    border:
        5px solid #fff;

    border-radius: 15px;

    background: #fff;

    box-shadow:
        0 15px 55px
        rgba(0, 0, 0, 0.46);
}


.student-products-viewer-close {
    position: fixed;

    top: 14px;
    right: 17px;
}


/* ============================================================
   VIEWER NAVIGATION
============================================================ */

.student-products-viewer-nav {
    width: 58px;
    height: 72px;

    display: grid;

    place-items: center;

    border:
        2px solid
        rgba(255, 255, 255, 0.38);

    border-radius: 20px;

    background:
        rgba(255, 255, 255, 0.12);

    color: #fff;

    font-family: inherit;

    font-size: 54px;

    line-height: 1;

    cursor: pointer;

    transition:
        transform 150ms ease,
        background 150ms ease;
}


.student-products-viewer-nav:hover {
    transform:
        scale(1.06);

    background:
        rgba(255, 255, 255, 0.23);
}


.student-products-viewer-nav:focus-visible {
    outline:
        4px solid
        rgba(255, 255, 255, 0.35);

    outline-offset: 3px;
}


.student-products-viewer.is-single
.student-products-viewer-nav {
    visibility: hidden;

    pointer-events: none;
}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 720px) {

    .student-products-dialog {
        width: 97vw;

        max-height: 97dvh;

        border-radius: 20px;
    }


    .student-products-shell {
        max-height: 97dvh;
    }


    .student-products-header {
        min-height: 76px;

        padding:
            13px
            67px
            12px
            13px;
    }


    .student-products-heading {
        gap: 9px;
    }


    .student-products-heading-icon {
        width: 42px;
        height: 42px;

        font-size: 23px;
    }


    .student-products-title {
        font-size: 21px;
    }


    .student-products-subtitle {
        font-size: 11px;
    }


    .student-products-close {
        top: 8px;
        right: 7px;

        width: 52px;
        height: 52px;
    }


    .student-products-close-icon {
        width: 46px;
        height: 46px;
    }


    .student-products-body {
        padding: 8px;
    }


    .student-products-album {
        padding: 9px;
    }


    .student-products-gallery {
        grid-template-columns:
            minmax(0, 1fr);

        gap: 10px;
    }


    .student-product-stamp,
    .student-product-stamp.is-portrait,
    .student-product-stamp.is-landscape,
    .student-product-stamp.is-square,
    .student-product-stamp.is-unpaired-portrait,
    .student-product-stamp.is-measuring,
    .student-product-stamp.is-missing {
        grid-column:
            1 / -1;
    }


    .student-products-viewer {
        padding:
            64px
            8px
            16px;

        grid-template-columns:
            40px
            minmax(0, 1fr)
            40px;

        gap: 5px;
    }


    .student-products-viewer-nav {
        width: 38px;
        height: 55px;

        border-radius: 14px;

        font-size: 37px;
    }


    .student-products-viewer-image {
        max-height:
            calc(
                100dvh -
                88px
            );

        border-width: 3px;
    }

}


/* ============================================================
   SMALL PHONE
============================================================ */

@media (max-width: 420px) {

    .student-products-heading-icon {
        display: none;
    }


    .student-products-album-head {
        flex-direction: column;

        align-items: flex-start;
    }


    .student-products-count {
        flex-direction: row;

        gap: 5px;
    }

}


/* ============================================================
   REDUCED MOTION
============================================================ */

@media (
    prefers-reduced-motion:
    reduce
) {

    .student-product-stamp,
    .student-products-close,
    .student-products-viewer-nav {
        transition: none !important;
    }

}