:root {
    --transition-speed: 0.3s;
    --transition-ease: cubic-bezier(.22, .61, .36, 1);
    --transition-speedBUTTON: 0.6s;
    --borderALL: 1em;
    --borderBOT: 0 0 16px 16px;
    --padding: 30px;
    --paddingM: 6px;
    --maxwidthJS: 450px;
    --fontSIZE: 17px;
    --bgSection2: #39291A;
    --columNumber: 3;
    --borderColor: #333333;
    --textColorD: #000;
    --textColorN: #fff;
    --backgroundColorD: linear-gradient(to right, #25aae1, #4481eb, #04befe, #3f86ed);
    --backgroundColorN: linear-gradient(to right, #25aae1, #4481eb, #04befe, #3f86ed);
}
/* Font embedding */
@font-face {
    font-family: 'Arial1';
    src: url('Font_SFProRoundedR.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}
/* Global */
html, body {
    margin: 0;
    padding: 0;
    font-family: Arial1, sans-serif;
    background: #000;
    color: #fff;
    font-size: var(--fontSIZE);
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
*, *::before, *::after {
    box-sizing: border-box;
} /* tránh cho các thành phần con tràn ra ngoài như các textbox input */
input {
    font-family: inherit;
}
div#cartModal {
    color: black;
}
#cartModal input, #cartModal textarea {
    width: ;
}
/* ===============================
   SCENE ROOT + FADE
================================ */
/* Thêm class này vào body để kiểm soát trạng thái */
body.is-product-page {
    overflow-y: auto !important;
}

/* 2. Cố định Scene trong lúc intro */
.scene {
    position: fixed; /* Chuyển thành fixed để nó luôn nằm trên cùng khi zoom */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 5; /* Nằm dưới Dock nhưng trên Product lúc đầu */
    overflow: hidden;
    transition: opacity 0.6s ease;
}

/* 3. Khi sang trang sản phẩm */
body.is-product-page .scene {
    position: absolute; /* Trở về absolute để nó trôi lên trên khi cuộn trang */
    pointer-events: none;
}

.product-page {
    position: relative;
    z-index: 10;
    margin-top: 100vh; /* ĐẨY trang sản phẩm xuống dưới tầm nhìn của Scene intro */
    min-height: 150vh; /* Đảm bảo đủ dài để cuộn */
    padding: 60px;
    background-color: #575b5c;
    background-image: url("img/bg1.png");
}

.scene.fade-out { opacity: 0; }
.scene.fade-in  { opacity: 1; }

/* ===============================
   BACKGROUND
================================ */
.bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    will-change: transform, filter;
}

/* ===============================
   MAIN OBJECT
================================ */
.main {
    position: absolute;
    transform-origin: center center;
    will-change: transform;
    pointer-events: none;
    filter:
    drop-shadow(0 4px 8px rgba(0,0,0,0.35))
    drop-shadow(0 12px 28px rgba(0,0,0,0.25));
}

/* ===============================
   LOGO
================================ */
.logo {
    position: absolute;
    transform-origin: center top;
    opacity: 0;
    will-change: transform, opacity;
    pointer-events: none;
    z-index: 100; /* Phải cao hơn #main và .scene */
    pointer-events: none;
}

/* ===============================
   FOREGROUND
================================ */
.fg-left, .fg-right {
    position: absolute;
    bottom: 0;
    width: 420px;
    will-change: transform;
}
.fg-left { left: 0; }
.fg-right { right: 0; }

/* ===============================
   TOP DOCK (MACOS STYLE)
================================ */
.top-dock {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.dock-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 0 12px;
    border-radius: 999px;
    /*background: rgba(255, 255, 0, 1);*/
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
    0 8px 24px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.08);
    color: #fff;
    font-size: 14.5px;
    animation: dockFloat 4s ease-in-out infinite;
}

@keyframes dockFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.brand {
    font-weight: 600;
    letter-spacing: 0.2px;
}

.address {
    opacity: 0.85;
    white-space: nowrap;
}

.sep {
    opacity: 0.4;
}

/* ===============================
   HOTLINE GLOW
================================ */
.hotline {
    position: relative;
    width: max-content;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #c40000, #ff2a2a);
    color: #fff;
    font-weight: 600;
    overflow: hidden;
    box-shadow:
    0 0 0 1px rgba(255,255,255,0.15),
    0 6px 16px rgba(255,0,0,0.45);
}

/* ánh sáng quét */
.hotline .shine {
    position: absolute;
    top: -50%;
    left: -30%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255,255,255,0.6),
        transparent
    );
    transform: rotate(15deg);
    animation: shineMove 2.8s ease-in-out infinite;
}

