/* ============================================================
   NariTales India — Base Styles (Luxury Dark Theme)
   Reset, Typography, Body, Scrollbar, Focus Rings
   ============================================================ */

/* === Box Sizing Reset === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === HTML === */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* === Body === */
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--surface-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* === Theme Transition === */
[data-theme] {
  transition: background-color var(--duration-slow) var(--ease-out),
              color var(--duration-slow) var(--ease-out);
}

/* === Media Reset === */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* === Form Elements Reset === */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* === Links === */
a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--text-link-hover);
}

/* === Lists === */
ul, ol {
  list-style: none;
}

/* === Typography Scale === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.2;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

h5 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

h6 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

/* === Paragraphs === */
p {
  margin-bottom: 1em;
  line-height: 1.6;
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

/* === Code === */
code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* === Selection === */
::selection {
  background-color: var(--brand-gold-muted);
  color: var(--text-primary);
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-sunken);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-gold-muted);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) var(--surface-sunken);
}

/* === Focus Rings === */
*:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 2px;
}

/* === Form Base Styles === */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="checkbox"],
input[type="radio"],
select,
textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--surface-raised);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  width: 100%;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 4px rgba(246, 226, 166, 0.12);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

input:disabled,
select:disabled,
textarea:disabled {
  background-color: var(--surface-sunken);
  color: var(--text-disabled);
  cursor: not-allowed;
}

/* === Select Dropdown === */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f6e2a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* === Textarea === */
textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-body);
}

/* === Skip to Content === */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-gold);
  color: var(--text-on-brand);
  padding: 12px 24px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 600;
  z-index: calc(var(--z-toast) + 1);
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-to-content:focus {
  top: 0;
  color: var(--text-on-brand);
}

/* === Visually Hidden (Accessibility) === */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === Theme Transition Smoothness === */
html.theme-transitioning,
html.theme-transitioning * {
  transition: background-color var(--duration-slow) var(--ease-out),
              color var(--duration-slow) var(--ease-out),
              border-color var(--duration-slow) var(--ease-out) !important;
}

/* === Print Styles === */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .mobile-header,
  .desktop-header,
  .bottom-nav,
  .back-to-top,
  .toast-container,
  .auth-modal-overlay,
  .mobile-nav-overlay,
  .filter-overlay {
    display: none !important;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}

/* === Touch Targets === */
button,
[role="button"],
a.btn,
.header-icon-btn,
.bottom-nav-item,
.thumbnail-btn,
.qty-btn,
.qty-adjust-btn,
.gallery-dot,
.tab-nav-btn,
.pagination-link,
.pagination-btn,
.filter-option,
.category-chip {
  min-height: 44px;
  min-width: 44px;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 100ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
