:root {
  --bg: #fff9f8;
  --card: #ffffff;
  --accent: #f78da7;
  --accent-soft: rgba(247, 141, 167, 0.12);
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --border: #f2d8d8;
  --radius: 16px;
  --shadow: 0 5px 10px rgba(249, 123, 123, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, #f9fafb, #e5e7eb);
  color: var(--text);
  min-height: 100vh;
  scroll-behavior: smooth;
}
body.no-scroll {
  overflow: hidden;
}

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 18px 40px;
}

/* Logo trên header */
.logo-top {
  text-align: center;
  margin-bottom: 6px;
}
.logo-top img {
  width: 160px;
  height: auto;
  display: inline-block;
}

/* HEADER */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff, #ffe6e6);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(255, 155, 155, 0.25);
  position: sticky;
  top: 8px;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  border-radius: 6px;
  flex-shrink: 0;
  cursor: pointer;
}

.brand-text-main {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.brand-count {
  margin-left: 3px;
  font-weight: 700;
}

.brand-text-sub {
  font-size: 12px;
  color: var(--muted);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* Hàng chứa 2 nút View / Download */
.cta-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Buttons Styling ===== */
.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 20px; /* tăng chiều cao đồng đều */
  font-size: 14px;
  line-height: 1;
  height: 38px; /* đồng nhất chiều cao */
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

/* SVG Icon styling */
.icon-small {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}

.btn-primary {
  background: linear-gradient(135deg, #f78da7, #fcb69f);
  color: #fff;
  box-shadow: 0 8px 22px rgba(247, 141, 167, 0.45);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: #fdf2f8;
  color: var(--accent);
  border-color: var(--accent);
}
/* Nút filter toggle */
.filter-toggle {
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
}
/* Hiệu ứng zoom 3 lần, sau đó nghỉ 30s */
#otherCatalogBtn {
  background: linear-gradient(135deg, #fff6f8, #ffe6eb);
  color: var(--accent);
  border: 2px solid #fcb1c2;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(247, 141, 167, 0.25);
  position: relative;
  animation: pulseZoom 35s ease-in-out infinite; /* tổng chu kỳ 35s */
  display: inline-block;
  padding-top:0 !important;
}

#otherCatalogBtn:hover {
  background: linear-gradient(135deg, #ffe6eb, #fff);
  color: #f55c80;
  transform: scale(1.05);
}

/* --- Animation zoom 3 lần rồi ngừng --- */
@keyframes pulseZoom {
  /* Giữ trạng thái bình thường (bắt đầu) */
  0%,
  14%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(247, 141, 167, 0.25);
  }

  /* Ba lần zoom nhẹ liên tiếp trong 0–14% của chu kỳ (≈5s nếu chu kỳ 35s) */
  2% {
    transform: scale(1.15);
    box-shadow: 0 6px 25px rgba(247, 141, 167, 0.4);
  }
  4% {
    transform: scale(1);
  }
  6% {
    transform: scale(1.15);
  }
  8% {
    transform: scale(1);
  }
  10% {
    transform: scale(1.15);
  }
  12% {
    transform: scale(1);
  }

  /* 14%–100% (~30s) là khoảng nghỉ */
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* ==== FILTER BAR – SHOW ALL ITEMS ==== */
/* Filter Bar Section (Below Header) */
.filter-bar-section {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 0;
  margin-bottom: 8px;
}

/* Filter bar label */
.product-line-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  margin-right: 8px;
}

/* Show All button */
.show-all-btn {
  white-space: nowrap;
  padding: 5px 10px;
  font-size: 12px;
  height: auto;
  line-height: 1.2;
  flex-shrink: 0;
}

.show-all-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* Logout button in header (next to Your Orders) */
.logout-btn-header {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
  padding: 10px;
  font-size: 14px;
}

.logout-btn-header:hover {
  background: #fecaca;
  color: #b91c1c;
  border-color: #dc2626;
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}

.btn-filter {
  padding: 5px 10px;
  font-size: 12px;
  height: auto;
  line-height: 1.2;
  max-width: 220px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.btn-filter:hover {
  background: #f3f4f6;
  color: var(--text);
  border-color: var(--accent-soft);
}

.btn-filter.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* ===== Google Translate Widget ==== */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.lang-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
}

#google_translate_element select {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 13px;
  background: #fff;
  color: var(--muted);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

#google_translate_element select:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Trên màn hình nhỏ thì logo + translate sẽ xếp dọc */
@media (max-width: 768px) {
  .logo-container {
    flex-direction: column;
    gap: 6px;
  }
  #google_translate_element select {
    font-size: 12px;
    padding: 3px 8px;
  }
}

main {
  margin-top: 12px;
}

.category {
  margin-bottom: 28px;
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
}

.category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 8px;
}

.category-title {
  font-size: 16px;
  font-weight: 600;
}

