:root {
  --primary-green: #5DB075;
  --secondary-yellow: #FEEA70;
  --accent-orange: #F4A261;
  --light-bg: #F7FAF5;
  --dark-text: #2F2F2F;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--light-bg);
  color: var(--dark-text);
}

html,
body {
  max-width: 100%;
}

.navbar {
  background: linear-gradient(to right, var(--primary-green), #8BC34A);
}

.navbar-brand img {
  height: 80px;
}

.custom-navbar {
  background: linear-gradient(to left, #00cf3b, hsl(29, 72%, 54%));
}

.nav-link {
  color: white !important;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--secondary-yellow) !important;
}

footer {
  background-color: var(--primary-green);
  color: white;
}

footer a {
  color: var(--secondary-yellow);
  text-decoration: none;
}

/* Slider image responsive */
.slider-img {
  object-fit: cover;
  height: 260px;
}

@media (min-width: 768px) {
  .slider-img {
    height: 400px;
  }
}

/* Spinner margin fix */
.loading-spinner {
  display: block;
  text-align: center;
}

/* --- Card tổng thể --- */
.card.post-card {
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card.post-card:hover {
  transform: translateY(-4px);
  /* gợn sóng */
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  /* bóng đổ đậm hơn */
}

/*product*/
.product-card {
  overflow: hidden;
  border-radius: 10px;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  /* bóng đậm hơn */
}

.product-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  /* bóng sâu hơn khi hover */
  transform: translateY(-4px);
  /* gợn sóng nổi nhẹ lên */
}

.product-card img {
  transition: transform 0.4s ease;
}

.product-card:hover img {
  transform: scale(1.08);
  /* zoom nhẹ ảnh */
}

/* post */
/* --- Vùng ảnh có hiệu ứng ánh sáng --- */
.post-thumb-wrapper {
  position: relative;
  overflow: hidden;
}

.post-thumb-wrapper img {
  width: 100%;
  transition: transform 0.4s ease;
}

.card.post-card:hover .post-thumb-wrapper img {
  transform: scale(1.07);
  /* zoom ảnh */
}

.postSwiper .swiper-slide {
  height: auto;
}

/* --- Ánh sáng trượt qua ảnh --- */
.post-thumb-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.0) 100%);
  transform: skewX(-20deg);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.card.post-card:hover .post-thumb-wrapper::after {
  opacity: 1;
  animation: shimmer 1.2s ease forwards;
}

@keyframes shimmer {
  0% {
    left: -75%;
  }

  100% {
    left: 125%;
  }
}

/* footer */
footer a.text-light {
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

footer a.text-light::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background-color: #28a745;
  /* Greeny */
  transition: width 0.3s ease;
}

footer a.text-light:hover {
  color: #28a745;
}

footer a.text-light:hover::after {
  width: 100%;
}

footer.bg-light {
  background: #e9f7ee;
  /* màu xanh nhạt nhẹ của Greeny */
}

/* search */
.card.product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
  transition: 0.3s ease;
}

.text-orange {
  color: #ff9800;
}

.logo {
  padding-left: 20px;
  max-width: 190px;
}

.menu {
  padding-right: 20px;
}

#background-banner {
  height: 39px;
  background-color: rgb(25, 135, 84);
  position: absolute;
  top: 141px;
  /* chỉnh theo chiều cao header */
  left: 0;
  right: 0;
  z-index: 1;
  border-bottom-left-radius: 60px;
  border-bottom-right-radius: 60px;
}


/* process style */
.process-flow-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  align-items: stretch;
  width: 100%;
  /* ✅ Cho phép full chiều ngang */
  height: auto;
  /* ✅ Không ép height container */
}

.process-step {
  display: flex;
}

.arrow-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18%;
  /* ✅ Chống xuống hàng */
  height: auto;
  flex-shrink: 0;
  padding-left: 10px;
}

.process-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1rem;
  height: 170px;
  text-align: center;
  transition: transform 0.2s;
  cursor: pointer;
}

.process-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.process-image {
  width: 100%;
  height: 100px;
  object-fit: contain;
  border-radius: 0.5rem;
}

.arrow-icon {
  width: 40px;
  height: auto;
  opacity: 0.6;
}

/* custom bug UI */
.custom-process {
  width: 100%;
}

.custom-process-last {
  width: 82%;
}

/* end custom bug UI */

/* products page */
#load-more-btn {
  transition: all 0.3s ease-in-out;
  letter-spacing: 0.5px;
  font-size: 1.1rem;
}

#load-more-btn:hover {
  transform: scale(1.05);
  background-color: #218838 !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.product-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.product-info {
  padding: 10px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-name {
  font-weight: bold;
  font-size: 1rem;
  margin: 8px 0 4px;
  color: #222;
}

