/* =============================================================
   AMYTEA — Layout System
   Grid, containers, sections, page structure
   ============================================================= */

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

.container--narrow {
  max-width: var(--max-width-narrow);
}

.container--wide {
  max-width: var(--max-width-wide);
}

.container--flush {
  padding-inline: 0;
}

/* ── Section ───────────────────────────────────────────────── */
.section {
  padding-block: var(--section-pad-y);
}

.section--sm {
  padding-block: var(--space-12);
}

.section--lg {
  padding-block: calc(var(--section-pad-y) * 1.5);
}

.section--dark {
  background-color: var(--color-text);
  color: var(--color-text-inverse);
}

.section--tinted {
  background-color: var(--color-primary-tint);
}

.section--warm {
  background-color: var(--color-accent-tint);
}

.section--surface {
  background-color: var(--color-surface-raised);
}

/* ── Section Header ────────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-header--left {
  text-align: left;
}

.section-header__label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

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

.section-header__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 560px;
  margin-inline: auto;
  line-height: var(--leading-relaxed);
}

.section-header--left .section-header__subtitle {
  margin-inline: 0;
}

/* ── Grid ──────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: var(--card-gap);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--auto-sm { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid--4,
  .grid--3,
  .grid--2 { grid-template-columns: 1fr; }
}

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

/* ── Page Layout ───────────────────────────────────────────── */
.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
}

/* ── Shop Layout ───────────────────────────────────────────── */
.shop-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-12);
  align-items: start;
}

@media (max-width: 1024px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }
  .shop-layout__sidebar {
    display: none;
  }
  .shop-layout__sidebar.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: var(--color-surface);
    overflow-y: auto;
    padding: var(--space-8) var(--space-6);
  }
}

/* ── Product Page Layout ───────────────────────────────────── */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: start;
}

@media (max-width: 768px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* ── Sticky sidebar observer ───────────────────────────────── */
.sticky-column {
  position: sticky;
  top: calc(80px + var(--space-8));
}

/* ── Aspect Ratios ─────────────────────────────────────────── */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-portrait { aspect-ratio: 3 / 4; }
.aspect-landscape { aspect-ratio: 16 / 9; }
.aspect-wide { aspect-ratio: 21 / 9; }
.aspect-product { aspect-ratio: 4 / 5; }

/* ── Object Fit ────────────────────────────────────────────── */
.obj-cover { object-fit: cover; width: 100%; height: 100%; }
.obj-contain { object-fit: contain; width: 100%; height: 100%; }

/* ── Breadcrumbs ───────────────────────────────────────────── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-block: var(--space-4);
}

.breadcrumbs a {
  color: var(--color-text-muted);
}
.breadcrumbs a:hover {
  color: var(--color-primary);
}
.breadcrumbs__separator {
  color: var(--color-border-strong);
}
.breadcrumbs__current {
  color: var(--color-text-secondary);
  font-weight: var(--weight-medium);
}
