/* ============================================================
   MEGA OUTLET — Base Styles
   Body, typography, links, utilities, container, grid helpers
   ============================================================ */

/* ── Body ────────────────────────────────────────────────── */
body {
  background: var(--color-bg-main);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── Page Content Wrapper ────────────────────────────────── */
.page-content {
  min-height: calc(100vh - var(--header-height) - var(--top-bar-height));
  padding-top: calc(var(--header-height) + var(--top-bar-height));
  animation: fadeIn 0.4s ease;
}

/* ── Container ───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-6);
  }
}

@media (min-width: 1200px) {
  .container {
    padding-inline: var(--space-8);
  }
}

/* ── Typography ──────────────────────────────────────────── */
h1 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-extrabold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
}

h2 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
}

h3 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

h4 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
}

h5 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}

h6 {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

p {
  color: var(--color-text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

small {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

strong {
  font-weight: var(--fw-bold);
  color: var(--color-text-primary);
}

em {
  font-style: italic;
}

/* ── Links ───────────────────────────────────────────────── */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ── Section Title ───────────────────────────────────────── */
.section-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-6);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  min-width: 40px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

@media (min-width: 768px) {
  .section-title {
    font-size: var(--fs-3xl);
    margin-bottom: var(--space-8);
  }
}

/* ── Product Grid ────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  padding-bottom: var(--space-8);
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
  }
}

@media (min-width: 1400px) {
  .product-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ── Grid Filters ────────────────────────────────────────── */
.grid-filters {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.grid-filters::-webkit-scrollbar {
  display: none;
}

.grid-filters__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-muted);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.grid-filters__btn:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-elevated);
  border-color: var(--color-primary);
}

.grid-filters__btn.active {
  color: var(--color-white);
  background: var(--gradient-primary);
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

/* ── Highlight Box ───────────────────────────────────────── */
.highlight-box {
  background: var(--gradient-glass);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin: var(--space-6) 0;
  color: var(--color-text-secondary);
  line-height: var(--lh-relaxed);
  backdrop-filter: blur(8px);
}

.highlight-box strong {
  color: var(--color-primary-light);
}

/* ── Utility: Visually Hidden ────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Utility: Text Truncation ────────────────────────────── */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Utility: Flex ───────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* ── Utility: Spacing ────────────────────────────────────── */
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* ── Skeleton / Loading Shimmer ──────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-elevated) 25%,
    var(--color-bg-hover) 50%,
    var(--color-bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* ── Responsive text ─────────────────────────────────────── */
@media (max-width: 639px) {
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
  h3 { font-size: var(--fs-lg); }

  .section-title {
    font-size: var(--fs-xl);
    margin-bottom: var(--space-4);
  }
}