.product-price {
  color: #cc0000;
  font-weight: 600;
  margin-bottom: 8px;
}

.product-link {
  text-align: center;
  background: #00aa55;
  color: white;
  padding: 6px 10px;
  border-radius: 5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
}

.product-link:hover {
  background: #008843;
}

#product-list .col {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* Responsive tweak */
@media (min-width: 1200px) {
  #product-list {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 768px) {
  .product-image {
    height: 120px;
  }
}

/* Nút hover + scale */
.ripple-btn {
  transition: all 0.3s ease-in-out;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.ripple-btn:hover {
  transform: scale(1.05);
  background-color: #218838 !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Đảm bảo thumbnail luôn vừa cột */
#post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

#post-sidebar {
  overflow: hidden;
}

/* Danh sách bài viết nổi bật - layout card đơn giản */
#highlighted-posts {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
  max-height: 320px;
  /* GIỚI HẠN chiều cao */
  overflow-y: auto;
  /* Scroll nội bộ */
  padding-right: 4px;
}

.highlighted-item {
  background-color: #f9f9f9;
  border-left: 4px solid #28a745;
  padding: 12px 16px;
  border-radius: 8px;
  transition: background-color 0.3s ease;
  font-size: 15px;
  line-height: 1.4;
}

.highlighted-item:hover {
  background-color: #f1f1f1;
}

.highlighted-item a {
  text-decoration: none;
  color: #007bff;
  display: block;
  word-wrap: break-word;
  word-break: break-word;
}

/* Scrollbar nhẹ nhàng */
#highlighted-posts::-webkit-scrollbar {
  width: 4px;
}

#highlighted-posts::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

/* Mobile tweak */
@media (max-width: 767.98px) {
  .highlighted-item {
    font-size: 14px;
  }
}

.highlighted-posts-wrapper {
  position: relative;
}

.highlighted-posts-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 32px;
  width: 100%;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9));
  z-index: 1;
}

.scroll-hint {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #999;
  animation: bounce 1.5s infinite;
  z-index: 2;
}

@keyframes bounce {

  0%,
  100% {
    transform: translate(-50%, 0);
  }

  50% {
    transform: translate(-50%, 5px);
  }
}

.thumb-sm {
  width: 70px;
  height: 60px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 6px;
  border: none;
}

.highlighted-item:hover span {
  color: #007bff;
  /* Hiệu ứng hover */
  text-decoration: underline;
}

#featured-posts .swiper-slide {
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
}

#featured-posts .card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#featured-posts .card-img-top {
  height: 190px;
  object-fit: cover;
}

.featured-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  max-height: calc(1.4em * 3);
  /* = 3 lines */
  white-space: normal;
  position: relative;
  cursor: default;
}

.card-body p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  max-height: calc(1.4em * 5);
  /* 5 dòng */
  white-space: normal;
  margin-bottom: 10px;
}

#post-list img {
  height: 276px;
  object-fit: cover;
}

input.is-invalid,
textarea.is-invalid {
  border-color: #dc3545;
}

input.is-valid,
textarea.is-valid {
  border-color: #28a745;
}

.sidebar-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: #218838;
  /* Xanh Greeny */
  z-index: 1050;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
  transition: right 0.3s ease;
  color: #fff;
  margin-top: 95px;
}

.sidebar-menu.show {
  right: 0;
}

.sidebar-menu a {
  color: #fff;
  text-decoration: none;
  padding: 12px 0;
  display: block;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
}

.sidebar-header {
  background: #1e7e34;
  /* darker */
  font-weight: bold;
}

.btn-close {
  filter: invert(1);
}

#sidebarOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

#sidebarOverlay.show {
  opacity: 1;
  visibility: visible;
}

.product-thumb-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.product-thumb-wrapper img {
  transition: transform 0.5s ease;
}

.product-thumb-wrapper:hover img {
  transform: scale(1.08);
}

#product-detail h1,
#product-detail h2,
#product-detail h3 {
  font-family: 'Segoe UI', sans-serif;
}

#product-detail .btn {
  transition: all 0.3s ease;
  border-radius: 0.75rem;
  font-weight: 500;
  min-width: 120px;
  text-align: center;
}

#product-detail .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#product-detail .badge {
  font-size: 0.85rem;
  border-radius: 1rem;
}

/* Khi xổ chi tiết: toàn bộ cột phải sẽ cuộn */
@media (min-width: 768px) {
  #product-detail .row.align-items-start {
    align-items: stretch;
  }

  #product-detail .col-md-6.scrollable {
    height: 100%;
    max-height: 500px;
    /* bằng chiều cao ảnh trái */
    overflow-y: auto;
  }

  /* Đảm bảo ảnh bên trái giữ đúng chiều cao */
  #product-detail .col-md-6:first-child .product-thumb-wrapper {
    height: 500px;
  }

  #product-detail .col-md-6:first-child img {
    height: 100%;
    object-fit: contain;
  }
}

