/* 
 * Natniti Store - Main Style (Minimal & Premium)
 * Font: Noto Sans Lao Looped
 */

.spin {
    animation: spin-anim 1s linear infinite;
}
@keyframes spin-anim {
    100% { transform: rotate(360deg); }
}

:root {
  --primary: #c62828;
  --primary-hover: #b71c1c;
  --primary-light: #fff0f0;
  --primary-border: #ffcdd2;
  
  --ink: #0d0d0d;
  --ink-secondary: #555;
  --ink-muted: #999;
  --ink-danger: #e11d48;
  --ink-success: #10b981;
  --ink-warning: #f59e0b;
  
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e9ecef;
  
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 20px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);

  --nav-height: 64px;
  --bottom-nav-height: 70px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body, button, input, select, textarea {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans Lao Looped', 'Plus Jakarta Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100vh;
  line-height: 1.6;
}

/* --- Premium UI Tokens & Glassmorphism --- */
:root {
  --glass: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.12);
  --primary-rgb: 198, 40, 40;
}

/* --- Premium Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.ani-fade-up { animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.ani-scale-in { animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.ani-slide-right { animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.ani-slide-left { animation: slideInLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards; }

/* Staggered Helpers */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* --- Page Transition Animation --- */
main {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:active {
  transform: scale(0.96);
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px;
}

@media (max-width: 768px) {
  .container {
    padding: 20px 16px;
  }
}

/* --- Top Navbar --- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent; /* ຮັບປະກັນວ່າບໍ່ມີພື້ນຫຼັງ / Transparent background */
}

.logo-box img {
    height: 100%;
    width: auto;
    object-fit: contain; /* ປ້ອງກັນບໍ່ໃຫ້ຮູບຖືກຕັດ / No cropping */
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-links a:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink);
}

.nav-links a.active {
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary-border);
}

/* --- Auth Buttons --- */
.auth-buttons {
  display: flex;
  gap: 12px;
}

/* Mobile auth buttons (hidden on desktop) */
.auth-buttons-mobile {
  display: none;
  align-items: center;
  gap: 8px;
}

.mobile-auth-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--ink-secondary);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
}

.mobile-auth-btn i { width: 16px; height: 16px; flex-shrink: 0; }

.mobile-auth-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.mobile-auth-btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(198, 40, 40, 0.25);
}

.mobile-auth-btn.primary:hover {
  background: var(--primary-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
  border: none;
}

.btn i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(198, 40, 40, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink);
}

/* --- User Profile & Dropdown --- */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 100px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s;
}

.user-balance:hover {
  border-color: var(--ink-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  flex-shrink: 0;
}

#nav-balance {
  font-family: 'DM Mono', monospace;
  font-weight: 600;
}

.user-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px 4px 4px;
  border-radius: 100px;
  cursor: pointer;
}

.avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary), #ff7675);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    overflow: hidden;
    z-index: 1050;
}

.user-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px;
    background: #fbfbfb;
}

.dd-name {
    font-weight: 700;
    font-size: 14px;
}

.dd-phone {
    font-size: 12px;
    color: var(--ink-muted);
}

.dd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--ink-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.dd-item:hover {
    background: var(--bg);
    color: var(--primary);
}

.dd-item i { width: 18px; height: 18px; flex-shrink: 0; }

.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

.dd-item.logout { color: var(--primary); border: none; background: none; width: 100%; text-align: left; cursor: pointer; font-family: inherit; font-size: 14px; }

/* --- Bottom Navigation (Mobile) --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  height: var(--bottom-nav-height);
  display: none;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--ink-muted);
  transition: all 0.2s;
  flex: 1;
}

.nav-item i { width: 22px; height: 22px; flex-shrink: 0; }
.nav-item span { font-size: 10px; font-weight: 600; }

.nav-item.active {
  color: var(--primary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .top-nav { height: 60px; }
  .nav-links { display: none; }
  .nav-container { padding: 0 16px; }
  .bottom-nav { display: block; }
  body { padding-bottom: var(--bottom-nav-height); }
  .desktop-auth { display: none; }
  .auth-buttons-mobile { display: flex; }
  .user-name { display: none; }
}

/* --- Page Components (Common) --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.section-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    display: block;
}

h1, h2, h3 {
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* --- Global Modern Input --- */
.modern-input {
    width: 100%;
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    outline: none;
    transition: all 0.25s;
    color: var(--ink);
}

.modern-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.06);
}

.modern-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modern-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.modern-input-wrapper i,
.modern-input-wrapper svg,
.modern-input-wrapper [data-lucide] {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--ink-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.modern-input-wrapper .modern-input {
    padding-left: 42px;
    width: 100%;
}

/* --- Password Toggle Group --- */
.password-group {
    display: flex;
    gap: 8px;
}

.password-group .modern-input-wrapper {
    flex: 1;
}

.password-toggle {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--ink-muted);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.password-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.05);
}

.password-toggle i, 
.password-toggle svg,
.password-toggle [data-lucide] {
    width: 20px;
    height: 20px;
}

.input-hint {
    font-size: 11px;
    color: var(--ink-muted);
    margin-top: 6px;
}

.required-mark {
    color: var(--primary);
    margin-left: 3px;
    font-weight: 800;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 32px 20px 24px;
    font-size: 12px;
    color: var(--ink-muted);
    border-top: 1px solid var(--border);
    margin-top: 48px;
    letter-spacing: 0.3px;
}

/* --- Global Modal System --- */
@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.9) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes modalBgEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.app-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.app-modal-overlay.show {
    display: flex;
    animation: modalBgEnter 0.25s ease-out;
}

.app-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 100%;
    padding: 36px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: modalEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
}

.app-modal-icon i {
    width: 28px;
    height: 28px;
}

.app-modal-icon.success { background: #f0fdf4; color: #22c55e; }
.app-modal-icon.error { background: #fef2f2; color: #ef4444; }
.app-modal-icon.warning { background: #fffbeb; color: #f59e0b; }
.app-modal-icon.info { background: #eff6ff; color: #3b82f6; }

.app-modal h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.app-modal p {
    font-size: 14px;
    color: var(--ink-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

.app-modal-actions {
    display: flex;
    gap: 12px;
}

.app-modal-actions .btn {
    flex: 1;
    padding: 12px 20px;
}

/* --- Hidden Utility --- */
.hidden { display: none !important; }

/* --- Mono Text (Removed font override to use default Noto Sans Lao Looped) --- */
.mono { font-weight: 600; }

/* --- Full Width Utility --- */
.w-full { width: 100%; }

/* --- Scrollbar Polish --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }
