/* --- 1. CÀI ĐẶT BIẾN TOÀN CỤC & RESET --- */
:root {
  /* Bảng màu cho Light Mode (Chế độ Sáng) */
  --color-primary: #1e201e;
  --color-primary-rgb: 18, 194, 33;
  --color-primary-dark: #0d8508;
  --color-primary-light: #e7f9e8;
  --color-secondary: #5a6470;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-surface: #ffffff;
  --color-background: #f3f4f6;
  --color-border: #e5e7eb;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --color-footer: #e7f9e8;
  --color-footertext: #1e201e;
  --color-header: #75d772;
  --focus-ring-color: rgba(var(--color-primary-rgb), 0.25);

  /* Typography & Layout */
  --font-family-main: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.7;
  --header-height-desktop: 72px;
  --sidebar-width: 260px;
  --container-width: 1440px;

  /* Bo góc & Đổ bóng */
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 1rem;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 15px 30px -5px rgba(0, 0, 0, 0.1),
    0 5px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  --shadow-primary-glow: 0 0 20px rgba(var(--color-primary-rgb), 0.2);

  /* Hiệu ứng chuyển động */
  --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

html[data-theme="dark"] {
  /* Bảng màu cho Dark Mode (Chế độ Tối) */
  --color-primary: #34d399;
  --color-primary-rgb: 52, 211, 153;
  --color-primary-dark: #10b981;
  --color-primary-light: #1f2937;
  --color-secondary: #9ca3af;
  --color-text: #e5e7eb;
  --color-text-muted: #9ca3af;
  --color-surface: #1f2937;
  --color-header: #1f2937;
  --color-footer: #1f2937;
  --color-footertext: #ffff;
  --color-background: #111827;
  --color-border: #374151;
  --color-success: #22c55e;
  --color-danger: #ef4444;
  --focus-ring-color: rgba(var(--color-primary-rgb), 0.3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-family-main);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  background-color: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal),
    color var(--transition-normal);
}
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--color-primary-dark);
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
ul {
  list-style: none;
}
button {
  font-family: inherit;
  cursor: pointer;
}

/* --- 2. BỐ CỤC CHUNG --- */
.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.main-wrapper {
  flex-grow: 1;
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  
}
.main-content {
  padding: 1.5rem 0;
   overflow: hidden;
}

/* --- 3. HEADER & TÌM KIẾM --- */
.top-header {
  padding: 0.75rem 0;
  background-color: color-mix(in srgb, var(--color-header) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-normal);
}
.header-container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.header-logo {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-primary);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.header-logo:hover {
  transform: scale(1.05);
}
.header-search-wrapper {
  display: block;
  width: 100%;
  order: 3;
  position: relative;
}
.header-search-wrapper form {
  position: relative;
}
.search-icon {
  position: absolute;
  top: 50%;
  left: 1.25rem;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}
