/*
   Professional & Premium Design System (v2)
   Inspired by Shadcn/UI and Next.js Modern Aesthetics
*/

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

:root {
  /* Layer 1 - Background */
  --background: #ffffff;
  --foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #475569;
  
  /* Layer 2 - Surface/Card */
  --card: #ffffff;
  --card-foreground: #0f172a;
  --border: #e2e8f0;
  --input: #e2e8f0;
  
  /* Layer 3 - Accent */
  --primary: #16a34a;
  --primary-foreground: #ffffff;
  --accent: #f1f5f9;
  --accent-foreground: #0f172a;
  --secondary: #0f172a;
  --ring: var(--primary);
  
  --radius: 0.75rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2.25rem;
  --radius-2xl: 3rem;

  --font-family: 'Plus Jakarta Sans', sans-serif;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.04), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05);

  /* Soft, brand-adaptive gradients (color-mix keeps business --primary configurable) */
  --primary-gradient: linear-gradient(135deg,
    color-mix(in srgb, var(--primary) 82%, #ffffff) 0%,
    var(--primary) 55%,
    color-mix(in srgb, var(--primary) 80%, #000000) 100%);
  --primary-gradient-hover: linear-gradient(135deg,
    var(--primary) 0%,
    color-mix(in srgb, var(--primary) 78%, #000000) 100%);
  --surface-gradient: linear-gradient(180deg, var(--muted) 0%, rgba(255,255,255,0) 100%);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 0.3s var(--ease);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--foreground);
  font-weight: 500;
  line-height: 1.5;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--primary) 11%, var(--muted)) 0%,
    color-mix(in srgb, var(--primary) 7%, var(--background)) 25%,
    transparent 70%);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

a { text-decoration: none; color: inherit; transition: all var(--transition-base); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; transition: all var(--transition-base); }

/* Layout Components */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.py-20 { padding-top: 3rem; padding-bottom: 3rem; }
.mb-10 { margin-bottom: 2rem; }
.mb-6 { margin-bottom: 1.25rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }

/* Announcement Bar - Professional Style */
.announcement-bar {
  background: var(--primary);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 85%, #ffffff), var(--primary));
  color: white;
  padding: 0.45rem 0;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--primary) 55%, transparent);
}
.announcement-bar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--primary) 25%, transparent) 0%,
    transparent 100%);
  pointer-events: none;
}

/* Header - Modern Sticky */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--background) 96%, var(--primary) 4%) 0%,
    color-mix(in srgb, var(--background) 98%, var(--primary) 2%) 60%,
    rgba(255,255,255,0.94) 100%);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  box-shadow: 0 8px 24px -18px rgba(0, 0, 0, 0.22);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  filter: drop-shadow(0 1px 4px color-mix(in srgb, var(--primary) 12%, transparent));
}

nav ul { display: flex; gap: 2rem; }
nav a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted-foreground);
  position: relative;
  padding-bottom: 2px;
}
nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.25s var(--ease);
  border-radius: 1px;
}
nav a:hover, nav a.active { color: var(--primary); }
nav a:hover::after, nav a.active::after { transform: scaleX(1); transform-origin: left center; }

/* Hero Section - Clean Minimal */
.hero {
  position: relative;
  padding: 5rem 0 3.5rem;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 8%, var(--muted)) 0%, rgba(255,255,255,0) 70%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.12;
  z-index: -1;
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  max-width: 600px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.hero-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

#homepage-sections .container {
  max-width: 940px;
}
#homepage-sections .hero .container {
  max-width: 820px;
}

/* Page Header - For Subpages */
.page-header {
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--background) 94%, var(--primary) 6%) 0%,
    transparent 100%);
}

.page-header h1 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--foreground);
}

.breadcrumbs {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
}

/* Cards - Premium Style */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

