:root {
  --gold:        #C9A84C;
  --gold-light:  #E8D5A3;
  --gold-dim:    rgba(201,168,76,0.15);
  --bg:          #0a0a0a;
  --surface:     #111111;
  --surface-2:   #171717;
  --border:      rgba(201,168,76,0.18);
  --text:        #f0ece4;
  --text-muted:  #7a7570;
  --serif:       'Cormorant Garamond', Georgia, serif;
  --sans:        'Jost', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }

/* ─── Grain overlay ─────────────────────────── */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ─── Gold line top ─────────────────────────── */
.top-line { height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); width: 100%; }

/* ─── Layout ────────────────────────────────── */
.page { position: relative; z-index: 1; max-width: 780px; margin: 0 auto; padding: 60px 24px 80px; display: flex; flex-direction: column; align-items: center; }

/* ─── Header ────────────────────────────────── */
.logo-mark { font-family: var(--serif); font-size: 11px; font-weight: 300; letter-spacing: 6px; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; opacity: 0; animation: fadeUp 0.8s 0.1s forwards; }
h1 { font-family: var(--serif); font-size: clamp(52px, 10vw, 80px); font-weight: 300; letter-spacing: 8px; text-transform: uppercase; color: var(--text); line-height: 1; margin-bottom: 4px; opacity: 0; animation: fadeUp 0.8s 0.2s forwards; }

.ornament { display: flex; align-items: center; gap: 14px; margin: 18px 0 16px; opacity: 0; animation: fadeUp 0.8s 0.3s forwards; }
.ornament-line { height: 1px; width: 60px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament-line.r { transform: scaleX(-1); }
.ornament-diamond { width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }

.subtitle { font-family: var(--serif); font-size: 15px; font-weight: 300; font-style: italic; color: var(--gold-light); letter-spacing: 2px; opacity: 0; animation: fadeUp 0.8s 0.35s forwards; }
.description { font-size: 13px; font-weight: 300; color: var(--text-muted); line-height: 1.8; max-width: 480px; text-align: center; margin-top: 18px; opacity: 0; animation: fadeUp 0.8s 0.45s forwards; }

/* ─── Search ────────────────────────────────── */
.search-wrap { position: relative; width: 100%; max-width: 400px; margin: 36px 0 40px; opacity: 0; animation: fadeUp 0.8s 0.55s forwards; }
.search-input { width: 100%; padding: 13px 20px 13px 44px; background: var(--surface); border: 1px solid var(--border); border-radius: 2px; color: var(--text); font-family: var(--sans); font-size: 13px; font-weight: 300; letter-spacing: 1px; outline: none; transition: border-color 0.3s, box-shadow 0.3s; }
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--gold); box-shadow: 0 0 20px rgba(201,168,76,0.08); }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; pointer-events: none; transition: color 0.3s; }
.search-input:focus ~ .search-icon { color: var(--gold); }

/* ─── Cards ─────────────────────────────────── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; width: 100%; }
.card { position: relative; background: var(--surface); border: 1px solid var(--border); padding: 40px 30px 32px; display: flex; flex-direction: column; align-items: center; cursor: default; transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease; opacity: 0; animation: fadeUp 0.8s forwards; }
.card:nth-child(1) { animation-delay: 0.6s; }
.card:nth-child(2) { animation-delay: 0.75s; }

.card::before, .card::after { content: ''; position: absolute; width: 16px; height: 16px; border-color: var(--gold); border-style: solid; opacity: 0; transition: opacity 0.4s; }
.card::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.card::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.card:hover { transform: translateY(-6px); box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px rgba(201,168,76,0.06); border-color: rgba(201,168,76,0.35); }
.card:hover::before, .card:hover::after { opacity: 1; }

.card-badge { position: absolute; top: 16px; right: 16px; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); border: 1px solid var(--border); padding: 3px 8px; font-family: var(--sans); font-weight: 500; }
.category-logo { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); margin-bottom: 20px; transition: border-color 0.3s; display: block; }
.card:hover .category-logo { border-color: var(--gold); }

.card-title { font-family: var(--serif); font-size: 24px; font-weight: 400; letter-spacing: 3px; text-transform: uppercase; color: var(--text); margin-bottom: 8px; }
.card-desc { font-size: 12px; font-weight: 300; color: var(--text-muted); line-height: 1.7; text-align: center; margin-bottom: 24px; letter-spacing: 0.5px; }

/* ─── Tags ─────────────────────── */
.card-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 24px; }
.tag { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); border: 1px solid rgba(255,255,255,0.08); padding: 4px 10px; font-family: var(--sans); font-weight: 400; transition: all 0.2s; }
.tag:hover { border-color: var(--gold); color: var(--gold); cursor: default; }