.header-search-bar {
  width: 100%;
  padding: 0.75rem 1.25rem 0.75rem 3rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background-color: var(--color-background);
  transition: all var(--transition-fast);
  font-size: 1rem;
  color: var(--color-text);
}
.header-search-bar:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--focus-ring-color), var(--shadow-sm);
  background-color: var(--color-surface);
}
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 999;
  max-height: 400px;
  overflow-y: auto;
  display: none; /* Hidden by default */
}
.search-results-dropdown.is-visible {
  display: block;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  transition: background-color var(--transition-fast);
  color: var(--color-text);
}
.search-result-item:hover {
  background-color: var(--color-background);
}
.search-result-item:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}
.search-result-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  flex-shrink: 0;
}
.search-result-info {
  display: flex;
  flex-direction: column;
}
.search-result-name {
  font-weight: 600;
  line-height: 1.3;
}
.search-result-price {
  font-size: 0.9rem;
  color: var(--color-danger);
  font-weight: 500;
}
.search-results-footer {
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: 600;
  color: var(--color-primary);
  background-color: var(--color-primary-light);
  display: block;
  width: 100%;
  border: none;
}
.search-results-footer:hover {
  filter: brightness(0.95);
}
.search-results-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--color-text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.header-actions {
  display: none;
  align-items: center;
  gap: 0.75rem;
}
.header-nav ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.header-nav a {
  font-weight: 500;
  color: var(--color-text);
  padding: 0.5rem 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.header-nav a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-bounce);
}
.header-nav a:hover::after,
.header-nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}
.header-action-btn {
  background-color: transparent;
  border: 1px solid transparent;
  color: var(--color-text-muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
}
.header-action-btn:hover {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
  transform: scale(1.1);
}
.theme-toggle-btn .fa-sun {
  display: none;
}
.theme-toggle-btn .fa-moon {
  display: block;
}
html[data-theme="dark"] .theme-toggle-btn .fa-sun {
  display: block;
}
html[data-theme="dark"] .theme-toggle-btn .fa-moon {
  display: none;
}
.mobile-menu-toggle {
  background: none;
  border: none;
  padding: 0.5rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  transition: background-color var(--transition-fast);
}
.mobile-menu-toggle:hover {
  background-color: var(--color-border);
}

/* --- 4. SIDEBAR & NAVIGATION --- */
.sidebar {
  display: none;
}
.sidebar-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 90%;
  max-width: 320px;
  height: 100dvh;
  z-index: 1010;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-bounce),
    background-color var(--transition-normal);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  padding-bottom: 50px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sidebar-mobile.is-open {
  transform: translateX(0);
}
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
}
.sidebar-title {
  font-size: 1.5rem;
  font-weight: 700;
}
.sidebar-close-btn {
  background: none;
  border: none;
  font-size: 2.5rem;
  color: var(--color-text-muted);
  line-height: 1;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.sidebar-close-btn:hover {
  color: var(--color-danger);
  transform: rotate(90deg) scale(1.1);
}
.menu-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1005;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal),
    visibility 0s var(--transition-normal);
}
.menu-overlay.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--transition-normal);
}
.category-list a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  margin-bottom: 0.5rem;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  color: var(--color-text);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.category-list a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--color-primary-rgb), 0.1),
    transparent
  );
  transition: left var(--transition-normal);
}
.category-list a:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  transform: translateX(5px);
}
.category-list a:hover::before {
  left: 100%;
}
.category-list a.active {
  background-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.3);
}
html[data-theme="dark"] .category-list a.active {
  color: var(--color-background);
}
.category-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 1rem 0;
  font-size: 0.8rem;
  text-align: center;
  color: var(--color-text-muted);
}
.sale-category-link {
  color: var(--color-danger) !important;
  font-weight: 700 !important;
}
.sale-category-link:hover,
.sale-category-link.active {
  background-color: color-mix(
    in srgb,
    var(--color-danger) 10%,
    transparent
  ) !important;
  color: var(--color-danger) !important;
}
html[data-theme="dark"] .sale-category-link:hover,
html[data-theme="dark"] .sale-category-link.active {
  background-color: color-mix(
    in srgb,
    var(--color-danger) 20%,
    transparent
  ) !important;
}

/* --- Các style khác giữ nguyên --- */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.page-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 0.5rem;
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.95rem;
}
.breadcrumb li {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
}
.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin: 0 0.75rem;
  color: var(--color-border);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.product-card {
  background-color: var(--color-surface);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal),
    box-shadow var(--transition-normal), border-color var(--transition-normal);
  border: 1px solid var(--color-border);
  height: 100%;
  position: relative;
}
.product-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg), var(--shadow-primary-glow);
  border-color: rgba(var(--color-primary-rgb), 0.5);
}
.product-card > a {
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.product-image-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--color-background);
}
.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}
.product-card:hover .product-image {
  transform: scale(1.08) rotate(2deg);
}
.product-card-content {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.product-card-category {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.product-card-name {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}
.product-card-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-danger);
  margin-bottom: 1rem;
}
.pagination {
  margin-top: 3.5rem;
}
.pagination ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pagination a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--color-primary);
  font-weight: 500;
  transition: all var(--transition-fast);
  border: 1px solid var(--color-border);
}
.pagination a:hover {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.pagination a.active {
  background-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: scale(1.1);
}

/* --- 5. COMPONENTS CHUNG --- */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.page-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 0.5rem;
}

.search-summary {
  margin-top: 0.75rem;
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.95rem;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin: 0 0.75rem;
  color: var(--color-border);
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb .active {
  font-weight: 500;
  color: var(--color-text);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.product-card {
  background-color: var(--color-surface);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal),
    box-shadow var(--transition-normal), border-color var(--transition-normal);
  border: 1px solid var(--color-border);
  height: 100%;
  position: relative;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg), var(--shadow-primary-glow);
  border-color: rgba(var(--color-primary-rgb), 0.5);
}