/* Khi chưa xổ ra */
.collapsed-description {
  max-height: 160px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.collapsed-description.show {
  max-height: none;
  overflow: visible;
}

.btn-shoptmdt {
  width: 200px;
}

/* Ẩn thanh cuộn nhưng vẫn giữ khả năng cuộn */
.scroll-hidden {
  overflow-y: scroll;
  /* Vẫn cho phép cuộn dọc */
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE và Edge */
}

.scroll-hidden::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari */
}

/* Phần about section */
.about-section {
  background-color: #f8fff7;
  border-top: 1px solid #d6eadf;
  border-bottom: 1px solid #d6eadf;
}

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

.section-subtitle {
  font-size: 1.1rem;
  color: #555;
}

.custom-checklist {
  padding-left: 1rem;
}

.custom-checklist li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.2rem;
}

.custom-checklist li::before {
  content: "✔";
  color: #28a745;
  position: absolute;
  left: 0;
  font-weight: bold;
}

.text-greeny-quote {
  font-size: 1.1rem;
  color: #2e7d32;
}

/* Chính sách giao hàng */
.policy-section {
  background-color: #fefefc;
  border-top: 1px solid #e0e0d1;
  border-bottom: 1px solid #e0e0d1;
}

.custom-checklist {
  padding-left: 1rem;
}

.custom-checklist li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.2rem;
}

.custom-checklist li::before {
  content: "✔";
  color: #28a745;
  position: absolute;
  left: 0;
  font-weight: bold;
}

.text-greeny-quote {
  font-size: 1.1rem;
  color: #2e7d32;
}

/* faq ? */
.faq-section {
  background-color: #f9fefb;
  border-top: 1px solid #d9eadd;
}

.accordion-button {
  font-weight: 500;
}

.accordion-button:focus {
  box-shadow: none;
}

.accordion-body {
  font-size: 0.95rem;
  color: #444;
}

/* Nền toàn khối FAQ */
.faq-section {
  background-color: #f9fefb;
  border-top: 1px solid #d9eadd;
}

/* Câu hỏi */
.accordion-button {
  font-weight: 600;
  background-color: #ffffff;
  color: #2e7d32;
  border-bottom: 1px solid #e2e2e2;
  transition: background-color 0.3s ease;
}

.accordion-button:hover {
  background-color: #f0fff4;
}

/* Khi mở ra */
.accordion-button:not(.collapsed) {
  background-color: #e8f5e9;
  color: #1b5e20;
  box-shadow: none;
}

/* Nội dung trả lời */
.accordion-body {
  background-color: #fcfffa;
  border-top: 1px solid #dcecdc;
  font-size: 0.95rem;
  color: #444;
  padding: 1rem 1.25rem;
}

/* breadcrumd */
.breadcrumb-modern {
  background: #f8f9fa;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.breadcrumb-modern ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.breadcrumb-modern li {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.breadcrumb-modern a {
  text-decoration: none;
  color: #0d6efd;
  transition: color 0.2s;
}

.breadcrumb-modern a:hover {
  color: #0a58ca;
  text-decoration: underline;
}

.breadcrumb-modern li::after {
  content: "›";
  color: #6c757d;
  margin: 0 0.5rem;
}

.breadcrumb-modern li:last-child::after {
  content: "";
  margin: 0;
}

.breadcrumb-modern .active {
  color: #6c757d;
  font-weight: 500;
}

