/**
 * Tiệm Tranh An Sắc — Design Tokens
 * Định nghĩa biến giao diện chuẩn UI/UX, hỗ trợ Mobile First & Safe Area
 */

:root {
  /* Bảng màu chính thức */
  --color-bg-primary: #FAFAF9;      /* Nền chính - màu kem sáng dịu */
  --color-bg-secondary: #F3EFE8;    /* Nền phụ - màu be giấy ấm áp */
  --color-bg-card: #FFFFFF;         /* Nền thẻ sản phẩm, form */
  --color-bg-subtle: #ECE8E1;       /* Nền phân cách nhẹ */
  
  --color-text-primary: #1C1917;    /* Chữ chính - than sẫm */
  --color-text-secondary: #57534E;  /* Chữ phụ - đá cuội */
  --color-text-muted: #78716C;      /* Chữ ghi chú, phụ đề */
  --color-text-inverse: #FFFFFF;    /* Chữ trên nền tối */

  --color-accent: #A16207;          /* Màu nhấn - Vàng đồng / hổ phách ấm */
  --color-accent-hover: #854D0E;    /* Màu nhấn khi hover/active */
  --color-accent-subtle: #FEF3C7;   /* Màu nhấn nền nhạt */
  --color-accent-border: #FDE68A;

  --color-brand-moss: #23473D;      /* Xanh rêu thương hiệu An Sắc */
  --color-brand-moss-light: #E8EFEA;
  
  --color-border: #D6D3D1;          /* Đường viền chuẩn */
  --color-border-light: #E7E5E4;    /* Viền ngăn chia nhẹ */
  --color-border-focus: #A16207;

  --color-success: #15803D;         /* Trạng thái thành công */
  --color-success-bg: #DCFCE7;
  --color-error: #B91C1C;           /* Trạng thái lỗi */
  --color-error-bg: #FEE2E2;
  --color-warning: #D97706;
  --color-warning-bg: #FEF3C7;

  /* Typography */
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px - Tiêu chuẩn mobile không tự zoom */
  --font-size-md: 1.125rem;   /* 18px */
  --font-size-lg: 1.25rem;    /* 20px */
  --font-size-xl: 1.5rem;     /* 24px */
  --font-size-2xl: 1.875rem;  /* 30px */
  --font-size-3xl: 2.25rem;   /* 36px */
  --font-size-4xl: 2.75rem;   /* 44px */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.65;

  /* Spacing Scale */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */

  /* Layout */
  --container-max-width: 1240px;
  --container-padding: 1rem;
  --reading-max-width: 720px;
  --touch-min-size: 44px;      /* Chuẩn Apple/Google 44x44px */

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(28, 25, 23, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(28, 25, 23, 0.08), 0 2px 4px -2px rgba(28, 25, 23, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(28, 25, 23, 0.1), 0 4px 6px -4px rgba(28, 25, 23, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(28, 25, 23, 0.12), 0 8px 10px -6px rgba(28, 25, 23, 0.05);
  --shadow-bottom-bar: 0 -4px 12px rgba(28, 25, 23, 0.08);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-indexes */
  --z-header: 40;
  --z-bottom-nav: 50;
  --z-purchase-bar: 55;
  --z-overlay: 60;
  --z-drawer: 70;
  --z-modal: 80;
  --z-toast: 90;

  /* Safe Area for Mobile */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);

  /* Heights */
  --header-height-mobile: 58px;
  --header-height-desktop: 72px;
  --announcement-height: 36px;
  --bottom-nav-height: 60px;
}

@media (min-width: 768px) {
  :root {
    --container-padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --container-padding: 2rem;
  }
}
