/* ============================================
   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: var(--bg);   /* solid — farkli zeminlerde yazilar her zaman okunur */
  box-shadow: var(--shadow-sm);
}
.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);
}
/* Hamburger açık durumda "X" */
.nav-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Auth linkleri: masaüstünde üst barda inline, mobilde hamburger menüsünün içinde */
.nav-auth-mobile { display: none; }   /* yalnız mobilde görünür (responsive bloğu) */

/* ---- Cart Button (public navbar — ikon buton) ---- */
.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: var(--transition);
}
.nav-cart:hover { color: var(--text); background-color: var(--bg-alt); }
.nav-cart [data-cart-count] {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
}

/* Navbar ikon butonlarinda SVG'leri ortala */
.theme-toggle svg, .nav-cart svg { display: block; }

/* 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;
}

/* ---- Beta + sürüm rozeti: sol üst köşeye sabit (inc/navbar.php) ---- */
.beta-corner {
  position: fixed; top: 0; left: 0; z-index: 1200;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--bg); background: var(--text);
  padding: 5px 12px 6px; line-height: 1; white-space: nowrap;
  border-radius: 0 0 var(--radius-sm) 0;   /* yalnız sağ-alt köşe yuvarlak → köşe şeridi */
  box-shadow: var(--shadow);
}
.beta-corner span { font-weight: 600; letter-spacing: 0; text-transform: none; opacity: 0.7; }
.beta-corner:hover { opacity: 0.9; }
@media (max-width: 600px) { .beta-corner span { display: none; } }

/* ---- Paylasilan site footer (inc/footer.php) ----
   Selektorler `.footer` ile kapsamlanip specificity artirildi; boylece
   eski sayfa-ici inline footer stillerini (dusuk specificity) override eder. */
.footer .footer-grid-modern {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
.footer .footer-col h5 { font-size: 1rem; margin-bottom: 24px; color: var(--text-faint); }
.footer .footer-col ul { display: flex; flex-direction: column; gap: 16px; }
.footer .footer-col a { font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.footer .footer-col a:hover { color: var(--text); }
.footer .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;
}
@media (max-width: 1024px) {
  .footer .footer-grid-modern { grid-template-columns: repeat(2, 1fr); gap: 40px; }
  .footer .footer-grid-modern > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .footer .footer-grid-modern { grid-template-columns: 1fr; gap: 32px; }
  .footer .footer-grid-modern > div:first-child { grid-column: auto; }
  .footer .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
}

/* ---- Navbar kullanici adi (auth durumuna gore) ---- */
.nav-user {
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: 0.875rem; font-weight: 600; color: var(--text); letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ---- Toasts (Ceremono.toast) ---- */
.toast-stack { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.ctoast {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-left: 3px solid var(--text);
  border-radius: var(--radius-sm); padding: 14px 16px;
  box-shadow: var(--shadow-lg); font-size: 0.9rem;
  transform: translateX(120%); opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), opacity 0.35s;
}
.ctoast.show { transform: translateX(0); opacity: 1; }
.ctoast.success { border-left-color: #10b981; }
.ctoast.error { border-left-color: #ef4444; }
.ctoast.info { border-left-color: var(--text-muted); }
.ctoast-icon { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: #fff; margin-top: 1px; }
.ctoast.success .ctoast-icon { background: #10b981; }
.ctoast.error .ctoast-icon { background: #ef4444; }
.ctoast.info .ctoast-icon { background: var(--text-muted); }
.ctoast-msg { flex: 1; line-height: 1.45; }
.ctoast-close { cursor: pointer; color: var(--text-faint); background: none; border: none; font-size: 1.15rem; line-height: 1; padding: 0; }
.ctoast-close:hover { color: var(--text); }

/* ---- Confirm / Alert dialog (Ceremono.confirm / .alert) ---- */
.cdlg-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity 0.2s ease; }
.cdlg-overlay.show { opacity: 1; }
.cdlg { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); max-width: 420px; width: 100%; padding: 28px; box-shadow: var(--shadow-lg); transform: translateY(10px) scale(0.98); transition: transform 0.25s cubic-bezier(0.16,1,0.3,1); }
.cdlg-overlay.show .cdlg { transform: none; }
.cdlg-title { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
.cdlg-msg { color: var(--text-muted); line-height: 1.55; margin-bottom: 16px; }
.cdlg-input { width: 100%; margin-bottom: 22px; padding: 12px 14px; font-size: 0.9375rem; }
.cdlg-actions { display: flex; justify-content: flex-end; gap: 10px; }
.cdlg-ok:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Checkout modal (Ceremono.checkout) ---- */
.co-ov { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity 0.2s ease; }
.co-ov.show { opacity: 1; }
.co { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); max-width: 420px; width: 100%; padding: 28px; box-shadow: var(--shadow-lg); transform: translateY(10px) scale(0.98); transition: transform 0.25s cubic-bezier(0.16,1,0.3,1); }
.co-ov.show .co { transform: none; }
.co-title { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.co-sub { color: var(--text-muted); font-size: 0.875rem; margin-top: 4px; }
.co-amt { font-size: 2rem; font-weight: 800; margin: 16px 0; letter-spacing: -0.02em; }
.co-methods-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); font-weight: 600; margin-bottom: 8px; }
.co-methods { display: flex; flex-direction: column; gap: 8px; }
.co-method { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.co-method:hover { border-color: var(--text-muted); }
.co-method input { accent-color: var(--text); }
.co-method.disabled { opacity: 0.5; cursor: not-allowed; }
.co-method-main { font-size: 0.9375rem; font-weight: 500; }
.co-method-note { margin-left: auto; font-size: 0.75rem; color: var(--text-faint); }
.co-msg { background: var(--bg-alt); border-left: 3px solid #ef4444; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.8125rem; margin-top: 16px; color: var(--text); }
.co-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.co-pay:disabled { opacity: 0.4; cursor: not-allowed; }
.co-success { text-align: center; padding: 12px 0; }
.co-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 1.75rem; margin: 0 auto 16px; }
.co-success .co-title { margin-bottom: 6px; }
.co-success .co-sub { margin-bottom: 20px; }

/* ---- 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: clamp(2.25rem, 9vw, 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: 72px 0; }
  .section-sm { padding: 56px 0; }
  /* Mobilde üst bardaki inline auth gizlenir; menüye taşınır */
  .nav-auth-inline { display: none; }
  .nav-auth-mobile {
    display: flex; flex-direction: column; gap: 12px; width: 100%;
    margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--border);
  }
  .nav-auth-mobile .btn,
  .nav-auth-mobile .nav-user { width: 100%; justify-content: center; }
  .nav-auth-mobile .nav-user { padding: 10px 14px; }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .btn-lg { padding: 15px 28px; font-size: 1rem; }
}

/* Mobile Nav Open */
.nav-links.open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background-color: var(--bg);
  padding: 28px 24px 32px;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  gap: 22px;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}

/* 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; }
