/* === variables.css === */
:root {
  /* Backgrounds — світліший оливковий, багатші шари */
  --color-bg-primary: #1B2016;
  --color-bg-secondary: #242B1D;
  --color-bg-elevated: #333D28;
  --color-bg-panel: #2A3220;

  /* Accent — тепла латунь */
  --color-accent: #CDB06A;
  --color-accent-hover: #DFC27E;
  --color-accent-muted: rgba(205, 176, 106, 0.55);
  --color-accent-text: #11150F;

  /* Text */
  --color-text-primary: #F0EBE2;
  --color-text-muted: #ACB2A1;
  --color-text-subtle: #8B917F;

  /* UI */
  --color-border: #48563C;
  --color-border-subtle: #39432E;
  --color-border-strong: #5C6B4C;
  --color-error: #D06858;
  --color-success: #6F9A62;

  /* Store accents */
  --color-store-military: #37472C;
  --color-store-tourist: #453829;

  /* Surfaces & glow */
  --color-glow-accent: rgba(205, 176, 106, 0.16);
  --color-glow-military: rgba(76, 96, 60, 0.45);
  --color-overlay-dark: rgba(27, 32, 22, 0.88);
  --color-pattern-stroke: #3D4732;

  /* Shadows */
  --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.22);
  --shadow-elevated: 0 12px 32px rgba(0, 0, 0, 0.28);

  /* Typography */
  --font-display: 'Bebas Neue', Impact, sans-serif;
  --font-body: 'Jost', system-ui, sans-serif;

  /* Mobile-first spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Layout */
  --container-max: 1280px;
  --container-padding: 16px;
  --topbar-height: 44px;
  --header-bar-height: 56px;
  --header-height: calc(var(--header-bar-height) + var(--safe-top));
  --touch-target: 44px;

  /* Radius */
  --radius-sm: 2px;
  --radius-md: 4px;

  /* Motion */
  --transition-fast: 200ms;
  --transition-base: 300ms;
  --duration-press: 160ms;
  --duration-ui: 200ms;
  --duration-panel: 260ms;
  --duration-reveal: 520ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  /* Safe area iOS */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Typography scale */
  --text-h1: clamp(2.25rem, 5vw, 4rem);
  --text-h2: clamp(1.75rem, 3vw, 2.25rem);
  --text-h3: clamp(1.375rem, 2.5vw, 1.75rem);
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-price: clamp(1.5rem, 2.5vw, 2rem);
}

@media (min-width: 768px) {
  :root {
    --container-padding: 24px;
    --topbar-height: 60px;
    --header-bar-height: 64px;
  }
}

@media (min-width: 1024px) {
  :root {
    --container-padding: 32px;
  }
}

/* === reset.css === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
}

fieldset {
  border: none;
}

/* === base.css === */
/* Шрифти підключаються через <link> у base.html (не @import) —
   інакше браузер відкладає завантаження Google Fonts CSS
   до моменту, поки не завантажить і не розпарсить весь цей файл. */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.is-nav-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

::selection {
  background-color: var(--color-accent);
  color: var(--color-accent-text);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

input,
textarea,
select {
  font-size: 16px;
}

.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;
}

.noise-overlay {
  position: relative;
}

.noise-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* === typography.css === */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-wrap: balance;
  color: var(--color-text-primary);
}

h1,
.h1 {
  font-size: var(--text-h1);
}

h2,
.h2 {
  font-size: var(--text-h2);
}

h3,
.h3 {
  font-size: var(--text-h3);
}

p {
  max-width: 65ch;
  color: var(--color-text-primary);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-small {
  font-size: var(--text-small);
}

.text-display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.text-price {
  font-family: var(--font-display);
  font-size: var(--text-price);
  color: var(--color-accent);
  letter-spacing: 0.02em;
}

.text-price--old {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
  text-decoration: line-through;
  letter-spacing: normal;
}

.price-group {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-lg);
}

.section-lead {
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
  max-width: 50ch;
}

/* === layout.css === */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: calc(var(--container-padding) + var(--safe-left));
  padding-right: calc(var(--container-padding) + var(--safe-right));
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.page__main {
  flex: 1;
  padding-top: var(--space-md);
  padding-bottom: calc(var(--space-2xl) + var(--safe-bottom));
}

.page__main--flush {
  padding-top: 0;
}

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

.section--tight {
  padding-block: var(--space-lg);
}

.grid {
  display: grid;
  gap: var(--space-md);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.stack--sm {
  gap: var(--space-sm);
}

.stack--lg {
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-2xl);
  }

  .grid--auto {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (min-width: 1024px) {
  .catalog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--space-xl);
    align-items: start;
  }
}