@keyframes shineMove {
    0%   { left: -40%; opacity: 0; }
    30%  { opacity: 1; }
    60%  { left: 120%; opacity: 0; }
    100% { left: 120%; opacity: 0; }
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 900px) {
    .address { display: none; }
}


/* ===============================
   SWIPE HINT
================================ */
.swipe-hint {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.6;
    pointer-events: none;
    animation: hintMove 2.5s infinite;
}
.swipe-hint img { width: 36px; }
.hint-text {
    color: #fff;
    font-size: 18px;
}
@keyframes hintMove {
    0%   { transform: translate(-50%,0); }
    50%  { transform: translate(-45%,0); }
    100% { transform: translate(-50%,0); }
}

/* ===============================
   NAV
================================ */
.nav-arrow {
    position: absolute;
    top: 50%;
    font-size: 64px;
    color: #fff;
    opacity: 0.35;
    cursor: pointer;
    user-select: none;
    transform: translateY(-50%);
}
.nav-arrow:hover { opacity: 0.7; }
.nav-arrow.left { left: 20px; }
.nav-arrow.right { right: 20px; }

.scene-dots {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    display: none;
}
.scene-dots div {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    opacity: 0.3;
    cursor: pointer;
}
.scene-dots .active { opacity: 0.9; }
/* ===============================
   PRODUCT PAGE
================================ */


.product-page h2 {
    font-size: 32px;
    margin-bottom: 40px;
    text-align: center;
    letter-spacing: 0.4px;
}

/* GRID */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

/* CARD */
.product-card {
    position: relative;
    background: #1c1c1c;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
    transition:
    transform var(--transition-speed) var(--transition-ease),
    box-shadow var(--transition-speed) var(--transition-ease);
}
.product-card:hover {
    transform: scale(1.01);
    box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.18);
}

/* IMAGE */
.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #000;
    transition:
    transform var(--transition-speed) var(--transition-ease),
    filter var(--transition-speed) var(--transition-ease);
}
/* THUMB NAV */
.thumb-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
    padding: 10px;
}
.thumb-nav span {
    pointer-events: auto;
    cursor: pointer;

    width: 26px;
    height: 26px;

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

    font-size: 22px;          /* nhỏ gọn như icon */
    line-height: 1;           /* QUAN TRỌNG: không lệch chữ */

    font-weight: 600;
    font-family: system-ui, sans-serif;

    color: #111;
    background: rgba(255,255,255,1);
    border: 0px solid #111;
    border-radius: 50%;

    padding: 0;               /* ❗ bỏ padding để không méo */
    box-sizing: border-box;

    transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.12s ease,
    opacity 0.15s ease;
}
.thumb-nav span:hover {
    background: rgba(0,0,0,1);
    color: #fff;
    opacity: 1;
}
.thumb-nav span:active {
    transform: translateY(1.5px) scale(0.94);
    box-shadow:
    0 1px 3px rgba(0,0,0,0.35),
    inset 0 2px 4px rgba(0,0,0,0.4);
}
/* Fade image when change */
.product-card img.thumb {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.product-card img.thumb.fade {
    opacity: 0;
    transform: scale(0.98);
}
/* IMAGE MODAL */
#imageModal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(10px);

    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) var(--transition-ease);

    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;

    cursor: zoom-out;
}

#imageModal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;

    transform: scale(0.9);
    transition: transform var(--transition-speed) var(--transition-ease);

    cursor: default;
}

#imageModal.show {
    opacity: 1;
    pointer-events: auto;
}

#imageModal.show img {
    transform: scale(1);
}
#imageModal .close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
}
#floatCart {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #111;
    padding: 12px 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 9999;
    transition:
    transform 0.35s cubic-bezier(.22,.61,.36,1),
    box-shadow 0.35s cubic-bezier(.22,.61,.36,1);
}
#floatCart.bump {
    transform: scale(1.08);
    box-shadow: 0 14px 40px rgba(0,0,0,.6);
}
#floatCart.hidden { display: none; }

.cart-badge {
    background: red;
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 13px;
    border: 2px solid #fff;
    transition: transform 0.25s ease;
}
.cart-badge.pop {
    transform: scale(1.3);
}
.cart-total {
    font-weight: 600;
}

/* INFO */
.product-info {
    padding: 14px 16px 18px;
}
.product-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}
.product-dimension,
.product-compatible {
    font-size: 13px;
    opacity: 0.7;
}

/* PRICE */
.product-price {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.price-old {
    text-decoration: line-through;
    opacity: 0.5;
}
.price-new {
    color: #ff5252;
    font-weight: 600;
}

/* ADD TO CART */
.add-cart {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff3b3b, #ff0000);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(255,0,0,0.5);
    transition: transform 0.2s ease;
}
.add-cart:hover {
    transform: scale(1.1);
}

/* HOT BADGE */
.hot-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ff3b3b;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 999px;
}
/* ===============================
   CART MODAL
================================ */
#cartModal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;

    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
}

