/* ==========================================================================
   pages.css
   Sayfa-spesifik kurallar: hero banner, restoran grid, tenant/merchant
   sayfası (header + menu tabs + breadcrumb), kategori chip menüsü.
   tokens.css + base.css + components.css bağımlı.
   ========================================================================== */

/* ---------- Ana layout grid (sidebar + content) ---------- */
.layout {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-5);
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: var(--space-5);
  align-items: start;
}

.layout--with-cart {
  grid-template-columns: var(--sidebar-width) 1fr var(--cart-panel-width);
}

@media (max-width: 960px) {
  .layout,
  .layout--with-cart {
    grid-template-columns: 1fr;
  }

  .filters {
    display: none; /* mobilde butonla açılan çekmeceye dönüştürün */
  }
}

@media (max-width: 768px) {
  .layout {
    display: block;
    padding: var(--space-4);
  }

  .layout > .filters {
    width: auto;
    padding: 12px 4px;
    border: 0;
    background: transparent;
  }
}

/* ---------- Hero banner ---------- */
.hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(16px, 2.5vw, 32px);
  align-items: center;
  padding: clamp(16px, 2.4vw, 28px) clamp(20px, 3vw, 36px);
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, #fff7f1 0%, #ffece4 100%);
  margin-bottom: clamp(16px, 2vw, 24px);
}

@media (max-width: 768px) {
  .hero-banner {
    grid-template-columns: 1fr;
  }
}

.hero-banner__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--color-brand);
  margin-bottom: 8px;
}

.hero-banner__title {
  /* Fluid typography — 28px on phone, up to 40px on desktop.
     Avoids the awkward fixed-32px that felt small on 1440px
     and overwhelming on a 390px viewport. */
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #1a1a1a;
  margin: 0 0 8px;
}

.hero-banner__sub {
  color: #555;
  margin: 0 0 16px;
  font-size: clamp(14px, 1.6vw, 17px);
}

.hero-banner__cta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-banner__note {
  font-size: 13px;
  color: #777;
}

.hero-banner__values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1vw, 12px);
}

@media (max-width: 768px) {
  .hero-banner__values {
    /* Below tablet, drop one of the 3 columns and use the freed
       width to make each tile readable. The remaining 2 columns
       (Teslimat Süresi / Teslimat Ücreti) are the ones users
       actually compare across restaurants — Min. Sepet is a
       secondary signal. */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .hero-banner__values {
    /* Phone: keep 2 columns but tighten the inner padding so
       each tile doesn't dominate the screen. The CTA gets
       breathing room above the fold. */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .hero-banner__value {
    padding: 10px 8px;
  }
}

.hero-banner__value {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: clamp(10px, 1.4vw, 16px) clamp(6px, 1vw, 12px);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.hero-banner__value strong {
  display: block;
  font-size: clamp(17px, 1.8vw, 24px);
  font-weight: 700;
  color: #1a1a1a;
}

.hero-banner__value span {
  display: block;
  font-size: clamp(10px, 1vw, 11px);
  color: #555;
}

/* Hero responsive handled by clamp() and auto-fit — no extra rules needed. */

/* ---------- Restoran kartı grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(12px, 1.5vw, 16px);
}

@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.restaurant-card {
  background: var(--color-bg);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  /* cubic-bezier overshoots slightly — gives the lift a
     "settle" feel rather than a dead stop. The shadow change
     is what really sells the depth (translateY alone is too
     subtle at 2px). */
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.restaurant-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-panel);
}

/* Keyboard focus parity with hover — sighted keyboard users
   get the same tactile feedback. Required for WCAG 2.4.7. */
.restaurant-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-panel);
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* Respect reduced-motion preference — animation can trigger
   vestibular issues. */
@media (prefers-reduced-motion: reduce) {
  .restaurant-card,
  .restaurant-card:hover,
  .restaurant-card:focus-visible {
    transition: none;
    transform: none;
  }
}

.restaurant-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--color-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

@media (max-width: 768px) {
  .restaurant-card__media {
    height: 130px;
  }
}

.restaurant-card__fav {
  position: absolute;
  top: 8px;
  right: 8px;
}

.restaurant-card__featured {
  position: absolute;
  left: 8px;
  bottom: 8px;
}

.restaurant-card__body {
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.restaurant-card__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 4px;
}

.restaurant-card__name {
  font-weight: 700;
  font-size: var(--fs-base);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restaurant-card__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-brand);
  font-weight: 700;
  font-size: var(--fs-sm);
  flex-shrink: 0;
}

.restaurant-card__rating span {
  color: var(--color-text-secondary);
  font-weight: 400;
}

.restaurant-card__meta {
  color: var(--color-text-secondary);
  font-size: var(--fs-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.restaurant-card__meta span:not(:last-child)::after {
  content: "•";
  margin: 0 4px;
}

.restaurant-card__delivery {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.restaurant-card__delivery--free {
  color: var(--color-brand);
  font-weight: 700;
}

.restaurant-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Tenant / merchant sayfası (restaurant.html) ---------- */
.restaurant-header {
  background: var(--color-bg);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.restaurant-header__thumb {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-image);
  background: var(--color-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
}

.restaurant-header__info h1 {
  font-size: var(--fs-xxl);
  margin-bottom: 4px;
}

.restaurant-header__badges {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.breadcrumb {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

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

.menu-tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.menu-tab {
  background: none;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.menu-tab.is-active {
  background: var(--color-brand-light);
  color: var(--color-brand);
}

.menu-section-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin: var(--space-5) 0 var(--space-3);
}

.tenant-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .tenant-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Tablet-specific range (601–1024px) — fills the gap between
   desktop and mobile so the layout doesn't snap from 3-column
   desktop straight to cramped phone. Tablet sees hero values
   in 3 columns (kept — they fit), a 2-column restaurant grid
   (matches the page width better than 3 or 1), and the public
   page h1 sits at the upper end of the fluid scale. */
@media (min-width: 768px) and (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .hero-banner__values {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .public-section h1 {
    font-size: 30px;
  }
}

/* ---------- Market / dark-store kategori chip menüsü ---------- */
.category-chip-row {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-4);
}

.category-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 76px;
  background: none;
  border: none;
}

.category-chip__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-image);
  background: var(--color-accent-mint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.category-chip.is-active .category-chip__icon {
  outline: 2px solid var(--color-accent-mint-dark);
}

.category-chip span {
  font-size: var(--fs-xs);
  text-align: center;
}

.category-sidebar-list {
  background: var(--color-bg);
  border-radius: var(--radius-card);
  padding: var(--space-2);
}

.category-sidebar-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--space-3);
  border-radius: var(--radius-button);
  font-size: var(--fs-base);
}

.category-sidebar-list__item:hover {
  background: var(--color-bg-subtle);
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--color-text-secondary);
}

.empty-state__icon {
  font-size: 48px;
  margin-bottom: var(--space-3);
}