.product-card > a {
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-image-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--color-background);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.product-card:hover .product-image {
  transform: scale(1.08) rotate(2deg);
}

.product-card-content {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-card-category {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-card-name {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}

.product-card-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-danger);
  margin-bottom: 1rem;
}

.product-card-link {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.product-card-link::after {
  content: "→";
  transition: transform var(--transition-fast);
}

.product-card > a:hover .product-card-link::after {
  transform: translateX(5px);
}

.pagination {
  margin-top: 3.5rem;
}

.pagination ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pagination a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--color-primary);
  font-weight: 500;
  transition: all var(--transition-fast);
  border: 1px solid var(--color-border);
}

.pagination a:hover {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.pagination a.active {
  background-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: scale(1.1);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  background-color: var(--color-surface);
  border-radius: var(--border-radius-lg);
  border: 2px dashed var(--color-border);
}

.empty-state p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

/* --- 6. COMPONENTS THEO TỪNG TRANG --- */

/* Home Page: Banner & Sliders */
.banner-section {
  margin-bottom: 2.5rem;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  background-color: var(--color-border);
  aspect-ratio: 16 / 7;
  box-shadow: var(--shadow-md);
  width: 100%;
}
.banner-slider-container {
  position: relative;
  width: 100%;
  height: 100%;
}
.banner-track {
  display: flex;
  height: 100%;
  transition: transform var(--transition-bounce) ease-in-out;
}
.banner-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}
.banner-slide a {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}
.banner-slide a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent 60%);
  pointer-events: none;
}
.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-section-fallback {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  background: linear-gradient(
    135deg,
    var(--color-primary-light),
    var(--color-background)
  );
  color: var(--color-text);
}
.hero-section-fallback h1 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}
.hero-section-fallback p {
  font-size: clamp(1rem, 3vw, 1.1rem);
  max-width: 600px;
  color: var(--color-text-muted);
}
.banner-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: color-mix(in srgb, var(--color-surface) 80%, transparent);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.banner-btn:hover {
  background-color: var(--color-surface);
  transform: translateY(-50%) scale(1.1);
  box-shadow: var(--shadow-md);
}
.banner-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: translateY(-50%) scale(1);
}
.banner-btn.prev {
  left: 1rem;
}
.banner-btn.next {
  right: 1rem;
}

.product-carousel-section {
  margin-bottom: 4rem;
    wdith:100%;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.5rem;
}
.section-title {
  font-size: 2rem;
  font-weight: 700;
}
.see-all-link {
  font-weight: 600;
}
.product-slider {
  position: relative;
}
.slider-track-container {
  overflow: hidden;
  cursor: grab;
  padding: 0.5rem 0;
  margin: -0.5rem 0;
}
.slider-track {
  display: flex;
  gap: 1.5rem;
  scroll-behavior: smooth;
  overflow-x: auto;
  scrollbar-width: none;
  min-height: 250px;
  align-items: stretch;
}
.slider-track::-webkit-scrollbar {
  display: none;
}
.slider-track.active-drag {
  cursor: grabbing;
  scroll-behavior: auto;
}
.slider-track .product-card {
  flex: 0 0 55%;
}
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  z-index: 10;
  display: none; /* Hidden by default, shown in media query */
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.slider-btn:hover:not(:disabled) {
  background-color: var(--color-primary);
  color: white;
  transform: translateY(-50%) scale(1.1);
}
.slider-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.slider-btn.prev {
  left: 1px;
}
.slider-btn.next {
  right: 1px;
}
.product-slider:not(.is-scrollable) .slider-btn {
  display: none !important;
}

