/* (Phần đầu giữ nguyên như bạn đã gửi, mình chỉ thêm phần custom-alert ở cuối) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: #f5f5f5;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 50px;
    background: white;
    border-bottom: 1px solid #ddd;
}

.logo svg {
    height: 24px;
    transition: transform 0.3s ease;
}

.logo-link:hover svg {
    transform: scale(1.1);
}

nav {
    display: flex;
}

.menu-left {
    margin-left: 20px;
}

.menu-right {
    margin-left: auto;
    margin-right: 20px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

nav ul li {
    margin: 0 20px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #ff6900;
}

.icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.icons i {
    font-size: 18px;
    cursor: pointer;
    color: #333;
    padding: 5px;
    border-radius: 50%;
    transition: color 0.3s, background 0.3s;
}

.icons i:hover {
    color: #ff6900;
    background: rgba(255, 105, 0, 0.1);
}

/* CSS cho Popover */
.user-icon-wrapper {
    position: relative;
}

.user-popover {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 150px;
}

.user-popover.active {
    display: block;
}

.popover-item {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background 0.3s, color 0.3s;
}

.popover-item:hover {
    background: #f5f5f5;
    color: #ff6900;
}

/* CSS cho slider tự viết */
.custom-slider {
    width: 100%;
    height: 500px;
    position: relative;
    overflow: hidden;
}

.slides {
    display: flex;
    width: 300%;
    height: 100%;
    transition: transform 0.5s ease;
}

.slide {
    width: 33.33%;
    height: 100%;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prev,
.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 20px;
    z-index: 10;
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.dots {
    position: absolute;
    bottom: 10px;
    text-align: center;
    width: 100%;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #fff;
    opacity: 0.7;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
}

.dot.active {
    background: #ff6900;
    opacity: 1;
}

/* CSS cho phần sản phẩm */
.products {
    padding: 50px;
    background: #fff;
    text-align: center;
}

.products h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 40px;
    text-transform: uppercase;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-item {
    background: #f9f9f9;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    pointer-events: none;
}

.product-item h3 {
    font-size: 20px;
    color: #333;
    margin: 15px 0;
    pointer-events: none;
}

.product-item p {
    font-size: 14px;
    color: #666;
    padding: 0 15px 15px;
    line-height: 1.5;
    pointer-events: none;
}

/* CSS cho Modal */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.product-modal.active {
    display: flex !important;
    opacity: 1;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    padding: 20px;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #ff6900;
}

.modal-body {
    display: flex;
    gap: 20px;
}

.modal-image-slider {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
}

.modal-sub-images {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.modal-sub-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.3s ease;
}

.modal-sub-image:hover,
.modal-sub-image.active {
    border: 2px solid #ff6900;
}

.modal-details {
    flex: 1;
}

.modal-title {
    font-size: 24px;
    color: #333;
    margin: 0 0 10px;
}

.modal-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 15px;
    line-height: 1.5;
}

.modal-price {
    font-size: 18px;
    color: #ff6900;
    font-weight: 500;
    margin: 0 0 15px;
}

.buy-button {
    padding: 10px 20px;
    background: #ff6900;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.buy-button:hover {
    background: #e65c00;
}

/* CSS cho phần Explore Xiaomi */
.explore-xiaomi {
    padding: 50px;
    background: #fff;
    text-align: center;
    margin-bottom: 30px;
}

.explore-xiaomi h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 40px;
    text-transform: uppercase;
}

.video-slider {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

.video-slides {
    display: flex;
    width: 300%;
    transition: transform 0.5s ease;
}

.video-slide {
    width: 33.33%;
    padding: 0 10px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-slide iframe {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 10px;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.video-slide:not(.active) {
    transform: scale(0.8);
    opacity: 0.5;
}

.video-content {
    padding: 15px;
    text-align: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.video-content h3 {
    font-size: 18px;
    color: #333;
    margin: 0 0 10px;
}

.video-content p {
    font-size: 14px;
    color: #666;
    margin: 0 0 15px;
    line-height: 1.5;
}

.learn-more {
    display: inline-block;
    padding: 8px 15px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.learn-more:hover {
    background: #ff6900;
}

.video-prev,
.video-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 20px;
    z-index: 10;
}

.video-prev {
    left: 10px;
}

.video-next {
    right: 10px;
}

/* CSS cho phần Shopping Cart */
.shopping-cart {
    padding: 50px;
    background: #fff;
    text-align: center;
    display: none; /* Ẩn mặc định */
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
}

.cart-container h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.cart-item {
    display: flex;
    align-items: center;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    transition: box-shadow 0.3s ease;
}

.cart-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 20px;
}

.cart-item-details {
    text-align: left;
}

.cart-item-details h3 {
    font-size: 18px;
    color: #333;
    margin: 0 0 10px;
}

.cart-item-details p {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

.cart-total {
    text-align: right;
}

.cart-total h3 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.empty-cart {
    font-size: 16px;
    color: #666;
    display: none; /* Ẩn mặc định */
}

/* CSS cho các gian hàng (store sections) */
.store-section {
    padding: 50px;
    background: #fff;
    text-align: center;
    display: none; /* Ẩn mặc định */
}

/* CSS cho phần Footer */
.footer {
    background: #000000;
    padding: 50px 0 20px;
    border-top: 1px solid #060606;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: start;
}

.footer-column {
    margin-bottom: 20px;
}

.footer-column h4 {
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    text-decoration: none;
    color: #6c6c6c;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: #ff6900;
}

.footer-column p {
    font-size: 14px;
    color: #5b5b5b;
    margin: 5px 0;
}

.footer-column p a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column p a:hover {
    color: #ff6900;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.social-icons a {
    color: #666;
    font-size: 18px;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: #ff6900;
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #ddd;
    margin-top: 30px;
}

.footer-bottom p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ff6900;
}

/* CSS cho nút Back to Top */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ff6900;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: none;
    transition: opacity 0.3s;
}

.back-to-top.show {
    display: block;
}

/* CSS cho thông báo tùy chỉnh */
.custom-alert {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    text-align: center;
    color: #333;
    font-size: 16px;
}

.custom-alert.show {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .video-slide iframe {
        height: 300px;
    }

    .video-slide:not(.active) {
        transform: scale(0.6);
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-column ul {
        display: inline-block;
        text-align: center;
    }

    .footer-column p {
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }

    .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .user-popover {
        right: -10px;
    }

    .cart-item {
        flex-direction: column;
        text-align: center;
    }

    .cart-item img {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .cart-total {
        text-align: center;
    }

    .modal-body {
        flex-direction: column;
        align-items: center;
    }

    .modal-image {
        width: 100%;
        height: 200px;
        margin-bottom: 15px;
    }

    .modal-sub-image {
        width: 60px;
        height: 60px;
    }

    .modal-details {
        text-align: center;
    }
}