/* ==== Màu chủ đạo ==== */
.bg-wood { background-color: #50311a; }        /* nâu gỗ ấm */
.bg-wood-dark { background-color: #391d0d; }   /* nâu gỗ trầm */
.btn-wood { background-color: #331f10; color: #fff; border: none; }
.btn-wood:hover { background-color: #6b452b; color: #fff; }
.btn-outline-wood { border: 2px solid #8B5E3C; color: #8B5E3C; }
.btn-outline-wood:hover { background-color: #8B5E3C; color: #fff; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #50311a;
  color: #2c2c2c;
}

.logo h2 { 
  font-size: 1.4rem; 
  color: #f0e6da;  /* màu sáng hơn để nổi bật trên nền nâu */
}
.logo small { 
  font-size: 0.8rem; 
  color: #cbb9a4; 
}

.navbar-nav .nav-link {
  color: #e8d7c7;
  margin: 0 10px;
  transition: color 0.3s;
}
.navbar-nav .nav-link:hover {
  color: #ffd9a0;
}

.search-box input {
  border-radius: 20px;
  border: 1px solid #8B5E3C;
  background: #fffaf5;
}


/* ==== Banner ==== */
/* Font nghệ thuật */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600&family=Playfair+Display:wght@700&display=swap');

.banner { position: relative; }
.banner img { max-height: 520px; object-fit: cover; }
.banner-overlay {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45); /* lớp tối nhẹ */
  display: flex; align-items: center; justify-content: center;
}

.banner-text {
  font-family: 'Cinzel', 'Playfair Display', serif;
  background: linear-gradient(90deg, #ece9e4, #cca384, #ece9e4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
  line-height: 1.4;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
  animation: fadeInUp 1.5s ease-out;
}

/* Hiệu ứng chữ bay lên */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==== Section title ==== */
.section-title {
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: bold;
  color: #c5a999;
  border-bottom: 3px solid #8B5E3C;
  display: inline-block;
  padding-bottom: 5px;
}

/* ==== Product card ==== */
/* ==== Product card ==== */
.product-card {
  background: rgba(255, 255, 255, 0.08); /* nền trong suốt nhẹ */
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  backdrop-filter: blur(6px); /* hiệu ứng kính mờ */
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

/* Hover nổi hơn */
.product-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}

/* Ảnh sản phẩm */
.product-card img {
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}


.product-card .card-body {
  flex-grow: 1;                     /* nội dung chiếm toàn bộ khoảng trống */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #50311a;                   /* chữ nâu gỗ đậm */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;          /* cắt khi quá dài */
}

.product-card .btn {
  background-color: #50311a;        /* nút nâu gỗ */
  color: #fff;
  border-radius: 25px;
  margin-top: auto;                 /* luôn đẩy nút xuống cuối */
  transition: background 0.3s ease;
}

.product-card .btn:hover {
  background-color: #7b4a25;        /* sáng hơn khi hover */
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

/* ==== Product Title ==== */
.product-card .card-title {
  font-family: 'Merriweather', serif; /* font sang trọng */
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(90deg, #ffffff, #ffa955);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
  margin-bottom: 0.75rem;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card .card-title::before {
  content: "◆";
  color: #c19a6b;
  margin-right: 6px;
}

/* ==== Product Description ==== */
.product-card .card-text {
  font-size: 0.95rem;
  color: #f8e8d9 !important; /* màu sáng kem */
  background: rgba(123, 74, 37, 0.25); /* nền nâu nhạt trong suốt */
  padding: 10px 14px;
  border-left: 4px solid #f5c77f; 
  border-radius: 8px;
  font-style: italic;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5); 
}


/* Icon trang trí trước mô tả */
.product-card .card-text::before {
  content: "\f06c"; /* fa-leaf */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #f5c77f; /* icon vàng nhạt */
  margin-right: 6px;
}


html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1; /* Đẩy footer xuống cuối */
}

footer {
  background: #2e2e2e; /* màu tối match theme */
  color: #fff;
  text-align: center;
  padding: 15px 0;
}

/* ==== Bảng quản lý sản phẩm gọn gàng ==== */
.table-wood {
  background: rgba(240, 225, 209, 0.95);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  animation: fadeIn 0.8s ease-in-out;
}

.table-wood thead {
  background: linear-gradient(90deg, #50311a, #6b452b);
  color: #f9f0e6;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.table-wood th,
.table-wood td {
  padding: 14px;
  vertical-align: middle;
  border: none;
}

/* Hàng hover nổi nhẹ */
.table-wood tbody tr {
  transition: transform 0.2s ease, background-color 0.3s ease;
}
.table-wood tbody tr:hover {
  background-color: rgba(139, 94, 60, 0.08);
  transform: scale(1.01);
}

/* Ảnh sản phẩm */
.table-wood img {
  border-radius: 10px;
  max-height: 60px;
  transition: transform 0.3s ease;
}
.table-wood img:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 18px rgba(0,0,0,0.3);
}

/* Nhóm nút hành động */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;   /* khoảng cách đều nhau */
}

.action-buttons .btn {
  min-width: 70px;    /* nút đồng đều chiều rộng */
  padding: 6px 12px;
  font-size: 0.9rem;
  border-radius: 8px;
}

/* Khoảng cách giữa table và phân trang */
.pagination {
  margin-top: 20px;       /* cách table 20px */
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  gap: 5px;
}

/* Nút phân trang mặc định */
.pagination .page-link {
  background-color: #50311a;   /* nâu gỗ */
  color: #fff;
  border: 1px solid #391d0d;   /* viền đậm hơn */
  padding: 8px 12px;
  border-radius: 5px;
  transition: all 0.3s ease;
}

/* Nút active */
.pagination .page-item.active .page-link {
  background-color: #391d0d;
  color: #fff;
  font-weight: bold;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* Hover effect */
.pagination .page-link:hover {
  background-color: #7a5231;   /* nâu sáng hơn */
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  text-decoration: none;
}

/* Tắt outline khi click */
.pagination .page-link:focus {
  box-shadow: none;
  outline: none;
}

/* Icon trong input tìm kiếm */
.search-input-wrapper {
  position: relative;
}

.search-input-wrapper i {
  position: absolute;
  left: 20px;          /* cách viền trái 20px */
  top: 50%;
  transform: translateY(-50%);
  color: #50311a;
  font-size: 14px;
}

/* Padding-left cho input để chữ không chồng icon */
.search-input-wrapper input {
  padding-left: 40px;  /* cách icon + khoảng cách vừa đủ */
}

/* Modal background overlay */
.modal-backdrop.show {
  background-color: rgba(0, 0, 0, 0.6); /* tối nhẹ */
}

/* Modal content */
.modal-content {
  background-color: #50311a; /* nâu gỗ ấm */
  color: #f9f0e6;            /* chữ sáng nổi bật */
  border-radius: 15px;
  border: none;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Header modal */
.modal-header {
  border-bottom: 2px solid #8B5E3C;
  background-color: #391d0d; /* nâu gỗ trầm */
  color: #f9f0e6;
}

/* Title */
.modal-title {
  font-weight: bold;
}

/* Close button */
.modal-header .btn-close {
  filter: invert(1); /* màu trắng */
}

/* Body modal */
.modal-body {
  background-color: #50311a;
  color: #f9f0e6;
}

/* Input, textarea, select trong modal */
.modal-body input,
.modal-body textarea,
.modal-body select {
  border-radius: 8px;
  border: 1px solid #8B5E3C;
  background-color: #fffaf5;
  color: #2c2c2c;
  padding: 8px 10px;
  transition: all 0.3s ease;
}

.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
  outline: none;
  border-color: #6b452b;
  box-shadow: 0 0 8px rgba(107,69,43,0.5);
}

/* Footer modal */
.modal-footer {
  background-color: #391d0d;
  border-top: 2px solid #8B5E3C;
}

/* Nút trong modal */
.modal-footer .btn-wood {
  background-color: #331f10;
  color: #fff;
  border: none;
  transition: all 0.3s ease;
}

.modal-footer .btn-wood:hover {
  background-color: #6b452b;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Nút hủy */
.modal-footer .btn-secondary {
  background-color: #8B5E3C;
  color: #fff;
  transition: all 0.3s ease;
}

.modal-footer .btn-secondary:hover {
  background-color: #6b452b;
  transform: translateY(-2px);
}

/* Checkbox trong modal */
.modal-body .form-check-input {
  accent-color: #8B5E3C;
}

/* Scrollbar modal-body nếu dài */
.modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

/*ALERT*/
.alert-custom {
  background-color: #50311a; /* màu nâu gỗ bạn đã dùng */
  color: #fff; 
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-custom.success {
  background-color: #3c9d3c; /* xanh lá nhẹ cho thành công */
}

.alert-custom.error {
  background-color: #b33a3a; /* đỏ trầm cho lỗi */
}

.alert-custom .btn-close {
  filter: invert(1); /* đổi màu nút close thành trắng */
}

.product-main-img {
  width: 100%;              /* chiếm full chiều rộng khung */
  height: 400px;            /* cố định chiều cao (có thể chỉnh 350-500 tuỳ giao diện) */
  object-fit: cover;        /* cắt ảnh để vừa khung, không méo */
  border-radius: 12px;      /* bo góc mềm mại */
  box-shadow: 0 4px 12px rgba(0,0,0,0.5); /* hiệu ứng nổi */
}


/* ================= RESPONSIVE ================= */

/* Mobile < 576px */
@media (max-width: 575.98px) {
  .banner-text {
    font-size: 1.5rem; /* nhỏ gọn */
    letter-spacing: 1px;
  }

  .product-card img {
    height: 160px; /* ảnh vừa tay hơn */
  }

  .product-card .card-title {
    font-size: 1rem;
  }

  .product-card .card-text {
    font-size: 0.85rem;
    -webkit-line-clamp: 2; /* mô tả ngắn gọn hơn */
  }

  .btn, .product-card .btn {
    font-size: 0.85rem;
    padding: 6px 12px;
  }

  .section-title {
    font-size: 1.2rem;
  }
}

/* Tablet 576px – 991px */
@media (min-width: 576px) and (max-width: 991.98px) {
  .banner-text {
    font-size: 2rem;
  }

  .product-card img {
    height: 180px;
  }

  .product-card .card-title {
    font-size: 1.1rem;
  }
}

/* Laptop vừa 992px – 1199px */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .banner-text {
    font-size: 2.5rem;
  }
  .product-card img {
    height: 200px;
  }
}

/* Desktop ≥ 1200px */
@media (min-width: 1200px) {
  .banner-text {
    font-size: 3rem;
  }
  .product-card img {
    height: 220px;
  }
}

/* Logo nhỏ gọn hơn trên mobile */
.navbar-brand h2 {
  font-size: 1.3rem;
}

.navbar-brand small {
  font-size: 0.75rem;
}

/* Search box: full width trên mobile */
@media (max-width: 767.98px) {
  .search-box {
    width: 100%;
  }
  .search-box input {
    flex: 1;
  }
}


/* ===== MODAL RESPONSIVE ===== */
@media (max-width: 575.98px) {
  .modal-dialog {
    max-width: 95%;
    margin: 1rem;
  }

  .modal-body input,
  .modal-body select,
  .modal-body textarea {
    font-size: 0.85rem;
  }

  .modal-footer .btn {
    font-size: 0.85rem;
    padding: 6px 10px;
  }
}

/* ===== FORM / FILTER RESPONSIVE ===== */
@media (max-width: 767.98px) {
  form.row {
    flex-direction: column;
    gap: 10px;
  }

  form.row .col-md-3,
  form.row .col-md-6 {
    width: 100%;
  }

  .search-input-wrapper {
    width: 100%;
  }

  .search-input-wrapper input {
    width: 100%;
    padding-left: 40px;
  }
}

/* ===== PAGINATION RESPONSIVE ===== */
@media (max-width: 575.98px) {
  .pagination {
    flex-wrap: wrap;
    gap: 5px;
  }

  .pagination .page-link {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
}

/* ===== PRODUCT IMAGE RESPONSIVE ===== */
@media (max-width: 767.98px) {
  .table-wood img {
    max-height: 50px;
  }
}

/* ===== TOAST RESPONSIVE ===== */
@media (max-width: 575.98px) {
  .toast-container {
    bottom: 5px;
    right: 5px;
    left: 5px;
  }
  .toast {
    width: 100%;
  }
}

/* ===== BUTTON ACTION ===== */
@media (max-width: 575.98px) {
  .action-buttons .btn {
    min-width: auto;
    width: 100%;
  }
}
