@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a3c6e;
  --primary-dark: #0f2447;
  --primary-light: #2563eb;
  --accent: #e63946;
  --green: #16a34a;
  --orange: #ea580c;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #f1f5f9;
  --white: #ffffff;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 24px rgba(0,0,0,0.09);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.14);
  --radius: 14px;
}

body { font-family: 'Poppins', sans-serif; color: var(--text); background: var(--bg); }

/* ─── HERO ──────────────────────────────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #2a5298 100%);
  padding: 80px 0 72px;
  text-align: center;
  color: var(--white);
}
.page-hero .section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 12px;
  text-transform: uppercase;
  display: block;
}
.page-hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.page-hero p {
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 480px;
  margin: 0 auto;
}

/* ─── FILTERS ────────────────────────────────────────────────────────────────── */
.filters-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 72px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.filters-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.search-box { flex: 1; min-width: 220px; position: relative; }
.search-box input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: var(--text);
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,60,110,0.08); }
.search-box::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.filter-select {
  padding: 10px 36px 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  cursor: pointer;
  background: white;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  transition: border-color 0.2s;
}
.filter-select:focus { border-color: var(--primary); }
.results-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  background: var(--bg);
  padding: 6px 12px;
  border-radius: 50px;
  white-space: nowrap;
}

/* ─── MACHINES GRID ──────────────────────────────────────────────────────────── */
.machines-section { max-width: 1280px; margin: 0 auto; padding: 44px 24px 60px; }
.machines-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }

/* ─── MACHINE CARD ───────────────────────────────────────────────────────────── */
.machine-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.machine-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.card-img-wrap { position: relative; width: 100%; height: 240px; overflow: hidden; background: #f0f4f8; }
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.machine-card:hover .card-img { transform: scale(1.04); }
.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8edf5, #d4dce8);
  color: var(--text-light);
  gap: 10px;
}
.card-img-placeholder svg { width: 52px; height: 52px; opacity: 0.4; }
.card-img-placeholder span { font-size: 12px; font-weight: 500; opacity: 0.5; }

.card-status-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.card-body { padding: 20px 20px 14px; flex: 1; display: flex; flex-direction: column; }
.card-kategori { font-size: 11px; font-weight: 600; color: var(--primary-light); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.card-title { font-size: 18px; font-weight: 700; color: var(--primary-dark); margin-bottom: 8px; line-height: 1.3; }
.card-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.65;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  margin-top: auto;
}
.card-price-empty { font-size: 13px; color: var(--text-light); font-weight: 500; }

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfd;
}
.card-date { font-size: 11px; color: var(--text-light); display: flex; align-items: center; gap: 5px; }
.card-btn {
  padding: 8px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.2px;
}
.card-btn:hover { background: var(--primary-dark); transform: scale(1.03); }

/* ─── BADGES ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.badge-satilik  { background: #dcfce7; color: var(--green);   border: 1px solid #bbf7d0; }
.badge-satildi  { background: #fee2e2; color: var(--accent);  border: 1px solid #fecaca; }
.badge-rezerve  { background: #fff7ed; color: var(--orange);  border: 1px solid #fed7aa; }
.badge-kategori { background: #eff6ff; color: var(--primary); border: 1px solid #bfdbfe; }

/* ─── EMPTY STATE ────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 100px 20px; color: var(--text-light); }
.empty-state .icon { font-size: 72px; margin-bottom: 20px; }
.empty-state h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; }

/* ─── LOADING ────────────────────────────────────────────────────────────────── */
.loading { text-align: center; padding: 100px 20px; }
.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── MODAL ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  overflow-y: auto;
  padding: 24px 16px;
}
.modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; }
.modal {
  background: var(--white);
  border-radius: 18px;
  max-width: 900px;
  width: 100%;
  margin: auto;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.22);
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn { from { transform: translateY(30px) scale(0.97); opacity: 0; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 10;
}
.modal-header h2 { font-size: 19px; font-weight: 700; color: var(--primary-dark); }
.modal-close {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: none; border-radius: 50%;
  font-size: 18px; cursor: pointer; color: var(--text-light);
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: #fee2e2; color: var(--accent); }

.modal-body { display: grid; grid-template-columns: 1fr 1fr; }

.modal-gallery { background: #0f172a; position: relative; }
.modal-main-img-wrap { height: 360px; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-main-img-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; }
.modal-no-img {
  height: 360px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: rgba(255,255,255,0.3);
  gap: 12px;
}
.modal-no-img svg { width: 64px; height: 64px; }
.modal-no-img span { font-size: 13px; }
.gallery-nav {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.4);
  overflow-x: auto;
}
.gallery-nav::-webkit-scrollbar { height: 4px; }
.gallery-nav::-webkit-scrollbar-track { background: transparent; }
.gallery-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.gallery-thumb {
  width: 60px; height: 44px;
  object-fit: cover; border-radius: 6px;
  cursor: pointer; opacity: 0.55;
  transition: opacity 0.2s, outline 0.2s;
  flex-shrink: 0; border: 2px solid transparent;
}
.gallery-thumb.active { opacity: 1; border-color: var(--accent); }
.gallery-thumb:hover { opacity: 0.85; }

.modal-info { padding: 28px; overflow-y: auto; max-height: 480px; }
.modal-badges { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.modal-price {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px;
  line-height: 1.1;
}
.modal-price-empty { font-size: 15px; color: var(--text-light); font-weight: 500; margin-bottom: 6px; }
.modal-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.modal-desc-label { font-size: 11px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.modal-desc { font-size: 14px; color: var(--text); line-height: 1.75; margin-bottom: 20px; }

.modal-contact {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--border);
}
.modal-contact p { font-size: 13px; color: var(--primary-dark); font-weight: 600; margin-bottom: 12px; }
.modal-contact-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-contact {
  padding: 10px 20px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-contact:hover { opacity: 0.88; transform: scale(1.02); }
.btn-contact-primary { background: var(--primary); color: white; }
.btn-contact-green { background: var(--green); color: white; }

/* ─── FOOTER ─────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.75);
  padding: 52px 24px 28px;
  margin-top: 60px;
}
.footer-inner { max-width: 1280px; margin: 0 auto; text-align: center; }
.footer-inner img { height: 34px; filter: brightness(0) invert(1); margin-bottom: 20px; opacity: 0.9; }
.footer-links { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.footer-links a { color: rgba(255,255,255,0.65); text-decoration: none; font-size: 13px; font-weight: 500; transition: color 0.2s; }
.footer-links a:hover { color: white; }
.footer-copy { font-size: 12px; opacity: 0.4; }

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .modal-body { grid-template-columns: 1fr; }
  .modal-main-img-wrap { height: 260px; }
  .modal-info { max-height: none; }
  .machines-grid { grid-template-columns: 1fr; }
  .filters-inner { gap: 8px; }
  .filter-select { flex: 1; }
}