/* Product Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 0.65rem;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.product-image {
  aspect-ratio: 1/1;
  background: var(--muted);
  overflow: hidden;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.discount-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  background: #ef4444;
  color: white;
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
  font-size: 0.6rem;
  font-weight: 800;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.product-content {
  padding: 0.45rem 0.55rem 0.55rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  line-height: 1.3;
  color: var(--foreground);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 1.95rem;
}

.product-price-wrapper {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
  min-height: auto;
  justify-content: flex-start;
}

.price-new {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
}

.price-old {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-decoration: line-through;
  text-decoration-color: #ef4444;
  text-decoration-thickness: 1px;
}

/* Product Detail Grid */
.product-detail-grid { gap: 2rem !important; }

/* Badges */
.badge {
  display: inline-flex;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent);
  color: var(--accent-foreground);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  gap: 0.35rem;
}

.btn-primary {
  background: var(--primary);
  background: var(--primary-gradient);
  background-size: 140% 140%;
  background-position: 0% 50%;
  color: white;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--primary) 60%, transparent);
  transition: background-position var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.btn-primary:hover {
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--primary) 65%, transparent);
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s;
}

.section-link:hover {
  color: var(--primary);
}

/* Hero Buttons */
.btn-hero {
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
}

.btn-hero-outline {
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--foreground);
}

.btn-hero-outline:hover {
  border-color: var(--foreground);
  background: var(--muted);
}

/* Footer */
footer {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--background) 97%, var(--primary) 3%) 0%,
    var(--background) 100%);
  border-top: 1px solid var(--border);
  padding: 2rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1rem; }
  footer h4 { margin-bottom: 0.5rem; }
}
.footer-brand p {
  color: var(--muted-foreground);
  font-size: 0.8rem;
  line-height: 1.6;
  margin-top: 0.4rem;
}
footer h4 {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}
footer ul {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
footer ul a {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  transition: color 0.2s var(--ease);
}
footer ul a:hover { color: var(--primary); }
.newsletter-form {
  display: flex;
  gap: 0.4rem;
}
.newsletter-form input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  background: var(--background);
}
.newsletter-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 15%, transparent);
}
.newsletter-form .btn { padding: 0.5rem 0.9rem; font-size: 0.8rem; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 600;
}
.footer-social {
  display: flex;
  gap: 0.5rem;
}
.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--muted);
  color: var(--muted-foreground);
  transition: all 0.25s var(--ease);
}
.footer-social a:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

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

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

[data-reveal] {
  opacity: 0;
}

[data-reveal].revealed {
  animation: fadeInUp 0.8s ease forwards;
}

/* Toastify Simulation */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--foreground);
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  font-weight: 600;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .product-card .quick-add {
    transform: translateY(0) !important;
    position: relative !important;
    border-radius: 0 0 0.75rem 0.75rem;
  }
}
.cart-item-quantity, .quantity-control { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; width: fit-content; }
.qty-btn { background: var(--muted); border: none; color: var(--foreground); padding: 0.5rem 0.8rem; cursor: pointer; font-size: 1.1rem; font-weight: 600; transition: background 0.2s; }
.qty-btn:hover { background: var(--border); }
.qty, .qty-input { width: 35px; text-align: center; font-weight: 600; font-size: 1rem; }
@media (max-width: 768px) { .qty-btn { padding: 0.6rem 1rem; font-size: 1.2rem; } .qty, .qty-input { width: 40px; font-size: 1.1rem; } }

/* Fade-in: JS yuklenene kadar icerik gizlenir, flash onlenir */
.fade-container { opacity: 0; }
.fade-container.loaded { opacity: 1; transition: opacity 0.2s ease; }

/* Body-level loading: Lucide icon ve dinamik baslik flash'ini onler */
body:not(.js-ready) .logo i[data-lucide],
body:not(.js-ready) .logo svg { opacity: 0; }
body.js-ready .logo i[data-lucide],
body.js-ready .logo svg { opacity: 1; transition: opacity 0.3s ease; }

/* Stock badge iconlari: Lucide yerine CSS ::before (reflow flash'i onler) */
.stock-badge.in::before,
.stock-badge.out::before {
    content: ''; display: inline-block; width: 13px; height: 13px;
    flex-shrink: 0; vertical-align: middle;
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    background: currentColor;
}
.stock-badge.in::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E"); }
.stock-badge.out::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E"); }
