body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(to right, #f0f2f5, #c8e6c9);
  margin: 0;
  overflow-x: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.slide-container {
  position: relative;
  width: 85%;
  max-width: 960px;
  height: 75vh;
  max-height: 680px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* Slide cơ bản */
.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px; /* tránh ảnh dính sát mép */
  box-sizing: border-box;
}

.slide.active {
  opacity: 1;
  z-index: 2;
}

/* Ảnh tự co vừa khung (đảm bảo ảnh dài không bị che) */
.slide img {
  width: auto;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

/* Nút điều hướng trong slide */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  font-size: 28px;
  font-weight: bold;
  padding: 10px 16px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
  z-index: 5;
}

.nav-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

.prev-btn {
  left: 16px;
}
.next-btn {
  right: 16px;
}

/* Dòng nút dưới */
.controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.controls button {
  background: #0288d1;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
  transition: background 0.2s ease;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

.controls button:hover {
  background: #0277bd;
}

/* Thanh tiến trình */
.progress-bar {
  width: 85%;
  max-width: 960px;
  height: 8px;
  background: #d0e6d0;
  border-radius: 6px;
  margin-top: 12px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, #00c6ff, #e52e71);
  width: 0%;
  transition: width 0.3s ease;
}

/* Bộ đếm */
.counter {
  margin-top: 10px;
  font-weight: bold;
  color: #0585a2;
  font-size: 16px;
}

.site-logo {
  position: fixed;
  top: 12px;
  left: 16px;
}

/* Responsive */
@media (max-width: 600px) {
  .slide-container {
    width: 95%;
    height: 60vh;
  }

  .nav-btn {
    font-size: 22px;
    padding: 8px 12px;
  }

  .controls button {
    font-size: 14px;
    padding: 8px 14px;
  }
}
/* Ảnh có thể phóng to */
.zoomable {
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 1;
}

.zoomable.zoomed {
  cursor: zoom-out;
  transform: scale(1.8);   /* mức phóng to */
  z-index: 10;
  box-shadow: 0 0 25px rgba(0,0,0,0.4);
}
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: flex-start;   /* 👈 canh trên thay vì giữa */
  overflow-y: auto;          /* 👈 cho phép cuộn dọc */
  padding: 5vh 0;            /* 👈 thêm khoảng đệm trên/dưới */
  z-index: 1000;
}
/* ====================== CẢI TIẾN ZOOM ẢNH ====================== */
.zoomable {
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Lớp overlay để hiển thị ảnh phóng to */
.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  overflow: auto; /* 👈 Cho phép cuộn nếu ảnh vượt quá màn hình */
  padding: 20px;
  box-sizing: border-box;
}

/* Ảnh phóng to trong overlay */
.zoom-overlay img {
  max-width: 95vw;  /* 👈 Không vượt quá chiều ngang màn hình */
  max-height: 95vh; /* 👈 Không vượt quá chiều dọc màn hình */
  border-radius: 10px;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
  cursor: zoom-out;
}

/* Responsive nhỏ hơn 600px */
@media (max-width: 600px) {
  .zoom-overlay img {
    max-width: 98vw;
    max-height: 98vh;
  }
}