.category-meta {
  font-size: 12px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.thumb {
  position: relative;
  background: #f3f4f6;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s;
  aspect-ratio: 1 / 1;
  width: 100%;
}

/* Skeleton shimmer */
.thumb.thumb-skeleton::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    #f3f4f6 0%,
    #e5e7eb 20%,
    #f3f4f6 40%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* Khi đã load xong ảnh → tắt skeleton */
.thumb.thumb-skeleton.thumb-loaded::before {
  opacity: 0;
  animation: none;
}

/* Cho các element bên trong nằm trên lớp skeleton */
.thumb.thumb-skeleton > * {
  position: relative;
  z-index: 1;
}

/* Ẩn ảnh trong lúc skeleton chạy */
.thumb.thumb-skeleton img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Khi đã loaded thì fade-in ảnh */
.thumb.thumb-skeleton.thumb-loaded img {
  opacity: 1;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.thumb img {
  width: 100%;
  height: 100%;
  max-width: 420px;
  max-height: 420px;
  display: block;
  object-fit: cover;
}

.thumb:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(148, 163, 184, 0.4);
  border-color: var(--accent-soft);
}

.thumb-label {
  position: absolute !important;
  left: 8px;
  bottom: 8px;
  background: rgba(15, 23, 42, 0.74);
  color: #e5e7eb;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  backdrop-filter: blur(6px);
}

/* Biến thể màu riêng */
.thumb-label.instock {
  background: rgba(255, 99, 132, 0.8); /* tone hồng nhẹ */
}

.thumb-label.order {
  background: rgba(255, 184, 108, 0.8); /* tone vàng cam */
}

/* Nút download trên mỗi thumbnail trong gallery */
.thumb-download {
  position: absolute !important;
  right: 8px;
  top: 8px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #f78da7, #fcb69f);
  color: #fff;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(247, 141, 167, 0.45);
  transition: all 0.2s ease;
  z-index: 2;
  opacity: 0;
  transform: translateY(4px);
}

/* Hover trên desktop thì hiện nút download */
.thumb:hover .thumb-download {
  opacity: 1;
  transform: translateY(0);
}

/* Hover effect cho nút */
.thumb-download:hover {
  filter: brightness(1.08);
  transform: scale(1.08);
  box-shadow: 0 8px 18px rgba(247, 141, 167, 0.55);
}

/* Trên mobile / tablet – luôn hiển thị */
@media (hover: none) {
  .thumb-download {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 10px;
}
.lightbox-overlay.active {
  display: flex;
}

.lightbox {
  background: #ffffff;
  border-radius: 18px;
  max-width: 96vw;
  max-height: 96vh;
  padding: 8px 8px 8px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.lightbox-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.lightbox-path {
  font-size: 11px;
  color: var(--muted);
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lightbox-img-wrap {
  position: relative;
  background: #f3f4f6;
  border-radius: 12px;
  overflow: hidden;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}
#otherCatalogBtn sup{
    vertical-align: super;
    margin: -15px 0 0 0;
}
#otherCatalogBtn small{
    display: block;
    font-weight: 500;
    text-align: center;
}
@media (max-width: 1024px) {
    .lightbox-path{
        display: none;
    }
    .category-header{
        flex-direction: column;
    flex-wrap: wrap;
    }
    .hideMobile{
        display: none;
    }
  /* Header & brand canh giữa trên tablet + mobile */
  header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
  }

  .brand {
    flex-direction: column;
    align-items: center;
    text-align: left;
  }

  /* Nút Order (otherCatalogBtn) nằm giữa */
  #otherCatalogBtn {
    /*margin-top: 8px;*/
    /*align-self: center;*/
  }

  .actions {
    flex-direction: row;
    align-items: center;
    width: auto;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .filter-dropdown {
    width: auto;
  }

  .filters {
    justify-content: center;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .category {
    padding: 12px 12px 14px;
  }
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .actions {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }

  .filter-dropdown {
    width: 100%;
  }

  .filter-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .filter-panel {
    right: 0;
    left: 0;
    min-width: 100%; /* panel span hết chiều ngang header */
  }

  /* Mobile filter bar styling */
  .filter-bar-section {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 0;
    flex-wrap: wrap;
  }

  .product-line-label {
    display: none;
  }

  .filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    order: -1;
    width: 100%;
  }

  .btn-filter {
    padding: 5px 12px;
    font-size: 11px;
  }

  .show-all-btn {
    padding: 5px 12px;
    font-size: 11px;
  }

  /* dùng .cta-row thay vì .cta-group, 2 nút vẫn 50/50 như trên */
  .cta-row {
    width: 100%;
  }

  #otherCatalogBtn {
    justify-content: center;
  }

  .btn-primary {
    justify-content: center;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category {
    padding: 12px 12px 14px;
  }
}

/* ===== Responsive fix cho màn hình nhỏ như iPhone SE ===== */
@media (max-width: 420px) {
  /* Ẩn số lượng và dòng sub text */
  .brand-count {
    display: none !important;
  }

  /* Canh trái phần brand */
  .brand-title-group {
    justify-content: flex-start;
    text-align: left;
  }

  .brand-text-main {
    text-align: left;
  }

  /* Giảm kích thước icon và khoảng cách */
  .brand-icon {
    width: 28px;
    margin-right: 4px;
  }

  header {
    padding: 10px 14px;
  }
}

/* Footer */
.footer {
  text-align: center;
  padding: 10px 10px 10px;
  margin-top: 50px;
  color: var(--muted);
  font-size: 13px;
}
.footer p {
  margin: 4px 0;
}
.footer-sub {
  font-size: 12px;
  color: #a36a6a;
}
aside{
  display: flex;
  align-items: start;
  justify-content: start;
  padding: 14px 22px;
  background: linear-gradient(135deg, #fff, #ffe6e6);
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(255, 155, 155, 0.25);
  position: fixed;
  bottom: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  width: 100%;
}