#cartModal.show {
    opacity: 1;
    pointer-events: auto;
}

#cartModal.hidden {
    display: none;
}

/* Hộp giỏ */
#cartModal .modal-box {
    width: min(92vw, 420px);
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 25px 60px rgba(0,0,0,.25);

    transform: scale(.92) translateY(10px);
    transition: transform .35s ease;
}

#cartModal.show .modal-box {
    transform: scale(1) translateY(0);
}
.form-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ===============================
   CART ITEMS
================================ */
#cartItems {
    margin: 12px 0;
    max-height: 260px;
    overflow-y: auto;
}

.cart-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 6px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #ddd;
}

.cart-row .qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-row button {
    border: none;
    background: #eee;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
}
.cart-row button:hover {
    background: #ddd;
}

/* ===============================
   SUMMARY
================================ */
.summary {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 80%;
}
.summary div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}
.summary .total {
    font-weight: bold;
}

/* ===============================
   FORM
================================ */
#cartModal input,
#cartModal textarea {
    font-family: inherit;
    width: 100%;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
}

#checkoutBtn {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: #111;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

#checkoutBtn:hover {
    background: #000;
}

/* POPUP XÁC NHẬN DƠN HÀNG */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    color: var(--textColorD);
}
.modal.hidden { display: none; pointer-events: none; /* không nuốt chuột */}

.modal-box {
    background: #fff;
    width: 90%;
    max-width: 520px;
    padding: 24px;
    border-radius: 20px;
}

.modal-box.green {
    background: #ecfdf3;
}

.invoice-section {
    margin: 16px 0;
    font-size: 14px;
}

.invoice-total {
    border-top: 1px dashed #ccc;
    padding-top: 12px;
    font-size: 15px;
}

.notice, .note {
    font-size: 14px;
    margin: 12px 0;
}

.qr {
    width: 120px;
    margin: 16px auto;
    display: block;
}

.btn-dark {
    width: 100%;
    padding: 14px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 15px;
}
.mso_DIY {
    position: relative;        /* BẮT BUỘC */
    overflow: hidden;          /* tránh tràn */
    width: 100%;
    display: flex;
    justify-content: center;   /* canh giữa ngang */
    align-items: center;
    background-image: url("img/bg1.png");
    background-color: #575b5c;
    padding: 30px;
}
.mso_DIY::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0),
        rgba(0,0,0,0.5)
    );
    z-index: 0;                /* lớp phủ */
    pointer-events: none;
}
.mso_DIY > * {
    position: relative;
    z-index: 1;                /* nội dung nằm trên overlay */
}
.mso_DIY img {
    max-width: 1200px;
    width: 100%;
    display: block;
}
.site-footer {
    position: relative;        /* BẮT BUỘC */
    overflow: hidden;
    background-image: url("img/bg1.png");
    background-color: #575b5c;
    color: #fff;
    padding: 40px 20px;
    font-size: 14px;
}
.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.5),
        rgba(0,0,0,1)
    );
    z-index: 0;
    pointer-events: none;
}
.site-footer > * {
    position: relative;
    z-index: 1;
}
.footer-grid {
    max-width: 1200px;
    margin: auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}

.site-footer h4 {
    margin-bottom: 10px;
    font-size: 16px;
}

.qr-footer {
    width: 120px;
    margin: 10px 0;
}
.input-error {
    border: 2px solid #e53935 !important;
    background: #fff5f5;
}
/* COLOR OPTIONS */
.color-options {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4);
    cursor: pointer;
    transition: transform 0.15s ease, border 0.15s;
}
.color-dot.active {
    border-color: #fff;
    transform: scale(1.15);
}

/* SIZE OPTIONS */
.size-options {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.size-pill {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    cursor: pointer;
    transition: background 0.15s;
}
.size-pill.active {
    background: #fff;
    color: #000;
}
/* Mobile */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .qr-footer {
        margin: 10px auto;
    }
}
/* RESPONSIVE */
@media (max-width: 1000px) {
    .product-grid { grid-template-columns: repeat(1, 1fr); }
    .scene{display: none;}
    .bg{width: auto; height: 100vh;}
    .product-page{margin-top: 0;}
    .fg-right{height: 40%;width: auto;}
    .fg-left{display: none;}
    .product-page{padding: 30px;}
    .add-cart{width: 64px; height: 64px;}
    .footer-grid {grid-template-columns: 1fr;}
    a{color: inherit;text-decoration: none;-webkit-text-fill-color: inherit;}
}
