/* ═══════════════════════════════════════════════════════════════
 * ORTAKSISTEM E-TİCARET — LAYOUT (Grid, Header, Footer, Nav)
 * ═══════════════════════════════════════════════════════════════ */

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  z-index: var(--z-fixed);
  transition: all 0.4s var(--ease-default);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
  background: var(--bg-primary);
}

.header-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-5, 1.25rem);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--fw-extrabold);
  color: var(--text-primary);
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  box-shadow: 0 2px 8px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.3);
}

.logo span {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Header Navigasyon */
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.header-nav .nav-link {
  position: relative;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  transition: color var(--duration-normal) var(--ease-default);
  white-space: nowrap;
  text-decoration: none;
}

.header-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width var(--duration-normal) var(--ease-default);
  border-radius: var(--radius-full);
}

.header-nav .nav-link:hover {
  color: var(--text-primary);
}

.header-nav .nav-link:hover::after,
.header-nav .nav-link.active::after {
  width: calc(100% - var(--space-4));
}

.header-nav .nav-link-admin {
  color: var(--accent);
  font-size: var(--text-xs);
  opacity: 0.7;
}

.header-nav .nav-link-admin:hover {
  opacity: 1;
  background: hsla(var(--accent-h, 280), 70%, 55%, 0.1);
}

/* Hamburger butonu masaüstünde gizli */
.hamburger-btn {
  display: none !important;
  font-size: 1.5rem !important;
}

@media (max-width: 900px) {
  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: var(--space-4);
    gap: var(--space-1);
    z-index: 100;
  }

  .header-nav.open {
    display: flex;
  }

  .header-nav .nav-link {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    border-radius: var(--radius-md);
  }

  .header-nav .nav-link:hover {
    background: var(--bg-tertiary);
  }

  .hamburger-btn {
    display: flex !important;
  }
}

/* Arama */
.search-bar {
  flex: 1;
  max-width: 360px;
  min-width: 180px;
  position: relative;
  margin-left: auto;
}

.search-bar input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) 42px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  transition: all var(--duration-normal) var(--ease-default);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.search-bar input:focus {
  background: var(--bg-primary);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.15);
  outline: none;
  transform: translateY(-1px);
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: var(--text-base);
  pointer-events: none;
}

/* Header Aksiyonlar */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.header-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-bounce);
  font-size: 1.35rem;
  border: 1px solid transparent;
}

.header-btn:hover {
  background: var(--bg-primary);
  color: var(--primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.header-btn .count-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: var(--fw-bold);
  background: var(--danger);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  animation: popIn 0.3s var(--ease-spring);
}

@keyframes popIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* Tema Geçişi */
.theme-toggle {
  cursor: pointer;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── Bottom Navigation (Mobil) ──────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid var(--border-light);
  z-index: var(--z-fixed);
  display: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  max-width: var(--container-sm);
  margin: 0 auto;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: var(--fw-medium);
  transition: all var(--duration-fast) var(--ease-default);
  position: relative;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.bottom-nav-item .nav-icon { font-size: 1.35rem; }

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 var(--radius-full) var(--radius-full);
}

.bottom-nav-item .count-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  font-size: 9px;
  font-weight: var(--fw-bold);
  background: var(--danger);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .bottom-nav { display: block; }
  body.has-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)); }
  .search-bar { display: none; }
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-12) 0 var(--space-8);
  margin-top: var(--space-16);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: var(--space-8);
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.footer-brand { max-width: 320px; }
.footer-brand .logo { margin-bottom: var(--space-4); }
.footer-brand p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--lh-relaxed);
}

.footer-col h4 {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
}

.footer-col ul li {
  margin-bottom: var(--space-3);
}

.footer-col a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  transition: color var(--duration-fast) var(--ease-default);
}

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

.footer-bottom {
  max-width: var(--container-xl);
  margin: var(--space-8) auto 0;
  padding: var(--space-6) var(--space-4) 0;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .footer-brand { grid-column: span 2; max-width: 100%; }
  .footer-bottom { flex-direction: column; gap: var(--space-2); text-align: center; }
  .site-footer { margin-bottom: var(--bottom-nav-h); }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
}

/* ── Page Sections ──────────────────────────────────────────── */
.section {
  padding: var(--space-12) 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.section-header h2 {
  font-size: var(--text-2xl);
  position: relative;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
}

.section-link {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.section-link:hover { gap: var(--space-2); }

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  padding: var(--space-4) 0;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-secondary);
}

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

.breadcrumb .separator {
  font-size: var(--text-xs);
}

.breadcrumb .current {
  color: var(--text-primary);
  font-weight: var(--fw-medium);
}

/* ── Product Grid ───────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
}

/* ── Page Loading ───────────────────────────────────────────── */
.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

/* ── Fade In Animation ──────────────────────────────────────── */
.fade-in {
  animation: fadeInUp 0.5s var(--ease-default) both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
