/*
Theme Name: Bu Hafta
Theme URI: https://www.bu-hafta.com/brosurler/
Author: Claude
Author URI: https://claude.ai
Description: Market broşürlerini listeleyen modern WordPress teması
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: bu-hafta-brosurler
Tags: e-commerce, catalog, leaflets, responsive
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #e53935;
  --red-dark: #b71c1c;
  --red-light: #ffebee;
  --orange: #ff6f00;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-300: #e0e0e0;
  --gray-400: #bdbdbd;
  --gray-500: #9e9e9e;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --font: 'Nunito', 'Segoe UI', sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ===== HEADER ===== */
#site-header {
  background: var(--white);
  border-bottom: 2px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  color: var(--red);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.site-logo .logo-badge {
  background: var(--red);
  color: var(--white);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.header-search {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.header-search input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: 20px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--gray-50);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.header-search input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229,57,53,0.12);
  background: var(--white);
}

.header-search .search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-nav a {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  transition: background 0.15s, color 0.15s;
}

.header-nav a:hover { background: var(--gray-100); color: var(--gray-900); }
.header-nav a.active { color: var(--red); background: var(--red-light); }

/* ===== BREADCRUMB ===== */
.breadcrumb-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 10px 0;
}

.breadcrumb-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-600);
}

.breadcrumb-inner a { color: var(--red); }
.breadcrumb-inner a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--gray-400); }

/* ===== PAGE HERO ===== */
.page-hero {
  background: linear-gradient(135deg, var(--red) 0%, #c62828 100%);
  color: var(--white);
  padding: 36px 24px;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.page-hero p {
  font-size: 15px;
  opacity: 0.9;
  max-width: 520px;
  margin: 0 auto;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0;
  position: sticky;
  top: 64px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.filter-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-inner::-webkit-scrollbar { display: none; }

.filter-btn {
  padding: 14px 18px;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-btn:hover { color: var(--gray-900); }
.filter-btn.active { color: var(--red); border-bottom-color: var(--red); }

.filter-btn .count {
  background: var(--gray-200);
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}

.filter-btn.active .count {
  background: var(--red-light);
  color: var(--red);
}

/* ===== MAIN LAYOUT ===== */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}

/* ===== SIDEBAR ===== */
.sidebar {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 116px;
}

.sidebar-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--gray-200);
}

.sidebar-section:last-child { border-bottom: none; }

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.sidebar-links { display: flex; flex-direction: column; gap: 2px; }

.sidebar-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  transition: background 0.15s, color 0.15s;
}

.sidebar-links a:hover { background: var(--gray-100); color: var(--gray-900); }
.sidebar-links a.active { background: var(--red-light); color: var(--red); }

.sidebar-links .badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 1px 7px;
  border-radius: 20px;
}

.sidebar-links a.active .badge { background: rgba(229,57,53,0.15); color: var(--red); }

/* ===== CONTENT AREA ===== */
.content-area {}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.content-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.content-header .result-count {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
}

.sort-select {
  height: 36px;
  padding: 0 32px 0 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 600;
  color: var(--gray-700);
  background: var(--white);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23757575' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.sort-select:focus { border-color: var(--red); }

/* ===== BROCHURE GRID ===== */
.brochure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ===== BROCHURE CARD ===== */
.brochure-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.brochure-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gray-300);
}

.card-cover {
  position: relative;
  aspect-ratio: 3/4;
  background: var(--gray-100);
  overflow: hidden;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.brochure-card:hover .card-cover img { transform: scale(1.03); }

.card-cover .market-logo {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 44px;
  height: 44px;
  background: var(--white);
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-cover .market-logo img { width: 32px; height: 32px; object-fit: contain; }

.card-cover .validity-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.65);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

.card-cover .new-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.3px;
}

.card-body {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-market {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--red);
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.4;
}

.card-dates {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 4px;
}

.card-excerpt {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.5;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-pages {
  font-size: 11px;
  color: var(--gray-400);
}

.card-footer {
  border-top: 1px solid var(--gray-100);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-view-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.15s;
}

.card-view-btn::after { content: '→'; }
.brochure-card:hover .card-view-btn { gap: 8px; }

.card-save-btn {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--gray-300);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  color: var(--gray-400);
}

.card-save-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }
.card-save-btn.saved { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* ===== LOADING STATE ===== */
.skeleton-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton-cover {
  aspect-ratio: 3/4;
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skeleton-body { padding: 12px 14px; }
.skeleton-line {
  height: 10px;
  background: var(--gray-200);
  border-radius: 4px;
  margin-bottom: 8px;
  animation: shimmer 1.5s infinite;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 40px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover { border-color: var(--red); color: var(--red); }
.page-btn.active { background: var(--red); border-color: var(--red); color: var(--white); }
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* ===== FOOTER ===== */
#site-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 48px 24px 28px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--gray-800);
  margin-bottom: 28px;
}

.footer-brand .brand-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 10px;
}

.footer-brand p { font-size: 13px; line-height: 1.7; max-width: 280px; }

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-500);
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--gray-400);
  padding: 3px 0;
  transition: color 0.15s;
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .main-container { grid-template-columns: 200px 1fr; gap: 20px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .header-inner { gap: 12px; }
  .header-nav { display: none; }
  .main-container { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 24px; }
  .page-hero { padding: 24px 16px; }
}

@media (max-width: 480px) {
  .main-container { padding: 16px; }
  .brochure-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .footer-top { grid-template-columns: 1fr; }
}
