/* =========================================================
   NearMe Vinyl — Main Stylesheet
   ธีมสีน้ำเงินเข้ม + Glassmorphism + วิดีโอพื้นหลังเคลื่อนไหว
   ========================================================= */

:root {
  /* ----- Blue theme palette ----- */
  --nm-navy-950: #060b18;
  --nm-navy-900: #0a132b;
  --nm-navy-800: #0f1c3f;
  --nm-navy-700: #142a5c;
  --nm-blue-600: #1e40af;
  --nm-blue-500: #2563eb;
  --nm-blue-400: #3b82f6;
  --nm-blue-300: #60a5fa;
  --nm-cyan-400: #22d3ee;
  --nm-gold-400: #fbbf24;

  --nm-text-primary: #f4f7ff;
  --nm-text-secondary: #b9c6e6;
  --nm-text-muted: #8291b8;

  --nm-glass-bg: rgba(15, 28, 63, 0.55);
  --nm-glass-bg-strong: rgba(10, 19, 43, 0.78);
  --nm-glass-border: rgba(255, 255, 255, 0.12);
  --nm-glass-highlight: rgba(96, 165, 250, 0.18);

  --nm-radius-lg: 20px;
  --nm-radius-md: 14px;
  --nm-radius-sm: 8px;

  --nm-shadow-soft: 0 10px 40px rgba(2, 6, 20, 0.45);
  --nm-shadow-glow: 0 0 0 1px rgba(96, 165, 250, 0.25), 0 8px 30px rgba(37, 99, 235, 0.35);

  --nm-font: 'Prompt', 'Noto Sans Thai', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--nm-font);
  color: var(--nm-text-primary);
  background: var(--nm-navy-950);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--nm-blue-500); color: #fff; }

/* ---------------------------------------------------------
   Video Background
   --------------------------------------------------------- */
.nm-video-bg-wrap {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--nm-navy-950);
}

.nm-video-bg-wrap video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
}

.nm-video-bg-wrap video.nm-active {
  opacity: 1;
}

/* ---------------------------------------------------------
   Hero Image Carousel
   --------------------------------------------------------- */
.nm-hero-carousel {
  position: relative;
  width: 100%;
  height: 320px;
}

.nm-hero-carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.nm-hero-carousel img.nm-active {
  opacity: 1;
}

.nm-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 11, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  backdrop-filter: blur(4px);
  transition: background 0.2s ease;
}

.nm-carousel-arrow:hover {
  background: rgba(6, 11, 24, 0.8);
}

.nm-carousel-prev { left: 12px; }
.nm-carousel-next { right: 12px; }

.nm-carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.nm-carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.4);
  transition: background 0.2s ease, width 0.2s ease;
}

.nm-carousel-dot.nm-active {
  background: #fff;
  width: 18px;
  border-radius: 9999px;
}

/* ทำให้พื้นหลังทึบและอ่านตัวหนังสือง่ายขึ้น: gradient overlay + subtle blue tint + noise-safe */
.nm-video-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(6, 11, 24, 0.88) 0%, rgba(6, 11, 24, 0.72) 18%, rgba(8, 14, 32, 0.66) 45%, rgba(6, 11, 24, 0.85) 100%),
    radial-gradient(ellipse at top left, rgba(37, 99, 235, 0.25), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(34, 211, 238, 0.12), transparent 55%);
  backdrop-filter: blur(1.5px);
}

/* ---------------------------------------------------------
   Typography helpers
   --------------------------------------------------------- */
.nm-text-glow {
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.6);
}

.nm-gradient-text {
  background: linear-gradient(100deg, #22d3ee 0%, #67e8f9 20%, #ffffff 40%, #38bdf8 55%, #67e8f9 70%, #22d3ee 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(34, 211, 238, 0.8)) brightness(1.15);
  animation: nm-shine 3.5s ease-in-out infinite;
}

@keyframes nm-shine {
  0% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
  100% { background-position: 0% 0; }
}

.nm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--nm-cyan-400);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 6px 16px;
  border-radius: 999px;
}

/* ---------------------------------------------------------
   Glass surfaces
   --------------------------------------------------------- */
.nm-glass {
  background: var(--nm-glass-bg);
  border: 1px solid var(--nm-glass-border);
  border-radius: var(--nm-radius-lg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--nm-shadow-soft);
}

.nm-glass-strong {
  background: var(--nm-glass-bg-strong);
  border: 1px solid var(--nm-glass-border);
  border-radius: var(--nm-radius-lg);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: var(--nm-shadow-soft);
}

.nm-glass-card {
  background: var(--nm-glass-bg);
  border: 1px solid var(--nm-glass-border);
  border-radius: var(--nm-radius-md);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.nm-glass-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: var(--nm-shadow-glow);
}

/* ---------------------------------------------------------
   Header / Navbar
   --------------------------------------------------------- */
.nm-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 11, 24, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.nm-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nm-logo-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.nm-logo-img {
  height: 100px;
  width: auto;
  display: block;
}

@media (max-width: 1023px) {
  .nm-logo-img {
    height: 84px;
  }
}

.nm-logo-word {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 2px;
  line-height: 1;
}