/* Category Page: Filter Bar */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background-color: var(--color-surface);
  border-radius: var(--border-radius-md);
  margin-bottom: 2.5rem;
  border: 1px solid var(--color-border);
}
.filter-group {
  display: flex;
  flex-direction: column;
}
.filter-group label {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.filter-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-text);
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  transition: all var(--transition-fast);
}
html[data-theme="dark"] .filter-group select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}
.filter-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--focus-ring-color);
}
.filter-button {
  padding: 0.75rem 1.5rem;
  border: none;
  background: var(--color-primary);
  color: white;
  font-weight: 600;
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
}
.filter-button:hover {
  background-color: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.filter-button:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* PRODUCT DETAIL PAGE V2 - DESIGN REFRESH */
.product-detail-page-v2 .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}
.product-detail-page-v2 .breadcrumb-v2 ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.95rem;
  padding: 0;
}
.product-detail-page-v2 .breadcrumb-v2 li {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
}
.product-detail-page-v2 .breadcrumb-v2 li:not(:last-child)::after {
  content: "›";
  margin: 0 0.75rem;
  color: var(--color-border);
  font-size: 1.2rem;
}
.product-detail-page-v2 .breadcrumb-v2 a {
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}
.product-detail-page-v2 .breadcrumb-v2 a:hover {
  color: var(--color-primary);
}
.product-detail-page-v2 .breadcrumb-v2 .active {
  font-weight: 500;
  color: var(--color-text);
}
.product-detail-page-v2 .product-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
  margin-bottom: 3rem;
}
.product-detail-page-v2 .product-gallery-v2 {
  display: flex;
  flex-direction: column;
  gap: 1rem;

  top: calc(var(--header-height-desktop) + 1.5rem);
  overflow: hidden;
}
.product-detail-page-v2 .main-image-v2 {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow-sm);
}
.product-detail-page-v2 .main-image-v2 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}
.product-detail-page-v2 .main-image-v2:hover img {
  transform: scale(1.15);
}

/* === THUMBNAIL SLIDER START === */
.product-detail-page-v2 .thumbnail-slider-container {
  position: relative;
}

.product-detail-page-v2 .thumbnail-list-v2 {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 5px 2px;
}

.product-detail-page-v2 .thumbnail-list-v2::-webkit-scrollbar {
  display: none;
}

.product-detail-page-v2 .thumbnail-item-v2 {
  flex-shrink: 0;
  width: 75px;
  cursor: pointer;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
/* === THUMBNAIL SLIDER END === */

.product-detail-page-v2 .thumbnail-item-v2:hover {
  border-color: var(--color-primary-dark);
  transform: scale(1.05);
}
.product-detail-page-v2 .thumbnail-item-v2.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--focus-ring-color);
  transform: scale(1.05);
}
.product-detail-page-v2 .thumbnail-item-v2 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-page-v2 .thumb-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background-color: color-mix(in srgb, var(--color-surface) 80%, transparent);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  opacity: 0;
  visibility: hidden;
}

.product-detail-page-v2 .thumbnail-slider-container:hover .thumb-slider-btn,
.product-detail-page-v2 .thumb-slider-btn.is-visible {
  opacity: 1;
  visibility: visible;
}

.product-detail-page-v2 .thumb-slider-btn:hover:not(:disabled) {
  background-color: var(--color-primary);
  color: white;
  transform: translateY(-50%) scale(1.05);
}

.product-detail-page-v2 .thumb-slider-btn.prev {
  left: 0.5rem; /* Sửa lỗi tràn layout */
}

.product-detail-page-v2 .thumb-slider-btn.next {
  right: 0.5rem; /* Sửa lỗi tràn layout */
}

.product-detail-page-v2 .thumb-slider-btn:disabled {
  opacity: 0 !important;
  visibility: hidden;
  cursor: not-allowed;
}

