/* ============================================
   CEREMONO — Minimalist Design System
   Strict Light / Dark Theme Support
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ---- LIGHT THEME (default) ---- */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f5;
  --text: #171717;
  --text-muted: #525252;
  --text-faint: #a3a3a3;
  --border: #e5e5e5;
  --border-focus: #171717;
  
  --primary: #000000; /* Strict monochrome primary */
  --primary-invert: #ffffff;
  --accent: #000000;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.2s ease;
  --font: 'Outfit', sans-serif;
  --nav-h: 80px;
}

/* ---- DARK THEME ---- */
[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-alt: #171717;
  --text: #ededed;
  --text-muted: #a3a3a3;
  --text-faint: #525252;
  --border: #262626;
  --border-focus: #ededed;
  
  --primary: #ffffff;
  --primary-invert: #000000;
  --accent: #ffffff;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Universal Theme Transition */
body, body * {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
img { max-width: 100%; display: block; height: auto; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
input, textarea, select { font-family: var(--font); outline: none; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.1; color: var(--text); letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h4 { font-size: 1.25rem; }
p { color: var(--text-muted); font-size: 1.125rem; }

.text-accent { color: var(--accent); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }

.section-label {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-sm { max-width: 800px; }

.section { padding: 120px 0; }
.section-sm { padding: 80px 0; }
.section-alt { background-color: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.gap-48 { gap: 48px; }

.text-center { text-align: center; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
  text-align: center;
  white-space: nowrap;
}
.btn-primary {
  background-color: var(--primary);
  color: var(--primary-invert);
  border: 1px solid var(--primary);
}
.btn-primary:hover {
  background-color: transparent;
  color: var(--primary);
}
.btn-outline {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
}
.btn-ghost {
  color: var(--text-muted);
  padding: 10px 20px;
}
.btn-ghost:hover {
  color: var(--text);
  background-color: var(--bg-alt);
}
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-lg { padding: 18px 40px; font-size: 1.125rem; }

/* ---- Forms ---- */
.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.form-label { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.form-control {
  background-color: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
  width: 100%;
}
.form-control:focus {
  border-color: var(--primary);
}
.form-control::placeholder { color: var(--text-faint); }
textarea.form-control { resize: vertical; min-height: 120px; }

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background-color: var(--bg);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}
.navbar.scrolled {
  border-bottom-color: var(--border);
  background-color: rgba(var(--bg), 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.nav-links { display: flex; gap: 32px; }
.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
}
.nav-link:hover, .nav-link.active { color: var(--text); }

.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: var(--transition);
}
.theme-toggle:hover { color: var(--text); background-color: var(--bg-alt); }
.theme-toggle .icon-sun { display: inline; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 24px;
  cursor: pointer;
}
.nav-toggle span {
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---- Cart Button (used in public navbar + logged-in sidebar) ---- */
.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-cart:hover { border-color: var(--text); }
.nav-cart [data-cart-count] {
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.6875rem;
  font-weight: 700;
}

/* Sidebar Store link with cart count badge */
.sidebar-link.has-badge {
  justify-content: space-between;
}
.sidebar-link [data-cart-count] {
  display: none;
  min-width: 20px;
  height: 20px;
  padding: 0 8px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---- Minimalist Cards ---- */
.card {
  padding: 40px 32px;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.card:hover {
  border-color: var(--border-focus);
}

/* ---- Footer ---- */
.footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 64px;
  margin-bottom: 64px;
}
.footer-col h5 { font-size: 1rem; margin-bottom: 24px; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { color: var(--text-muted); font-size: 0.9375rem; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.875rem;
}

/* ---- Animations ---- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.animate-in { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 32px; }
  h1 { font-size: 3rem; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
  .section { padding: 80px 0; }
}

/* Mobile Nav Open */
.nav-links.open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background-color: var(--bg);
  padding: 32px 24px;
  border-bottom: 1px solid var(--border);
  gap: 24px;
}

/* Utilities */
.w-full { width: 100%; }
.h-full { height: 100%; }
.object-cover { object-fit: cover; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 50%; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-10 { z-index: 10; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-40 { margin-bottom: 40px; }
.mt-24 { margin-top: 24px; }