/* ─── Button ─────────────────────────────────── */
.btn { display: inline-block; width: 100%; padding: 13px 0; border: 1px solid rgba(201,168,76,0.4); color: var(--gold-light); text-decoration: none; font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: 3px; text-transform: uppercase; text-align: center; transition: all 0.3s; background: transparent; margin-bottom: 20px; position: relative; overflow: hidden; }
.btn::before { content: ''; position: absolute; inset: 0; background: var(--gold-dim); transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease; }
.btn:hover::before { transform: scaleX(1); }
.btn span { position: relative; z-index: 1; }
.btn:hover { border-color: var(--gold); color: var(--gold); }

/* ─── Social ─────────────────────────────────── */
.sub-social { display: flex; justify-content: center; gap: 18px; margin-top: auto; }
.sub-social a { text-decoration: none; font-size: 18px; color: var(--text-muted); transition: all 0.3s; opacity: 0.7; }
.sub-social a:hover { opacity: 1; transform: translateY(-2px); }
.sub-social a.fb:hover  { color: #1877F2; }
.sub-social a.ig:hover  { color: #e6683c; }
.sub-social a.yt:hover  { color: #FF0000; }
.sub-social a.tt:hover  { color: #ffffff; }

/* ─── Components ─────────────────────────────── */
.no-results { display: none; color: var(--text-muted); font-size: 13px; letter-spacing: 1px; margin-top: 10px; width: 100%; text-align: center; }
.divider { width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 50px 0 36px; }

/* ─── Contact Strip ───────────── */
.contact-strip { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }
.contact-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border: 1px solid var(--border); color: var(--text-muted); text-decoration: none; font-size: 12px; font-weight: 400; letter-spacing: 2px; text-transform: uppercase; transition: all 0.3s; background: var(--surface); }
.contact-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.contact-btn i { font-size: 14px; }
.fa-line   { color: #00C300; }
.fa-whatsapp { color: #25D366; }

/* ─── Nav tabs ───────────────────────────────── */
.minimal-tabs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; }
.minimal-tabs a { color: var(--text-muted); text-decoration: none; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; transition: color 0.3s; font-weight: 400; }
.minimal-tabs a:hover { color: var(--gold); }
.separator { color: rgba(255,255,255,0.1); font-size: 10px; user-select: none; }

/* ─── Footer note ────────────────────────────── */
.footer-note { margin-top: 48px; font-size: 10px; letter-spacing: 2px; color: rgba(255,255,255,0.12); text-transform: uppercase; }

/* ─── Animations ─────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 600px) {
  .page { padding: 40px 16px 60px; }
  h1 { letter-spacing: 5px; }
  .cards-grid { grid-template-columns: 1fr; }
  .contact-strip { flex-direction: column; align-items: center; }
  .contact-btn { width: 200px; justify-content: center; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =========================================
   Darinworks Master Logo System
========================================= */
.brand-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px; /* ระยะห่างระหว่าง 2 โลโก้ (กรณีโชว์คู่) */
    margin-bottom: 25px;
    opacity: 0;
    animation: fadeUp 0.6s 0.1s forwards; /* ให้โลโก้ค่อยๆ เฟดขึ้นมาอย่างนุ่มนวล */
    min-height: 65px;
}

.brand-logo-container img {
    height: 65px; /* ปรับขนาดความสูงโลโก้ตรงนี้ที่เดียวครับ */
    width: auto;
    opacity: 0.85;
    transition: opacity 0.3s, transform 0.3s;
}

.brand-logo-container img:hover {
    opacity: 1;
    transform: scale(1.05); /* เอาเมาส์ชี้แล้วขยายขยับนิดๆ */
}

/* 1. ซ่อนโลโก้และเส้นคั่นไว้ก่อนเป็นค่าเริ่มต้น */
.logo-guitar, 
.logo-cue, 
.logo-divider {
    display: none;
}

/* 2. สั่งโชว์เมื่อหน้าเว็บเป็นหมวดกีตาร์ */
body.theme-guitar .logo-guitar {
    display: block;
}

/* 3. สั่งโชว์เมื่อหน้าเว็บเป็นหมวดไม้คิว */
body.theme-cue .logo-cue {
    display: block;
}

/* 4. สั่งโชว์คู่กันเมื่อเป็นหน้าหลัก (มีเส้นตั้งบางๆ คั่นกลางให้ดูหรูหรา) */
body.theme-main .logo-guitar,
body.theme-main .logo-cue {
    display: block;
}

body.theme-main .logo-divider {
    display: block;
    width: 1px;
    height: 45px;
    background-color: var(--border); /* ใช้สีเส้นขอบจาก Master Policy */
}