.product-detail-page-v2 .product-info-v2 {
  display: flex;
  flex-direction: column;
}
.product-detail-page-v2 .product-title-v2 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.product-detail-page-v2 .product-meta-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}
.product-detail-page-v2 .product-meta-v2 a {
  color: var(--color-primary);
  font-weight: 500;
}
.product-detail-page-v2 .meta-divider {
  color: var(--color-border);
}
.product-detail-page-v2 .product-price-box-v2 {
  background-color: var(--color-surface);
  border: 2px dashed var(--color-primary);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.product-detail-page-v2 .price-value {
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 800;
  color: var(--color-danger);
  line-height: 1;
}
.product-detail-page-v2 .product-variants-v2 {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.product-detail-page-v2 .variant-group-v2 {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.product-detail-page-v2 .variant-label-v2 {
  font-weight: 600;
  font-size: 1rem;
}
.product-detail-page-v2 .variant-options-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.product-detail-page-v2 .variant-option-v2 input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.product-detail-page-v2 .variant-option-v2 label {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  font-weight: 500;
  background-color: var(--color-surface);
  transition: all var(--transition-fast);
}
.product-detail-page-v2 .variant-option-v2 label:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background-color: var(--color-primary-light);
  transform: translateY(-2px);
}
.product-detail-page-v2 .variant-option-v2 input[type="radio"]:checked + label {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  font-weight: 600;
  box-shadow: var(--shadow-md);
}
.product-detail-page-v2
  .variant-option-v2
  input[type="radio"]:focus-visible
  + label {
  box-shadow: 0 0 0 3px var(--focus-ring-color);
}
.product-detail-page-v2 .variant-option-v2.is-unavailable label {
  opacity: 0.5;
  background-color: var(--color-background);
  text-decoration: line-through;
  text-decoration-color: var(--color-danger);
  cursor: not-allowed;
}
.product-detail-page-v2 .contact-actions-v2 {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.product-detail-page-v2 .contact-title {
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}
.product-detail-page-v2 .contact-actions-v2 .button-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
}
.product-detail-page-v2 .contact-btn-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--border-radius-md);
  font-size: 1rem;
  font-weight: 700;
  color: white;
  transition: all var(--transition-fast);
  border: none;
  box-shadow: var(--shadow-sm);
}
.product-detail-page-v2 .contact-btn-v2:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow-lg);
  filter: brightness(1.15);
}
.product-detail-page-v2 .contact-btn-v2:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: var(--shadow-sm);
  filter: brightness(1);
}
.product-detail-page-v2 .contact-btn-v2 i {
  font-size: 1.2rem;
}
.product-detail-page-v2 .contact-btn-v2.facebook {
  background: #1877f2;
}
.product-detail-page-v2 .contact-btn-v2.zalo {
  background: #0068ff;
}
.product-detail-page-v2 .contact-btn-v2.phone {
  background: var(--color-success);
}
.product-detail-page-v2 .product-details-tabs-v2 {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.product-detail-page-v2 .tab-headers {
  display: flex;
  background-color: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.product-detail-page-v2 .tab-link {
  padding: 1rem 1.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-muted);
  position: relative;
  transition: color var(--transition-fast);
  flex-grow: 1;
  text-align: center;
}
.product-detail-page-v2 .tab-link::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition-fast);
}
.product-detail-page-v2 .tab-link.active {
  color: var(--color-primary);
}
.product-detail-page-v2 .tab-link.active::after {
  transform: scaleX(1);
}
.product-detail-page-v2 .tab-content {
  padding: 1.5rem 2rem;
  line-height: 1.8;
}
.product-detail-page-v2 .tab-pane {
  display: none;
}
.product-detail-page-v2 .tab-pane.active {
  display: block;
  animation: fadeInUp 0.5s ease-in-out;
}

.product-detail-page-v2 .specs-table-v2 {
  width: 100%;
  border-collapse: collapse;
}
.product-detail-page-v2 .specs-table-v2 tr:nth-child(odd) {
  background-color: var(--color-background);
}
.product-detail-page-v2 .specs-table-v2 td {
  padding: 0.8rem 1rem;
  border: 1px solid var(--color-border);
}
.product-detail-page-v2 .specs-table-v2 td:first-child {
  font-weight: 600;
  width: 35%;
}

/* --- 7. FOOTER --- */
.site-footer {
  background-color: var(--color-footer);
  color: var(--color-footertext);
  padding: 3rem 0 0 0;
  margin-top: 3.5rem;
  text-align: center;
}
.footer-main {
  text-align: center;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #374151;
}
.footer-bottom {
  padding: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--color-footertext);
}
.footer-col h4 {
  color: var(--color-footertext);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
}
.footer-col,
.footer-col p,
.footer-col a {
  font-size: 0.95rem;
  line-height: 1.7;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col li {
  margin-bottom: 0.5rem;
}
.footer-col a {
  color: var(--color-footertext);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.footer-col a:hover {
  color: var(--color-primary);
}
.footer-socials {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}
.footer-socials a {
  font-size: 1.25rem;
  transition: transform var(--transition-fast), color var(--transition-fast);
}
.footer-socials a:hover {
  transform: scale(1.2);
  color: var(--color-primary);
}
.footer-icon {
  margin-right: 0.75rem;
  width: 1em;
  text-align: center;
  color: var(--color-primary);
}
.floating-contact {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 999;
}
.floating-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: white;
  transition: all var(--transition-normal);
  /* NÂNG CẤP: Áp dụng animation lắc lư */
  animation: wobble 2.5s ease-in-out infinite;
}
.floating-btn i {
  font-size: 1.5rem;
}
.floating-btn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.2);
  filter: brightness(1.1);
  /* Tạm dừng animation khi hover để dễ click hơn */
  animation-play-state: paused;
}
.floating-btn.zalo-float {
  background-color: #0068ff;
  animation-delay: 0.2s;
}
.floating-btn.fb-float {
  background-color: #1877f2;
  animation-delay: 0.4s;
}
.floating-btn.phone-float {
  background-color: #25d366;
}

