/* Loaded only by the product detail view. */
body {
    min-width: 0;
    max-width: none;
}

body .base {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body .base > *,
body .detailGrid > * {
    min-width: 0;
}

body .detailGrid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}

body #splq .Product {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

body #splq .pi {
    min-width: 0;
    overflow-wrap: break-word;
}

@media (min-width: 1024px) {
    #splq:not(.related-expanded) .Product > .pi:nth-child(n+6) { display: none; }
}
@media (min-width: 601px) and (max-width: 1023px) {
    #splq:not(.related-expanded) .Product > .pi:nth-child(n+4) { display: none; }
}
@media (max-width: 600px) {
    #splq:not(.related-expanded) .Product > .pi:nth-child(n+3) { display: none; }
}
#splq .related-more {
    align-self: center;
    margin: 16px auto 4px;
    padding: 10px 28px;
    border: 1px solid #2a83e9;
    border-radius: 6px;
    background: #fff;
    color: #1767b4;
    font: inherit;
    cursor: pointer;
}
#splq .related-more:hover { background: #eef6ff; }
#splq .related-more:focus-visible { outline: 2px solid #1767b4; outline-offset: 3px; }
#splq .related-more[hidden] { display: none; }

body .fotorama,
body .fotorama__wrap,
body .fotorama__nav-wrap {
    max-width: 100%;
}

#product-gallery {
    align-self: start;
    background: #fff;
    padding: 0;
}

body .base > #product-gallery:not(.fotorama--fullscreen) {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    float: none;
}

#product-gallery:not(.fotorama--fullscreen) .fotorama__stage__frame > .fotorama__img {
    transform: scale(0.88);
    transform-origin: center;
}

#product-gallery:not(.product-gallery-ready) {
    aspect-ratio: 1 / 1;
}

#product-gallery .fotorama__stage,
#product-gallery .fotorama__thumb {
    background: #fff;
}

body .des img {
    object-fit: contain;
    height: auto;
}

/* Fullscreen uses the viewport, independently of the inline square gallery. */
#product-gallery .product-image-counter {
    display: none;
}
#product-gallery.fotorama--fullscreen,
#product-gallery.fotorama--fullscreen .fotorama__wrap {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    background: #fff;
}
#product-gallery.fotorama--fullscreen .fotorama__stage {
    width: 100% !important;
    height: calc(100% - 72px) !important;
    background: #fff;
}
#product-gallery.fotorama--fullscreen .fotorama__stage__shaft,
#product-gallery.fotorama--fullscreen .fotorama__stage__frame {
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
}
#product-gallery.fotorama--fullscreen .fotorama__stage__frame > .fotorama__img {
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    top: 0 !important;
    padding: 56px 56px 20px !important;
    box-sizing: border-box;
    object-fit: contain;
    transform: none;
}
#product-gallery.fotorama--fullscreen .fotorama__nav-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: #fff;
}
#product-gallery.fotorama--fullscreen .fotorama__nav {
    width: 100% !important;
    background: #fff;
}
#product-gallery.fotorama--fullscreen .fotorama__fullscreen-icon,
#product-gallery.fotorama--fullscreen .fotorama__arr {
    width: 44px;
    height: 44px;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 50%;
    box-shadow: 0 2px 8px #0002;
    opacity: 1 !important;
    transform: none !important;
    text-align: center;
}
#product-gallery.fotorama--fullscreen .fotorama__fullscreen-icon {
    position: fixed;
    top: 12px;
    right: 12px;
}
#product-gallery.fotorama--fullscreen .fotorama__arr {
    margin-top: -22px;
}
#product-gallery.fotorama--fullscreen .fotorama__arr--prev { left: 8px; }
#product-gallery.fotorama--fullscreen .fotorama__arr--next { right: 8px; }
#product-gallery.fotorama--fullscreen .fotorama__fullscreen-icon::before {
    content: '\00d7';
    font: 32px/40px Arial, sans-serif;
}
#product-gallery.fotorama--fullscreen .fotorama__arr::before {
    font: 36px/38px Arial, sans-serif;
}
#product-gallery.fotorama--fullscreen .fotorama__arr--prev::before { content: '\2039'; }
#product-gallery.fotorama--fullscreen .fotorama__arr--next::before { content: '\203a'; }
#product-gallery.fotorama--fullscreen .product-image-counter {
    display: block;
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    padding: 5px 12px;
    border-radius: 16px;
    background: #f3f4f5;
    color: #333;
    font: 14px/20px Arial, sans-serif;
    pointer-events: none;
}

