/* Đảm bảo mọi thứ tuân theo box-sizing */
*,
*::before,
*::after {
    box-sizing: border-box; /* Giữ cho các phần tử không bị tràn bằng cách tính toán kích thước bao gồm padding và border */
}

/* Phông nền huyền ảo cho trang sản phẩm */
body {
    background: linear-gradient(135deg, #223d61, #647920); /* Màu gradient liên quan đến trà */
    background-size: 200% 200%;
    animation: backgroundMove 10s ease infinite; /* Hiệu ứng phông nền chuyển động nhẹ */
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* Chọn Roboto cho nội dung chung */
    color: #333;
    font-family: 'Alata', sans-serif;
    overflow-x: hidden; /* Tránh việc tràn hai bên trên màn hình di động */
}

@keyframes backgroundMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#addToCartBtn {
    background-color: red; /* Màu nền ban đầu là đỏ */
    color: white; /* Chữ màu trắng */
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease; /* Hiệu ứng chuyển màu mượt */
}

#addToCartBtn:hover {
    background-color: rgb(90, 241, 90); /* Màu nền chuyển sang xanh lá cây khi hover */
    color: white; /* Chữ màu trắng khi hover */
}

/* Nút trở về trang chủ */
.back-to-home {
    position: fixed; /* Giữ nút ở vị trí cố định */
    top: 20px; /* Khoảng cách từ đỉnh */
    right: 20px; /* Khoảng cách từ bên phải */
    padding: 10px 20px;
    background-color: rgb(87, 109, 231);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
    z-index: 1000; /* Đặt z-index cao hơn để nút nằm trên các phần khác */
}

.back-to-home:hover {
    background-color: rgb(130, 245, 115);
}

/* Header từ trang gốc */
.header {
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), 
    url("../images/checkout.jpg") center/cover no-repeat fixed; /* Nền ảnh giống trang gốc */
    color: white;
    text-align: center;
    padding: 60px 20px; /* Khoảng cách padding để tiêu đề và nội dung có khoảng trống */
    position: relative;
    width: 100%; /* Đảm bảo header chiếm toàn bộ chiều rộng */
    max-width: 100%; /* Tránh tràn ra ngoài */
    overflow: hidden; /* Tránh nội dung bị tràn */
}

.header .banner-subtitle {
    color: rgb(107, 235, 95);
    font-size: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header h1 {
    margin: 0;
    font-size: 36px;
}

/* Chi tiết sản phẩm */
.product-detail {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    color: white;
    flex-wrap: wrap; /* Đảm bảo nội dung không bị tràn trên màn hình nhỏ */
    gap: 20px; /* Khoảng cách giữa các phần tử */
    width: 100%;
    max-width: 100%; /* Đảm bảo không vượt quá chiều rộng */
    margin: 0 auto; /* Căn giữa trên màn hình */
}

.product-detail img {
    width: 100%;
    max-width: 450px;
    border-radius: 8px;
    transition: transform 0.3s ease; /* Hiệu ứng phóng to */
    cursor: zoom-in;
}

.zoomed {
    transform: scale(1.5); /* Phóng to ảnh */
    cursor: zoom-out; /* Thay đổi con trỏ khi ảnh được phóng to */
}
.product-detail {
    display: flex;             /* 2 cột: trái - phải */
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    color: white;
  }
  
  /* Khối bên trái (ảnh chính + thumbnails) */
  .left-container {
    display: flex;
    flex-direction: column;    /* Ảnh chính bên trên, thumbnails bên dưới */
    align-items: center;       /* Căn giữa nội dung */
    gap: 10px;
  }
  
  /* Container chứa ảnh chính */
  .image-container {
    width: 100%;
    max-width: 450px;
    text-align: center;
  }
  
  /* Ảnh chính */
  .image-container img {
    width: 100%;
    max-width: 450px;
    border-radius: 8px;
    transition: opacity 0.5s ease-in-out;
  }
  
  /* Container thumbnails */
  .thumbnail-container {
    display: flex;
    justify-content: center;
    gap: 8px;
  }
  
  /* Ảnh nhỏ */
  .thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease-in-out;
  }
  
  .thumbnail:hover {
    border-color: #ff5722; /* Đổi viền khi hover */
  }
.product-info {
    max-width: 100%; /* Đảm bảo thông tin sản phẩm chiếm toàn bộ chiều rộng container */
    padding: 10px;
    box-sizing: border-box;
    word-wrap: break-word; /* Đảm bảo văn bản không tràn ra ngoài */
}

.product-info h2 {
    font-family: 'Merriweather', serif; /* Phông chữ serif cho tiêu đề */
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

/* Đóng khung cho số tiền và làm nổi bật */
.product-info .price {
    font-size: 30px;
    color: #ff5722;
    font-family: 'Georgia', serif;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px 20px;
    border: 3px solid #ff5722;
    border-radius: 10px;
    display: inline-block;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.product-info p {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #2c3e50;
}

.main-btn {
    background-color: #4873e9;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

.main-btn:hover {
    background-color: #2cf325;
}

/* Footer */
.footer {
    background-color: #333;
    color: white;
    padding: 50px 20px;
    text-align: center;
    font-size: 20px;
    box-sizing: border-box;
    width: 100%;
}

.footer p {
    margin: 0;
}

/* Responsive styles */
@media (max-width: 768px) {
    .product-detail {
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }

    .product-info {
        padding-left: 0;
        text-align: center;
    }

    .product-detail img {
        max-width: 100%;
        margin-bottom: 20px;
    }

    .banner-subtitle {
        font-size: 18px;
    }

    .header h1 {
        font-size: 24px;
    }

    .product-info h2 {
        font-size: 20px;
    }

    .product-info .price {
        font-size: 24px;
    }

    .main-btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    .footer {
        padding: 30px 20px;
        font-size: 16px;
    }
}
