/* ==========================================================================
   TNS RACKET SPORTS - MASTER DESIGN SYSTEM
   Theme: Luxury Dark (Black, Brushed Gold, Emerald Green)
   Font: Kanit (ใช้ฟอนต์เดียวทั้งเว็บ ทั้งหัวข้อ เนื้อหา และตัวเลข)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  /* Color Palette */
  --bg-main: #070908;
  --bg-surface: #0f1411;
  --bg-card: #151b18;
  --bg-card-hover: #1c2420;
  --bg-glass: rgba(15, 20, 17, 0.85);

  /* Gold Trim Accents */
  --gold-primary: #d4af37;
  --gold-light: #f7e7a0;
  --gold-dark: #997a15;
  --gold-gradient: linear-gradient(135deg, #f7e7a0 0%, #d4af37 50%, #8a6c10 100%);
  --gold-glow: rgba(212, 175, 55, 0.25);

  /* Emerald Green Trim Accents */
  --green-primary: #10b981;
  --green-bright: #00ff88;
  --green-dark: #047857;
  --green-glow: rgba(16, 185, 129, 0.25);
  --green-gradient: linear-gradient(135deg, #00ff88 0%, #10b981 100%);

  /* Text & Border Colors */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-gold: #f3e5ab;
  --border-dark: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(212, 175, 55, 0.4);
  --border-green: rgba(16, 185, 129, 0.4);

  /* Box Shadows & Effects */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-gold: 0 8px 30px rgba(212, 175, 55, 0.15);
  --shadow-green: 0 8px 30px rgba(16, 185, 129, 0.2);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

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

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

.text-gold-gradient {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-green-gradient {
  background: var(--green-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Text alignment utilities (ถูกใช้ใน HTML หลายหน้าแต่เดิมไม่เคยประกาศไว้) */
.text-center { text-align: center; }
.text-start  { text-align: left; }
.text-end    { text-align: right; }

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Grid System */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ช่วง 641-1024px กริดเหลือ 2 คอลัมน์ ถ้าจำนวนการ์ดเป็นเลขคี่
   ใบสุดท้ายจะค้างชิดซ้ายเหลือช่องว่างข้างเดียว จับมาไว้กึ่งกลางแทน
   (:last-child:nth-child(odd) = ใบสุดท้ายอยู่ลำดับคี่ แปลว่าจำนวนรวมเป็นคี่) */
@media (min-width: 641px) and (max-width: 1024px) {
  .grid.grid-cols-3 > :last-child:nth-child(odd),
  .grid.grid-cols-4 > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 0.75rem);   /* กว้างเท่าคอลัมน์ปกติ (หักครึ่งหนึ่งของ gap 1.5rem) */
  }
}

@media (max-width: 640px) {
  .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: repeat(1, 1fr); }
}

/* Badges & Chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-gold {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
}

.badge-green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green-bright);
  border: 1px solid var(--border-green);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.btn-gold {
  background: var(--gold-gradient);
  color: #070908;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
  filter: brightness(1.1);
}

.btn-green {
  background: var(--green-gradient);
  color: #070908;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-green:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
  filter: brightness(1.1);
}

.btn-outline-gold {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid var(--gold-primary);
}

.btn-outline-gold:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-light);
}

.btn-outline-green {
  background: transparent;
  color: var(--green-bright);
  border: 1px solid var(--green-primary);
}

.btn-outline-green:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--green-bright);
}

/* Section Titles */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: 2.5rem;
  margin-top: 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0.75rem auto 0;
  font-size: 1.05rem;
}

@media (max-width: 768px) {
  .section-title { font-size: 1.85rem; }
}
