/*
Theme Name: Game Vault
Theme URI: https://example.com/game-vault
Author: Game Vault Dev
Description: A dark, modern Game Account Marketplace theme.
Version: 1.0.0
Text Domain: game-vault
*/

/* === Reset & Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0d0f12;
  --bg-card: #161a21;
  --bg-card-hover: #1c2029;
  --bg-header: rgba(13, 15, 18, .92);
  --accent: #6c5ce7;
  --accent-hover: #7f6fef;
  --green: #00e676;
  --red: #ff5252;
  --text: #e4e6ea;
  --text-muted: #8b8fa3;
  --border: rgba(255, 255, 255, .06);
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, .4);
  --transition: .25s ease;
  --max-w: 1280px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === Layout === */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.site-main {
  flex: 1;
  padding: 40px 0;
}

/* === Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.5px;
}

.site-logo span {
  color: var(--accent);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
}

.site-nav a {
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

/* === Page Header === */
.page-header {
  text-align: center;
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* === Tag Filter === */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
}

.tag-filter a {
  padding: 7px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}

.tag-filter a:hover,
.tag-filter a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* === Account Grid === */
.account-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .account-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .account-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}

/* === Account Card === */
.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.account-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.account-card__img {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.account-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.account-card:hover .account-card__img img {
  transform: scale(1.06);
}

.account-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.badge--in-stock {
  background: rgba(0, 230, 118, .15);
  color: var(--green);
}

.badge--sold-out {
  background: rgba(255, 82, 82, .15);
  color: var(--red);
}

.account-card__body {
  padding: 16px;
}

.account-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.account-card__desc {
  font-size: .82rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  line-height: 1.5;
}

.account-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.account-card__tags a {
  font-size: .72rem;
  padding: 3px 10px;
  background: rgba(108, 92, 231, .12);
  color: var(--accent);
  border-radius: 100px;
  font-weight: 500;
  transition: background var(--transition);
}

.account-card__tags a:hover {
  background: rgba(108, 92, 231, .25);
}

.account-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-card__prices {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-card__price {
  font-weight: 800;
  line-height: 1.2;
}

.account-card__price--mmk {
  font-size: 1rem;
  color: var(--accent);
}

.account-card__price--thb {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* === Single Account === */
.single-account {
  max-width: 900px;
  margin: 0 auto;
}

.single-account__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.single-account__header-left {
  flex: 1;
  min-width: 0;
}

.single-account__header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Override contact bar style when inside header */
.single-account__header-right .gv-contact-bar {
  margin-top: 0;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: nowrap;
}

@media (max-width: 768px) {

  /* Single account: stack header vertically on mobile */
  .single-account__header {
    flex-direction: column;
    gap: 16px;
  }

  .single-account__header-right {
    width: 100%;
  }

  /* Contact bar: label on its own line, buttons fill width */
  .single-account__header-right .gv-contact-bar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
  }

  .single-account__header-right .gv-contact-bar__label {
    width: 100%;
    margin-right: 0;
    margin-bottom: 4px;
  }

  /* Smaller buttons on mobile */
  .gv-contact-btn {
    padding: 8px 14px;
    font-size: .82rem;
    flex: 1;
    justify-content: center;
    min-width: 100px;
  }

  /* Smaller title on mobile */
  .single-account__title {
    font-size: 1.4rem;
  }

  /* Bigger nav tap targets in gallery */
  .gallery-slider__nav {
    width: 36px;
    height: 36px;
  }
}

.single-account__title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.single-account__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.single-account__price {
  font-weight: 800;
}

.single-account__price--mmk {
  font-size: 1.4rem;
  color: var(--accent);
}

.single-account__price--thb {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.single-account__prices {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Gallery Slider */
.gallery-slider {
  position: relative;
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.gallery-slider__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery-slider__track::-webkit-scrollbar {
  display: none;
}

.gallery-slider__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.gallery-slider__slide img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.gallery-slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 2;
}

.gallery-slider__nav:hover {
  background: var(--accent);
}

.gallery-slider__nav--prev {
  left: 12px;
}

.gallery-slider__nav--next {
  right: 12px;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  padding-bottom: 4px;
}

.gallery-thumbs img {
  width: 80px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: .5;
  border: 2px solid transparent;
  transition: opacity var(--transition), border-color var(--transition);
}

.gallery-thumbs img:hover,
.gallery-thumbs img.active {
  opacity: 1;
  border-color: var(--accent);
}

/* Single Content */
.single-account__content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
  font-size: .95rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.single-account__content h2,
.single-account__content h3 {
  color: var(--text);
  margin-bottom: 12px;
}

.single-account__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.single-account__tags a {
  padding: 6px 16px;
  background: rgba(108, 92, 231, .12);
  color: var(--accent);
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 500;
  transition: background var(--transition);
}

.single-account__tags a:hover {
  background: rgba(108, 92, 231, .25);
}

/* === Contact Buttons Bar === */
.gv-contact-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.gv-contact-bar__label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-right: 4px;
}

.gv-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: .88rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.gv-contact-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.gv-contact-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  filter: brightness(1.1);
  color: #fff;
}

.gv-contact-btn--facebook {
  background: #1877f2;
}

.gv-contact-btn--messenger {
  background: linear-gradient(135deg, #a134fa, #0095f6);
}

.gv-contact-btn--telegram {
  background: #2aabee;
}


/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--text);
}

.pagination .current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* === No Results === */
.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* === Footer === */
.site-footer {
  text-align: center;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .82rem;
}

/* === Utility === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* === Search Bar === */
.gv-search-bar {
  margin-bottom: 28px;
}

.gv-search-bar__inner {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 6px 6px 18px;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.gv-search-bar__inner:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, .15);
}

.gv-search-bar__icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.gv-search-bar__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .9rem;
  font-family: var(--font);
}

.gv-search-bar__input::placeholder {
  color: var(--text-muted);
}

.gv-search-bar__btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 8px 22px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--transition);
  white-space: nowrap;
}

.gv-search-bar__btn:hover {
  background: var(--accent-hover);
}

/* === Mobile Nav Toggle === */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
  }

  .site-nav.open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 20px;
  }

  .site-nav.open ul {
    flex-direction: column;
    gap: 16px;
  }
}