/* Breadcrumb responsive fix */
@media (max-width: 768px) {
  .breadcrumb-modern {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
  }

  .breadcrumb-modern::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari */
  }

  .breadcrumb-modern ol {
    flex-wrap: nowrap;
    display: flex;
    gap: 0.5rem;
  }

  .breadcrumb-modern li {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* Breadcrumb wrapper với hiệu ứng fade 2 bên */
.breadcrumb-wrapper {
  position: relative;
  overflow: hidden;
}

.breadcrumb-modern {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.breadcrumb-modern::-webkit-scrollbar {
  display: none;
}

.breadcrumb-modern ol {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.breadcrumb-modern li {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Fade trái phải */
.breadcrumb-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  z-index: 2;
}

.breadcrumb-fade-left {
  left: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
}

.breadcrumb-fade-right {
  right: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
}

/* Chỉ hiện fade trên màn nhỏ */
@media (min-width: 769px) {
  .breadcrumb-fade {
    display: none;
  }
}

.info-banner {
  background: linear-gradient(to right, #4caf50, #8bc34a);
  /* hoặc màu bạn muốn */
  font-weight: 500;
  font-size: 0.85rem;
  border-radius: 0.5rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  line-height: 1.5;
}

@media (min-width: 992px) {
  .info-banner {
    display: none;
    /* Trên desktop thì ẩn đi nếu bạn đã có dòng gốc */
  }
}

.info-banner-mobile {
  color: #fff;
  line-height: 1.4;
}

.info-banner-mobile div {
  color: white;
}

.info-banner-mobile i {
  font-size: 1rem;
  /* làm icon rõ hơn */
  vertical-align: middle;
}

.info-banner-mobile {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 1rem;
}

@media (min-width: 992px) {
  .info-banner-mobile {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .info-banner-mobile div {
    font-size: 0.7rem;
  }
}

/* zalo-chat */
#zalo-floating-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #009c12, #76c956);
  /* tone Greeny */
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 999;
  transition: transform 0.2s ease;
  animation: pulse-shake 2s infinite;
}

#zalo-floating-btn:hover {
  transform: scale(1.1);
}

#zalo-floating-btn i {
  font-size: 30px;
  color: hsl(0, 0%, 100%);
}

@keyframes pulse-shake {
  0% {
    transform: scale(1) rotate(0deg);
  }

  10% {
    transform: scale(1.05) rotate(2deg);
  }

  20% {
    transform: scale(1.1) rotate(-2deg);
  }

  30% {
    transform: scale(1.05) rotate(1deg);
  }

  40% {
    transform: scale(1) rotate(0deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

#zalo-popup {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  z-index: 1000;
  font-family: 'Segoe UI', sans-serif;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

#zalo-popup p {
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

#zalo-popup img,
.contact-info img {
  width: 20px;
  height: auto;
}

#zalo-popup a {
  display: block;
  color: #009d12;
  text-decoration: none;
  margin: 4px 0 0 20px;
}

#zalo-popup a:hover {
  text-decoration: underline;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

.contact-info {
  background-color: #f8fff5;
  border-left: 3px solid #28a745;
  padding: 20px;
  margin-top: 20px;
}

.contact-info p {
  margin-left: 10px;
}

.contact-info a {
  display: block;
  color: #009d12;
  text-decoration: none;
  margin: 5px 5px 5px 0;
  width: fit-content;
  padding: 0 8px 0 0;
}

@media (min-width: 992px) {
  .contact-info {
    margin-top: 0;
  }
}

/* Căn giữa các bước quy trình khi ít hơn 5 bước */
@media (min-width: 992px) {
  .swiper.mySwiper.center-when-few .swiper-wrapper {
    justify-content: center !important;
    display: flex !important;
    flex-wrap: nowrap;
  }
}

.stroke-text {
  color: white;
  text-shadow:
    -1.5px -1.5px 0 black,
    1.5px -1.5px 0 black,
    -1.5px 1.5px 0 black,
    1.5px 1.5px 0 black;
  font-weight: bold;
}

/* Chhứng nhận */
.cert-container {
  height: 250px;
}

.cert-swiper {
  width: 100%;
  padding: 0 0;
}

.cert-swiper .swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
}

.cert-logo {
  width: 128px;
  max-height: 181px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.cert-logo:hover {
  transform: scale(1.05);
}

.thumbsSwiper .thumb-img.active {
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, .25);
}

/* Viewer */
/* Overlay tối + chừa dải phải 56px cho nút Đóng */
.viewer-overlay{
  position:fixed; inset:0;
  background: rgba(0,0,0,.75);      /* mờ: nhìn thấy web phía sau */
  display:flex; align-items:center; justify-content:center;
}

/* Nút đóng */
.viewer-close{
  position:fixed; top:16px; right:16px;
  width:36px; height:36px;
  background:#fff; border-radius:8px; opacity:.95;
}

/* Căn giữa theo chiều dọc */
.viewer-box{
  height:100vh; width:100%;
  display:flex; align-items:center; justify-content:center;
}

/* Khung bọc ảnh (để mũi tên bám theo mép ảnh, không theo mép màn) */
.viewer-inner{
  position:relative; display:inline-block;
}

/* Ảnh fit theo chiều dọc, chừa lề phải cho nút X và chút lề ngoài */
.viewer-inner img{
  max-height: calc(100vh - 32px);
  max-width: calc(100vw - 56px - 48px); /* trừ dải phải + lề 2 bên */
  object-fit: contain; display:block;
}

/* Mũi tên gần mép ảnh (không sát màn hình) */
.viewer-arrow{
  position:absolute; top:50%; transform:translateY(-50%);
  width:40px; height:40px; border:0; border-radius:999px;
  background:rgba(255,255,255,.9);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 8px rgba(0,0,0,.25);
}
.viewer-arrow.prev{ left:-10%; }   /* cách mép ảnh 20px */
.viewer-arrow.next{ right:-10%; }
.viewer-arrow:hover{ background:#fff; }