/* ============================================================
   güvenliSat — Global Stylesheet
   ============================================================ */

:root {
  /* Colors */
  --primary: #00D4AA;
  --primary-dark: #00B892;
  --primary-light: rgba(0, 212, 170, 0.1);
  --accent: #FF6B35;
  --accent-dark: #E55320;

  /* Dark theme */
  --bg-0: #0A0E1A;
  --bg-1: #111827;
  --bg-2: #1A2235;
  --bg-3: #232D42;
  --bg-card: #141929;

  /* Text */
  --text-0: #FFFFFF;
  --text-1: rgba(255, 255, 255, 0.85);
  --text-2: rgba(255, 255, 255, 0.55);
  --text-3: rgba(255, 255, 255, 0.35);

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(0, 212, 170, 0.3);

  /* Status */
  --success: #00D4AA;
  --warning: #FF9F0A;
  --danger: #FF3B30;

  /* Layout */
  --container: 1280px;
  --nav-h: 72px;

  /* Shadows */
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --glow: 0 0 40px rgba(0, 212, 170, 0.15);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* Typography */
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

/* ── LIGHT THEME ─────────────────────────────────────────── */
[data-theme="light"] {
  --primary: #009E7A;
  --primary-dark: #008568;
  --primary-light: rgba(0, 158, 122, 0.1);

  --bg-0: #F5F7FA;
  --bg-1: #ECEEF3;
  --bg-2: #E0E3EB;
  --bg-3: #D2D6E0;
  --bg-card: #FFFFFF;

  --text-0: #0D1117;
  --text-1: rgba(13, 17, 23, 0.87);
  --text-2: rgba(13, 17, 23, 0.56);
  --text-3: rgba(13, 17, 23, 0.38);

  --border: rgba(0, 0, 0, 0.09);
  --border-hover: rgba(0, 158, 122, 0.4);

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10), 0 24px 64px rgba(0, 0, 0, 0.10);
  --glow: 0 0 32px rgba(0, 158, 122, 0.12);
}

/* System preference — applied before JS hydration */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) {
    --primary: #009E7A;
    --primary-dark: #008568;
    --primary-light: rgba(0, 158, 122, 0.1);
    --bg-0: #F5F7FA;
    --bg-1: #ECEEF3;
    --bg-2: #E0E3EB;
    --bg-3: #D2D6E0;
    --bg-card: #FFFFFF;
    --text-0: #0D1117;
    --text-1: rgba(13, 17, 23, 0.87);
    --text-2: rgba(13, 17, 23, 0.56);
    --text-3: rgba(13, 17, 23, 0.38);
    --border: rgba(0, 0, 0, 0.09);
    --border-hover: rgba(0, 158, 122, 0.4);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 12px 40px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10), 0 24px 64px rgba(0, 0, 0, 0.10);
    --glow: 0 0 32px rgba(0, 158, 122, 0.12);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text-1);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- CONTAINER ---- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- TYPOGRAPHY ---- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--text-0);
  line-height: 1.2;
}

.gradient-text {
  background: linear-gradient(135deg, #00D4AA 0%, #00A8FF 50%, #7B61FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: var(--bg-0);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: var(--r-md);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 158, 122, 0.3);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-1);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--r-md);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

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

/* ---- HEADER / NAV ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg-0) 88%, transparent);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, box-shadow 0.3s;
}

.header.scrolled {
  background: color-mix(in srgb, var(--bg-0) 98%, transparent);
  box-shadow: var(--shadow-sm);
}

/* Theme toggle button */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-2);
  color: var(--text-1);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

[data-theme="light"] .theme-icon-dark {
  display: none;
}

[data-theme="light"] .theme-icon-light {
  display: block;
}

.theme-icon-dark {
  display: block;
}

.theme-icon-light {
  display: none;
}

.nav {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  gap: 24px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-0);
  flex-shrink: 0;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-accent {
  color: var(--primary);
}

/* Nav Search */
.nav-search {
  flex: 1;
  max-width: 500px;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search svg {
  position: absolute;
  left: 14px;
  color: var(--text-3);
}

.nav-search input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-1);
  outline: none;
  transition: all 0.2s;
}

.nav-search input::placeholder {
  color: var(--text-3);
}

.nav-search input:focus {
  border-color: var(--primary);
  background: var(--bg-3);
}

.nav-search button {
  position: absolute;
  right: 8px;
  background: var(--primary);
  color: var(--bg-0);
  border: none;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.nav-search button:hover {
  background: var(--primary-dark);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--r-sm);
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--text-0);
  background: var(--bg-2);
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-1);
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  color: var(--text-1);
  text-decoration: none;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  transition: background 0.2s;
}

.mobile-menu a:hover {
  background: var(--bg-2);
}

.btn-primary-full {
  background: var(--primary);
  color: var(--bg-0) !important;
  font-weight: 600;
  text-align: center;
  border-radius: var(--r-md) !important;
  margin-top: 8px;
}

/* ---- SECTIONS ---- */
.section {
  padding: 80px 0;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 20px;
}

.section-header.centered {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--text-0);
}

.section-sub {
  color: var(--text-2);
  margin-top: 8px;
  font-size: 0.95rem;
}

.see-all {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 4px;
  transition: opacity 0.2s;
}

.see-all:hover {
  opacity: 0.75;
}

/* ---- PRODUCT CARDS ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--glow), var(--shadow-md);
}

.product-img {
  height: 190px;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-condition {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(17, 24, 39, 0.9);
  color: var(--text-1);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.badge-safe {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 212, 170, 0.15);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(0, 212, 170, 0.3);
  backdrop-filter: blur(8px);
}

.product-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 8px;
  line-height: 1.4;
}

.product-price {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.product-ai-price {
  font-size: 0.72rem;
  color: var(--text-2);
  margin-bottom: 12px;
  font-family: var(--font-body);
  font-weight: 400;
}

.product-ai-price.under {
  color: #34D399;
}

.product-ai-price.over {
  color: var(--warning);
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.product-location {
  font-size: 0.75rem;
  color: var(--text-2);
}

.product-rating {
  font-size: 0.75rem;
  color: var(--text-2);
}

.product-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.card-btn {
  flex: 1;
  padding: 8px;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-btn-primary {
  background: var(--primary);
  color: var(--bg-0);
}

.card-btn-primary:hover {
  background: var(--primary-dark);
}

.card-btn-ghost {
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}

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

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--bg-3);
  color: var(--text-0);
  border: 1px solid var(--border);
  padding: 14px 22px;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9999;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ---- FOOTER ---- */
.footer {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  padding: 60px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand p {
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.7;
  margin-top: 16px;
  max-width: 280px;
}

.footer-logo {
  margin-bottom: 0;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.footer-social a:hover {
  border-color: var(--border-hover);
  background: var(--bg-3);
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.footer-col a {
  display: block;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-3);
}

.footer-legal {
  display: flex;
  gap: 20px;
}

.footer-legal a {
  font-size: 0.8rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-legal a:hover {
  color: var(--text-2);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .nav-search {
    max-width: 320px;
  }
}

@media (max-width: 768px) {

  .nav-search,
  .nav-actions {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .section {
    padding: 56px 0;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .footer-grid {
    grid-template-columns: 1fr;
  }
}