/* NÂNG CẤP: Định nghĩa animation lắc lư */
@keyframes wobble {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  10% {
    transform: rotate(-10deg) scale(1.05);
  }
  20% {
    transform: rotate(10deg) scale(1.05);
  }
  30% {
    transform: rotate(-10deg) scale(1.05);
  }
  40% {
    transform: rotate(10deg) scale(1.05);
  }
  50% {
    transform: rotate(0deg) scale(1);
  }
}
.map-section {
  margin-top: 2.5rem;
  padding: 1.5rem 0;
}
.map-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-border);
}
.map-tab-btn {
  padding: 0.5rem 1rem;
  border: none;
  background-color: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: var(--transition-fast);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.map-tab-btn:hover {
  color: var(--color-primary);
}
.map-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.map-content {
  padding-top: 1.5rem;
}
.map-pane {
  display: none;
}
.map-pane.active {
  display: block;
  animation: fadeInUp 0.6s ease-in-out;
}
.map-pane iframe {
  width: 100%;
  height: 350px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
}

/* --- 8. ANIMATIONS & EFFECTS (MỚI) --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(var(--color-primary-rgb), 0);
  }
}

@keyframes shimmer-effect {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Skeleton Loader Styles */
.skeleton {
  background-color: var(--color-border);
  border-radius: var(--border-radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer-effect 1.5s infinite;
}

html[data-theme="dark"] .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5rem;
}
.skeleton-text:last-child {
  width: 75%;
}
.skeleton-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

/* --- 9. DESKTOP & TABLET STYLES (@media) --- */
@media (min-width: 768px) {
  .footer-main {
    text-align: left;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin: 0 2rem;
  }
  .footer-socials {
    justify-content: flex-start;
  }

  .top-header {
    padding: 0;
    height: var(--header-height-desktop);
  }
  .header-container {
    flex-wrap: nowrap;
  }
  .header-logo {
    order: 1;
  }
  .header-search-wrapper {
    order: 2;
    width: auto;
    flex-grow: 1;
    max-width: 500px;
    margin: 0 2rem;
  }
  .header-right {
    order: 3;
  }

  .header-actions {
    display: flex;
  }

  .mobile-menu-toggle {
    display: none;
  }
  .main-wrapper {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 2rem;
    width: 100%;
    
  }
  .sidebar {
    display: block;
    position: sticky;
    top: calc(var(--header-height-desktop) + 1.5rem);
    height: calc(100dvh - var(--header-height-desktop) - 3rem);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    padding: 1.5rem;
    transition: all var(--transition-normal);
  }
  .sidebar-mobile,
  .menu-overlay {
    display: none !important;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .slider-track .product-card {
    flex-basis: calc(50% - 0.75rem);
  }
  .slider-btn {
    display: flex;
  }
  .filter-bar {
    flex-direction: row;
    align-items: flex-end;
    gap: 1.5rem;
  }
  .filter-group {
    flex-grow: 1;
  }
  .filter-button {
    flex-shrink: 0;
  }

  .product-detail-page-v2 .product-layout {
    grid-template-columns: 4fr 5fr;
    gap: 3rem;
  }
  .product-detail-page-v2 .container {
    padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
  .slider-track .product-card {
    flex-basis: calc(33.333% - 1rem);
  }
}

@media (min-width: 1280px) {
  .slider-track .product-card {
    flex-basis: calc(25% - 1.125rem);
  }
  .main-wrapper,
  .header-container {
    padding: 0;
  }
}
