/* ==========================================================================
   TẰM - THÊU HƯƠNG DỆT VỊ
   Hệ Thống Thiết Kế & Phong Cách Dân Dã Truyền Thống Việt Nam
   ========================================================================== */

:root {
  /* Bảng màu chính từ Logo & Nhận diện thương hiệu */
  --color-mocha: #7b5f4a;
  /* Nâu mộc ấm - nền logo */
  --color-mocha-dark: #5e4434;
  /* Nâu rang đậm */
  --color-mocha-deep: #422d20;
  /* Nâu gốm nung */
  --color-roast-black: #261711;
  /* Nâu cà phê đậm đặc */
  --color-clay: #8e583f;
  /* Đất nung Bát Tràng */

  --color-cream: #f0e7d8;
  /* Màu tơ tằm / ngà gạo */
  --color-cream-light: #faf6f0;
  /* Giấy Dó trắng ngà */
  --color-cream-dark: #dfd4c0;
  /* Vải lanh mộc */

  --color-amber: #e9bb80;
  /* Chỉ thêu tơ vàng / nếp mật */
  --color-amber-gold: #d4954d;
  /* Vàng đồng cổ */
  --color-amber-light: #f7dfbe;
  /* Vàng tơ mai */

  --color-lacquer-red: #a33924;
  /* Đỏ son gốm Kinh Bắc */
  --color-tea-leaf: #53694c;
  /* Xanh búp chè Shan */
  --color-dark-text: #2f2018;
  /* Chữ sẫm màu trên nền sáng */
  --color-muted-text: #baaba0;
  /* Chữ phụ trên nền tối */
  --color-border-dark: rgba(233, 187, 128, 0.22);
  --color-border-light: rgba(123, 95, 74, 0.18);

  /* Font chữ */
  --font-body: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-folk: 'Cormorant Garamond', 'Times New Roman', serif;

  /* Đổ bóng & Hiệu ứng */
  --shadow-sm: 0 2px 8px rgba(38, 23, 17, 0.12);
  --shadow-md: 0 8px 24px rgba(38, 23, 17, 0.2);
  --shadow-lg: 0 16px 40px rgba(38, 23, 17, 0.35);
  --shadow-amber: 0 4px 20px rgba(233, 187, 128, 0.25);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

  --header-height: 82px;
}

@media (max-width: 768px) {
  :root {
    --header-height: 68px;
  }
}

/* Reset cơ bản */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  background-color: var(--color-roast-black);
  color: var(--color-cream);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--color-roast-black);
  background-image:
    radial-gradient(ellipse at 15% 10%, rgba(123, 95, 74, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 60%, rgba(66, 45, 32, 0.5) 0%, transparent 60%),
    repeating-linear-gradient(45deg, rgba(233, 187, 128, 0.015) 0px, rgba(233, 187, 128, 0.015) 2px, transparent 2px, transparent 12px);
  background-attachment: fixed;
}

/* Scrollbar tinh tế kiểu mộc */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: var(--color-roast-black);
}

::-webkit-scrollbar-thumb {
  background: var(--color-mocha);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-roast-black);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-amber);
}

/* Typography phong cách truyền thống */
h1,
h2,
h3,
h4,
.font-serif {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-cream);
}

.font-folk {
  font-family: var(--font-folk);
}

p {
  color: var(--color-muted-text);
  font-size: 0.98rem;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: var(--font-body);
  border: none;
  outline: none;
  cursor: pointer;
  background: none;
  transition: all var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 0 24px;
}

@media only screen and (max-width: 768px) {
  .container {
    padding: 0 16px !important;
  }
}

/* Dải trang trí truyền thống */
.folk-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 24px 0 32px 0;
}

.folk-divider::before,
.folk-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(to right, transparent, var(--color-amber), transparent);
  opacity: 0.6;
}

.folk-divider-icon {
  width: 24px;
  height: 24px;
  color: var(--color-amber);
  opacity: 0.9;
  animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
    filter: drop-shadow(0 0 6px var(--color-amber));
  }
}

/* Huy hiệu thẻ tag phong cách dân dã */
.badge-traditional {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #f7dfbe 0%, #e9bb80 45%, #d4954d 100%);
  color: #261711;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35), 0 0 12px rgba(233, 187, 128, 0.35);
  white-space: nowrap;
  user-select: none;
  transition: all var(--transition-fast);
}

.badge-traditional::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.badge-traditional:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.badge-lacquer {
  background: linear-gradient(135deg, #cb3b24 0%, #a32e18 50%, #7d1c0b 100%);
  color: #ffffff;
  border-color: rgba(255, 205, 195, 0.55);
  box-shadow: 0 3px 12px rgba(163, 57, 36, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.badge-tea {
  background: linear-gradient(135deg, #537a47 0%, #3d5e33 50%, #2a4323 100%);
  color: #ffffff;
  border-color: rgba(200, 235, 190, 0.55);
  box-shadow: 0 3px 12px rgba(61, 94, 51, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Nút bấm thủ công mộc */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--color-amber) 0%, var(--color-amber-gold) 100%);
  color: var(--color-roast-black);
  padding: 12px 26px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 16px rgba(233, 187, 128, 0.3);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(233, 187, 128, 0.45);
  filter: brightness(1.06);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(240, 231, 216, 0.08);
  color: var(--color-cream);
  border: 1px solid var(--color-border-dark);
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
  transition: all var(--transition-normal);
}

.btn-secondary:hover {
  background: rgba(233, 187, 128, 0.15);
  color: var(--color-amber);
  border-color: var(--color-amber);
  transform: translateY(-1px);
}

/* Toast Thông Báo Dân Dã */
#toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.folk-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--color-mocha-deep);
  border: 1px solid var(--color-amber);
  color: var(--color-cream);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(233, 187, 128, 0.15);
  font-size: 0.92rem;
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 380px;
}

@media (max-width: 480px) {
  #toast-container {
    bottom: 20px;
    right: 16px;
    left: 16px;
    align-items: center;
  }

  .folk-toast {
    max-width: 100%;
    width: 100%;
    padding: 12px 16px;
    font-size: 0.86rem;
  }
}

.folk-toast-icon {
  width: 24px;
  height: 24px;
  color: var(--color-amber);
  flex-shrink: 0;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(20px);
  }
}