/* ============================================
   PawMart Design System
   Style: Friendly / Playful / Modern
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@200;300;400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,500;0,600;0,700;0,800;1,500;1,600&family=Noto+Serif+Thai:wght@500;600;700;800;900&display=swap');

:root {
  /* Brand Colors - CHINESE NEW YEAR (แดงมงคล + ทองอร่าม) */
  --color-primary: #C8102E;        /* Lucky Red (แดงมงคล) */
  --color-primary-dark: #8E0B20;   /* Deep red */
  --color-primary-light: #F2A6A6;  /* Soft red */

  --color-secondary: #E6B422;      /* Imperial Gold (ทอง) */
  --color-secondary-dark: #B8860B;

  --color-accent: #FFD700;         /* Bright Gold (ทองสว่าง) */
  --color-pink: #D62828;           /* Bright red */
  --color-purple: #A60D24;         /* Wine red */

  /* Festive gradients */
  --gradient-copper: linear-gradient(135deg, #D62828 0%, #C8102E 50%, #8E0B20 100%);
  --gradient-copper-shine: linear-gradient(120deg, #E83A3A 0%, #C8102E 45%, #9A0C1E 75%, #C8102E 100%);
  --gradient-gold: linear-gradient(135deg, #FFE89A 0%, #FFD700 40%, #E6B422 70%, #B8860B 100%);
  --gradient-red-gold: linear-gradient(135deg, #C8102E 0%, #A60D24 60%, #E6B422 100%);

  /* Neutrals - Warm Festive Scale */
  --color-bg: #FFF8F0;             /* Warm ivory-gold */
  --color-bg-alt: #FFFFFF;
  --color-surface: #FFFFFF;
  --color-ink: #2A0A0A;            /* Deep red-black */
  --color-ink-light: #5E2018;
  --color-muted: #9A6F5A;
  --color-border: #EBD9B8;
  --color-border-light: #F5E9D3;

  /* Semantic */
  --color-success: #5A9E52;
  --color-warning: #C4851A;
  --color-danger: #C0392B;
  --color-info: #3B6EA5;

  /* Typography */
  --font-display: 'Playfair Display', 'Noto Serif Thai', 'Prompt', serif;
  --font-body: 'Prompt', sans-serif;
  
  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(45, 27, 14, 0.06);
  --shadow-md: 0 4px 16px rgba(45, 27, 14, 0.08);
  --shadow-lg: 0 12px 32px rgba(45, 27, 14, 0.12);
  --shadow-xl: 0 24px 64px rgba(45, 27, 14, 0.16);
  --shadow-glow: 0 8px 24px rgba(198, 16, 46, 0.42);
  
  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: hidden;
  max-width: 100vw;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-ink);
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-copper-shine);
  background-size: 200% 100%;
  background-position: 0% 0%;
  color: #FFE8A8;
  border: 1.5px solid var(--color-secondary);
  box-shadow: var(--shadow-glow);
  text-shadow: 0 1px 2px rgba(80, 8, 8, 0.45);
  transition: all 0.3s var(--ease), background-position 0.5s var(--ease);
}
.btn-primary:hover {
  background-position: 100% 0%;
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(198, 16, 46, 0.50);
  border-color: var(--color-accent);
}

.btn-secondary {
  background: var(--color-ink);
  color: white;
}
.btn-secondary:hover {
  background: #1a0f08;
  transform: translateY(-2px);
}

.btn-outline {
  background: white;
  color: var(--color-ink);
  border: 2px solid var(--color-border);
}
.btn-outline:hover {
  border-color: var(--color-ink);
}

.btn-ghost {
  background: transparent;
  color: var(--color-ink);
}
.btn-ghost:hover {
  background: rgba(45, 27, 14, 0.06);
}

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 18px 36px; font-size: 1.05rem; }

/* ===== Cards ===== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: all 0.3s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-primary { background: var(--color-primary-dark); color: #FFFFFF; }
.badge-success { background: #16A34A; color: #FFFFFF; }
.badge-warning { background: #D97706; color: #FFFFFF; }
.badge-danger  { background: #DC2626; color: #FFFFFF; }
.badge-info    { background: #2563EB; color: #FFFFFF; }

/* ===== Forms ===== */
.input, .select, .textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  background: white;
  transition: border-color 0.2s var(--ease);
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 6px;
  color: var(--color-ink);
}

/* ===== Utility ===== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.grid {
  display: grid;
  gap: 24px;
}

.flex {
  display: flex;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-ink-light); }
.text-small { font-size: 0.875rem; }

/* ===== Decorative Blobs ===== */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}

/* ===== Animations ===== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.fade-up {
  animation: fadeUp 0.6s var(--ease) both;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-primary-light); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* ===== A11y พื้นฐาน (ข้อ 10) — ไม่กระทบ layout ที่มี ===== */
*:focus-visible {
  outline: 2px solid var(--color-primary, #C8102E);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible, a:focus-visible {
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.25);
}
/* Skip link สำหรับ screen reader */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-primary, #C8102E);
  color: #fff;
  padding: 10px 16px;
  z-index: 10000;
  text-decoration: none;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { top: 0; }
/* Reduced motion — เคารพ user pref */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* Empty state generic class */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-muted, #999);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { margin: 0 0 6px; font-family: var(--font-display, inherit); }
.empty-state p { margin: 0; font-size: 0.9rem; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg, #f3f4f6) 25%, var(--color-border, #e5e7eb) 50%, var(--color-bg, #f3f4f6) 75%);
  background-size: 200% 100%;
  animation: skeleton-load 1.4s infinite;
  border-radius: 8px;
}
@keyframes skeleton-load {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
