/*
 * Web mağaza ortak tasarım katmanı: yazı tipleri, renk ve ölçü değişkenleri,
 * temel öğeler (düğme, form alanı, kart, rozet, fiyat, bildirim). Uygulama ve
 * panelle aynı renk rolleri (mobile/lib/core/theme/app_colors.dart):
 * mor = ana eylem, pembe = indirim/kupon, yeşil = başarı/teslim, mavi = bilgi/kargo.
 * Sayfa stilleri site.css (vitrin, katalog) ve shop.css'tedir (sepet, ödeme, hesap);
 * ikisi de yalnız buradaki değişkenleri ve öğeleri kullanır.
 */

/* Yazı tipleri kendi sunucumuzdan (üçüncü taraf isteği yok; SIL OFL 1.1, fonts/OFL-*.txt). */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/jakarta-latin-ext.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/jakarta-latin.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/playfair-latin-ext-700.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/playfair-latin-700.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #2a1b3d;
  --ink-soft: #5c4f6b;
  --muted: #9a90a6;
  --border: #efe8f5;
  --border-strong: #ddd2e8;
  --surface: #fbf9fd;
  --surface-2: #f5f0fa;
  --white: #ffffff;
  --purple: #7a3fd6;
  --purple-dark: #4b2291;
  --purple-soft: #f1eafd;
  --pink: #e84a8b;
  --pink-soft: #fde8f1;
  --blue: #3b7bef;
  --blue-soft: #e8f0fe;
  --green: #1fa971;
  --green-soft: #e3f6ee;
  --gold: #c9a24b;
  --gold-soft: #fbf3e0;
  --danger: #d6336c;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(42, 27, 61, 0.06);
  --shadow: 0 10px 30px -12px rgba(42, 27, 61, 0.22);
  --shadow-lg: 0 24px 60px -24px rgba(42, 27, 61, 0.35);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --container: 1200px;
  --focus: 0 0 0 3px rgba(122, 63, 214, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--purple);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-3);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 700;
}

h1 {
  font-size: clamp(26px, 3.2vw, 36px);
}

h2 {
  font-size: clamp(21px, 2.4vw, 27px);
}

h3 {
  font-size: 17px;
  font-weight: 700;
}

p {
  margin: 0 0 var(--space-3);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.stack > * + * {
  margin-top: var(--space-4);
}

/* --- Düğmeler --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--purple);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--purple-dark);
  color: var(--white);
}

.btn-secondary {
  background: var(--purple-soft);
  color: var(--purple-dark);
}

.btn-secondary:hover {
  background: #e6dbfb;
  color: var(--purple-dark);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.btn-danger {
  background: transparent;
  border-color: #f4c7d8;
  color: var(--danger);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-sm {
  min-height: 36px;
  padding: 0 var(--space-4);
  font-size: 13.5px;
}

.btn-lg {
  min-height: 52px;
  padding: 0 var(--space-6);
  font-size: 16px;
}

.link {
  color: var(--purple);
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
}

/* --- Form alanları --- */

.field {
  display: block;
  margin-bottom: var(--space-4);
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 700;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.field-error {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: var(--focus);
}

.input[aria-invalid='true'],
.select[aria-invalid='true'],
.textarea[aria-invalid='true'] {
  border-color: var(--danger);
}

.check {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  font-size: 14px;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--purple);
}

/* --- Kart, rozet, fiyat --- */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.card-soft {
  background: var(--surface);
  border-color: transparent;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  background: var(--surface-2);
  color: var(--ink-soft);
}

.badge-sale {
  background: var(--pink);
  color: var(--white);
}

.badge-new {
  background: var(--purple-soft);
  color: var(--purple-dark);
}

.badge-success {
  background: var(--green-soft);
  color: #137a51;
}

.badge-info {
  background: var(--blue-soft);
  color: #2658b8;
}

.badge-warn {
  background: var(--gold-soft);
  color: #8a6a1f;
}

.price {
  font-weight: 800;
  color: var(--ink);
}

.price-sale {
  color: var(--pink);
}

.price-old {
  margin-left: 6px;
  font-weight: 500;
  font-size: 0.85em;
  /* --muted beyaz üzerinde ~3:1 ile AA'yı geçmiyor; üstü çizili eski fiyat
     her kartta göründüğü için kendi daha koyu tonuyla okunur (≈5.2:1). */
  color: #726a7e;
  text-decoration: line-through;
}

/* --- Bildirimler --- */

.alert,
.flash {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
}

.alert-info,
.flash-info {
  background: var(--blue-soft);
  color: #2658b8;
}

.alert-success,
.flash-success {
  background: var(--green-soft);
  color: #137a51;
}

.alert-error,
.flash-error {
  background: var(--pink-soft);
  color: #b3245e;
}

.alert-warn {
  background: var(--gold-soft);
  color: #8a6a1f;
}

.flash {
  max-width: var(--container);
  margin: var(--space-4) auto 0;
}

.notice-page {
  max-width: 560px;
  margin: var(--space-8) auto;
  padding: 0 var(--space-4);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
