/* Thiết lập chung */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9f9f9;
    margin: 0;
    padding: 20px;
}

/* Tiêu đề chính */
.main-header {
    text-align: center;
    background-color: #ffeaa7; /* Màu vàng nhạt */
    border: 4px solid #e17055; /* Khung màu cam đất */
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    color: #d35400;
}

.main-header h1 {
    margin: 0;
    text-transform: uppercase;
}

/* Khung chứa các sản phẩm */
.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Thẻ sản phẩm */
.product-card {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 250px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: #e17055;
}

/* Khu vực ảnh (Placeholder) */
.image-placeholder {
    width: 100%;
    height: 200px;
    background-color: #ececec;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: bold;
}

/* Nếu dùng thẻ img, css này sẽ áp dụng */
.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Tên và mô tả */
.product-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.2rem;
}

.desc {
    font-size: 0.9rem;
    color: #666;
    flex-grow: 1; /* Đẩy giá xuống dưới cùng */
    margin-bottom: 15px;
}

/* Khu vực giá và nút mua */
.price-action {
    display: flex;
    justify-content: space-between; /* Đẩy giá sang trái, nút sang phải */
    align-items: center;
    border-top: 1px dashed #eee;
    padding-top: 10px;
}

.price {
    font-size: 1.1rem;
    font-weight: bold;
    color: #d63031;
}

.buy-btn {
    background-color: #e17055;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.buy-btn:hover {
    background-color: #d35400;
}

/* --- PHẦN STYLE CHO SLIDER --- */
.carousel-container {
    width: 100%;
    max-width: 800px; /* Giới hạn chiều rộng banner */
    margin: 0 auto 40px auto; /* Căn giữa */
    position: relative;
    overflow: hidden; /* Ẩn phần ảnh thừa */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: 2px solid #e17055;
}

.carousel-slide {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease-in-out; /* Hiệu ứng trượt mượt */
}

.carousel-slide a {
    width: 100%;
    flex-shrink: 0; /* Đảm bảo ảnh không bị co lại */
}

.carousel-slide img {
    width: 100%;
    height: 350px; /* Chiều cao cố định của banner */
    object-fit: cover; /* Cắt ảnh đẹp không méo */
    display: block;
    cursor: pointer; /* Hiện bàn tay khi chỉ vào */
}

/* Nút bấm trái phải */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 10;
}

.nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

#prevBtn { left: 10px; }
#nextBtn { right: 10px; }

/* Thanh chỉ số (Indicators) */
.indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    height: 5px; /* Chiều cao thanh */
    width: 30px; /* Chiều dài thanh hình chữ nhật */
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active {
    background-color: #fff; /* Màu sáng khi đang chọn */
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* Thêm hiệu ứng cuộn mượt cho toàn trang web */
html {
    scroll-behavior: smooth;
}

/* --- PHẦN STYLE CHO TRANG CHI TIẾT --- */
.detail-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.product-detail {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
    border-bottom: 1px solid #eee;
    padding-bottom: 30px;
}

.detail-image img {
    width: 400px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #ddd;
}

.detail-info h2 {
    color: #e17055;
    margin-top: 0;
}

.price-large {
    font-size: 2rem;
    color: #d63031;
    font-weight: bold;
    margin: 10px 0;
}

.buy-btn-large {
    background-color: #d63031;
    color: white;
    padding: 15px 30px;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 20px;
}

/* --- PHẦN STYLE CHO BÌNH LUẬN (GIỐNG ẢNH MẪU) --- */
.comment-section h3 {
    border-left: 4px solid #e17055;
    padding-left: 10px;
    color: #333;
}

.comment-box {
    margin-bottom: 30px;
}

#commentInput {
    width: 100%;
    height: 100px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box; /* Đảm bảo không bị tràn lề */
}

.comment-actions {
    text-align: right;
    margin-top: 10px;
}

.post-btn {
    background-color: #ff5e00; /* Màu cam đậm giống ảnh */
    color: white;
    border: none;
    padding: 10px 25px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.post-btn:hover {
    background-color: #e05200;
}

/* Danh sách bình luận */
.comment-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px dashed #eee;
    animation: fadeIn 0.5s ease; /* Hiệu ứng hiện ra từ từ */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background-color: #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #555;
}

.comment-content {
    flex: 1;
}

.user-name {
    font-weight: bold;
    color: #e17055;
    margin-bottom: 4px;
}

.badge {
    background-color: #2ecc71;
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
    font-weight: normal;
}

.time {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 8px;
}

/* --- HEADER VÀ ICON GIỎ HÀNG --- */
.header-content {
    display: flex;
    justify-content: center; /* Tiêu đề vẫn ở giữa */
    align-items: center;
    position: relative;
}

.cart-icon {
    position: absolute;
    right: 10px; /* Nằm góc phải */
    cursor: pointer;
    background: white;
    padding: 5px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #d63031; /* Màu đỏ */
    color: white;
    border-radius: 50%; /* Hình tròn */
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- NÚT BẤM TRÊN SẢN PHẨM --- */
.action-buttons {
    display: flex;
    gap: 5px;
}

.add-cart-btn {
    background-color: white;
    color: #d63031;
    border: 1px solid #d63031;
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.add-cart-btn:hover {
    background-color: #ffeaa7;
}

/* --- MODAL GIỎ HÀNG (POPUP) --- */
.cart-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5); /* Nền tối mờ */
    display: none; /* Ẩn mặc định */
    justify-content: flex-end; /* Canh phải */
    z-index: 1000;
}

.cart-modal.show {
    display: flex;
}

.cart-content {
    background-color: white;
    width: 400px; /* Chiều rộng khung giỏ hàng */
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.cart-header {
    background-color: #d63031;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    font-size: 2rem;
    cursor: pointer;
    line-height: 20px;
}

.cart-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto; /* Cho phép cuộn nếu danh sách dài */
}

/* --- GIAO DIỆN TỪNG MÓN TRONG GIỎ --- */
.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px dashed #ddd;
}

.item-info h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: #333;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-controls button {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
}

.item-price {
    font-weight: bold;
    color: #d63031;
}

.cart-footer {
    padding: 20px;
    border-top: 2px solid #eee;
    background-color: #f9f9f9;
}

.total-section {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.checkout-btn {
    width: 100%;
    background-color: #d63031;
    color: white;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
}

.checkout-btn:hover {
    background-color: #b71540;
}