.nm-logo-word .nm-near {
  background: linear-gradient(180deg, #e6edff, #a9c1f5 60%, #6f95e6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nm-logo-word .nm-me {
  background: linear-gradient(180deg, #7dd3fc, #38bdf8 55%, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nm-logo-word .nm-plus {
  font-size: 0.9rem;
  color: var(--nm-cyan-400);
  margin-left: 1px;
}

.nm-logo-sub {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--nm-text-muted);
  text-transform: uppercase;
  margin-top: -2px;
}

.nm-logo-badges {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.nm-badge-vinyl,
.nm-badge-led {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 5px;
}

.nm-badge-vinyl {
  background: #f5c518;
  color: #7a1f1f;
}

.nm-badge-led {
  background: #0b1430;
  background-image: linear-gradient(90deg, #f87171, #fbbf24, #4ade80, #38bdf8, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.nm-nav-link {
  font-size: 0.88rem;
  color: var(--nm-text-secondary);
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.nm-nav-link:hover,
.nm-nav-link.active {
  color: #fff;
  background: rgba(96, 165, 250, 0.14);
}

.nm-lang-switch {
  border: 1px solid var(--nm-glass-border);
  border-radius: 999px;
  padding: 3px;
}

.nm-lang-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--nm-text-secondary);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.nm-lang-link:hover {
  color: #fff;
}

.nm-lang-link.active {
  color: #fff;
  background: var(--nm-blue-500);
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.nm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color .2s ease;
  white-space: nowrap;
}

.nm-btn:active { transform: scale(0.97); }

.nm-btn-primary {
  background: linear-gradient(135deg, var(--nm-blue-500), var(--nm-cyan-400));
  color: #04101f;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

.nm-btn-primary:hover {
  box-shadow: 0 10px 30px rgba(34, 211, 238, 0.5);
  transform: translateY(-2px);
}

.nm-btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.nm-btn-outline:hover {
  border-color: var(--nm-cyan-400);
  background: rgba(34, 211, 238, 0.08);
}

.nm-btn-line {
  background: #06c755;
  color: #fff;
  box-shadow: 0 8px 22px rgba(6, 199, 85, 0.4);
}

.nm-btn-line:hover { transform: translateY(-2px); }

.nm-btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.nm-btn-block { width: 100%; }

/* ---------------------------------------------------------
   Sections / layout helpers
   --------------------------------------------------------- */
.nm-container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 20px;
}

.nm-section {
  padding-block: 72px;
}

.nm-section-head {
  max-width: 640px;
  margin-bottom: 40px;
}

.nm-h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 14px 0 18px;
}

.nm-h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 12px 0 10px;
}

.nm-lead {
  font-size: 1.05rem;
  color: var(--nm-text-secondary);
}

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */
.nm-field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--nm-text-secondary);
  margin-bottom: 6px;
}

.nm-input,
.nm-select,
.nm-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: var(--nm-radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s;
}

.nm-input::placeholder,
.nm-textarea::placeholder { color: var(--nm-text-muted); }

/* เบราว์เซอร์ส่วนใหญ่วาด dropdown ของ <select> ด้วยพื้นหลังขาวเสมอ ไม่รับ background แบบโปร่งใสของ .nm-input
   จึงต้องกำหนดสีตัวอักษร/พื้นหลังของ <option> แยกไว้ ไม่ให้ตัวอักษรสีขาวจมพื้นขาวจนอ่านไม่ออก */
select.nm-input option,
.nm-select option {
  color: #0f172a;
  background: #fff;
}

.nm-input:focus,
.nm-select:focus,
.nm-textarea:focus {
  outline: none;
  border-color: var(--nm-cyan-400);
  background: rgba(34, 211, 238, 0.06);
}

.nm-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.nm-size-chip {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nm-size-chip:hover { border-color: var(--nm-blue-400); }

.nm-size-chip.nm-selected {
  border-color: var(--nm-cyan-400);
  background: rgba(34, 211, 238, 0.12);
  box-shadow: var(--nm-shadow-glow);
}

.nm-option-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nm-option-card:hover { border-color: var(--nm-blue-400); }

.nm-option-card.nm-selected {
  border-color: var(--nm-cyan-400);
  background: rgba(34, 211, 238, 0.1);
}

/* ---------------------------------------------------------
   Sticky price summary panel
   --------------------------------------------------------- */
.nm-price-panel {
  position: sticky;
  top: 90px;
}

.nm-price-big {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--nm-cyan-400);
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.nm-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 11, 24, 0.85);
  backdrop-filter: blur(10px);
  padding-block: 48px 24px;
}

.nm-footer a:hover { color: var(--nm-cyan-400); }

/* ---------------------------------------------------------
   Misc components
   --------------------------------------------------------- */
.nm-badge-num {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(0,0,0,0.55);
  color: #fff;
  backdrop-filter: blur(4px);
}

.nm-line-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #06c755;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(6, 199, 85, 0.55);
  animation: nm-fab-pulse 2.4s ease-in-out infinite;
}

@keyframes nm-fab-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

.nm-marquee-track {
  display: flex;
  gap: 40px;
  width: max-content;
  animation: nm-marquee 28s linear infinite;
}

@keyframes nm-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.nm-fade-up {
  animation: nm-fadeUp 0.7s ease both;
}

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

/* Table price grid */
.nm-price-table th,
.nm-price-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  font-size: 0.92rem;
}

.nm-price-table th {
  color: var(--nm-text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--nm-navy-950); }
::-webkit-scrollbar-thumb { background: var(--nm-navy-700); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--nm-blue-600); }

/* Responsive tweaks */
@media (max-width: 768px) {
  .nm-section { padding-block: 48px; }
  .nm-price-panel { position: static; }
}