body .deal,
body .dbox {
    overflow-wrap: break-word;
}

body .des img,
body .des iframe {
    max-width: 100%;
}

body .head1 {
    flex-wrap: wrap;
    gap: 12px 20px;
}

body .head1 > div:first-child {
    flex: 1 1 520px;
    min-width: 0;
}

body .head1 > div:last-child {
    margin-left: auto;
}

body .head1 form {
    flex: 1 1 200px;
    min-width: 0;
    width: auto;
    max-width: 360px;
    margin-left: 24px;
}

body .search-box {
    width: 100%;
}

body .nav .mw {
    width: 100%;
    max-height: 75vh;
    overflow-y: auto;
}

body #vcart fieldset {
    max-width: calc(100vw - 32px);
}

body .thuongmua li div {
    min-width: 0;
    flex-wrap: wrap;
}

body #formvote {
    max-width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
}

@media (min-width: 1200px) {
    /* Leave a gutter for the floating contact controls. */
    body #main > .wrap {
        width: calc(100% - 112px);
    }
    body #panel {
        right: 8px;
        width: 40px;
    }
    body #panel img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 1199px) {
    body .wrap {
        width: calc(100% - 24px);
        padding-left: 0;
        padding-right: 0;
    }
    body .head1 .open {
        margin-right: 16px;
    }
    body .nav li .a1 {
        padding-right: 12px;
        font-size: 13px;
    }
    /* Keep every contact action, without covering the product or its price. */
    body #panel {
        position: static;
        clear: both;
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: center;
        gap: 14px;
        padding: 12px;
        background: #fff;
    }
    body #panel a,
    body #panel img {
        display: block;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 1023px) {
    /* The mobile header has no desktop .wrap centering rule. */
    body #main > .wrap {
        width: calc(100% - 16px);
        margin-left: auto;
        margin-right: auto;
        float: none;
    }
    body .base,
    body .detailGrid {
        grid-template-columns: minmax(0, 1fr);
    }
    body .base > .fotorama {
        width: 100%;
        max-width: 680px;
        margin: 0 auto;
        float: none;
    }
    body .deal {
        padding: 0 12px 12px;
    }
    body .rbox {
        order: 4;
    }
    body .detailGrid .Product {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    body #splq .Product {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    body #footer .f0 {
        flex-direction: column;
        gap: 24px;
    }
    body #footer .f2,
    body #footer .f3 {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    /* Use the phone width for both product photos and the information below. */
    body #main > .wrap {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    body .base {
        padding: 8px 0 12px;
        border-radius: 0;
    }
    body .base > #product-gallery:not(.fotorama--fullscreen) {
        max-width: 100%;
    }
    #product-gallery:not(.fotorama--fullscreen) .fotorama__stage__frame > .fotorama__img {
        transform: scale(0.94);
    }
    body .head1 > div:first-child {
        flex-wrap: wrap;
        gap: 12px;
    }
    body .head1 form {
        flex-basis: 100%;
        max-width: none;
        margin-left: 0;
    }
    body .nav .mw {
        padding: 12px;
    }
    body .nav .m1 {
        width: 40%;
    }
    body .nav .m23 {
        width: 60%;
    }
    body .nav .m2,
    body .nav .m3,
    body .nav .m4 {
        width: 100%;
        min-height: 0;
    }
    body .nav .m1 a,
    body .nav .m2 a {
        padding: 4px 8px;
        height: auto;
        min-height: 40px;
    }
    body .pname {
        font-size: 21px;
        line-height: 1.4;
    }
    body #splq .Product {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    body .deal {
        padding: 0 12px 12px;
    }
    body .uudiem,
    body .dbox {
        padding: 12px;
        border-radius: 0;
    }
    body .sticky span {
        padding: 12px 8px;
        font-size: 13px;
    }
    body .thuongmua li div {
        flex-direction: column;
        align-items: flex-start;
    }
    body .thuongmua li span {
        margin-left: 0;
    }
    body #footer .f31,
    body #footer .f32 {
        width: 100%;
    }
    body #footer .social {
        flex-wrap: wrap;
        gap: 8px 0;
    }
    body #footer .srt {
        flex-direction: column;
    }
    body #footer .srt div,
    body #footer .srt figure {
        width: 100%;
        margin-right: 0;
    }
    body .tuvan img {
        width: 80px;
        flex-shrink: 0;
    }
    body .tuvan span {
        min-width: 0;
    }
}
