/* ========================================================================
   Variables
   ======================================================================== */
:root {
  /* Colors – warm rustic palette */
  --color-bg: #171310;                /* Deep wood-brown background */
  --color-surface: #201915;           /* Card / elevated surfaces */
  --color-surface-soft: #261f1a;
  --color-surface-alt: #141010;

  --color-text: #f9f4ee;              /* Primary text (light on dark) */
  --color-text-muted: #d1c6b8;
  --color-text-soft: #b5a796;

  --color-primary: #e7472e;           /* Rustic red (tomato) */
  --color-primary-soft: #f46b4f;
  --color-primary-dark: #b2301c;

  --color-accent: #4a9c5b;            /* Fresh green (basil) */
  --color-accent-soft: #67b879;

  --color-success: #51b96a;
  --color-warning: #f4b24a;
  --color-danger: #e53d3d;

  --gray-50: #f7f5f2;
  --gray-100: #ece3d7;
  --gray-200: #d6c7b4;
  --gray-300: #b9a48a;
  --gray-400: #9b866b;
  --gray-500: #7e6a53;
  --gray-600: #61513f;
  --gray-700: #45392d;
  --gray-800: #2d241d;
  --gray-900: #1a1511;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Poppins", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-md: 1.0625rem; /* 17px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows – soft, warm */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 45px rgba(0, 0, 0, 0.45);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms ease-out;
  --transition-slow: 260ms ease;
}

/* ========================================================================
   Reset / Normalize
   ======================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  border: none;
  background: none;
  padding: 0;
}

ul,
ol {
  padding-left: 1.25rem;
}

/* Remove default link underline, keep color inheriting control */
a {
  text-decoration: none;
  color: inherit;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================================================
   Base
   ======================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background: radial-gradient(circle at top, #2e241b 0, #171310 40%, #0f0b09 100%);
}

main {
  min-height: 100vh;
}

/* Headings – modern, slightly condensed, display font */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--gray-50);
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.25rem, 2.4vw + 2rem, 3.25rem);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.875rem, 1.5vw + 1.5rem, 2.5rem);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.5rem, 1vw + 1.25rem, 2rem);
  margin-bottom: var(--space-2);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-1);
}

h6 {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
}

p {
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
}

p + p {
  margin-top: calc(-1 * var(--space-2));
}

strong {
  font-weight: 600;
  color: var(--gray-50);
}

small {
  font-size: var(--font-size-sm);
}

/* Links – primary accent for interactivity */
a[href] {
  color: var(--color-primary-soft);
  transition: color var(--transition-base);
}

a[href]:hover {
  color: var(--color-primary);
}

a[href]:active {
  color: var(--color-primary-dark);
}

/* ========================================================================
   Utilities
   ======================================================================== */

/* Layout containers */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  max-width: 1200px;
}

.container-wide {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  max-width: 1440px;
}

.section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

/* Flex helpers */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-xs {
  gap: var(--space-2);
}

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

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

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

/* Grid helpers */
.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

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

/* Visually hidden – screen reader only */
.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;
}

/* Alignment & text */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

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

/* ========================================================================
   Components
   ======================================================================== */

/* Buttons – primary CTA for ordering */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-soft) 100%);
  color: #fff!important;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-soft) 0%, var(--color-primary) 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-xs);
  transform: translateY(0);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.btn-secondary {
  background-color: var(--color-surface-soft);
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background-color: var(--color-surface);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: 0.9rem 1.8rem;
  font-size: var(--font-size-md);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none;
}

/* Inputs / form controls */
.input,
textarea,
select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background-color: var(--color-surface-alt);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

.input::placeholder,
textarea::placeholder {
  color: var(--color-text-soft);
}

.input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px rgba(74, 156, 91, 0.6);
}

.input[disabled],
textarea[disabled],
select[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

label {
  display: inline-block;
  margin-bottom: 0.3rem;
  font-size: var(--font-size-sm);
  color: var(--color-text-soft);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: var(--space-3);
}

/* Card – for menu items, order summary, etc. */
.card {
  position: relative;
  background: radial-gradient(circle at top left, rgba(228, 104, 58, 0.1) 0, transparent 55%),
    radial-gradient(circle at bottom right, rgba(74, 156, 91, 0.12) 0, transparent 55%),
    var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.card-header {
  margin-bottom: var(--space-3);
}

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-1);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-soft);
}

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

/* Tag/price pill (useful for pizza sizes, labels) */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: rgba(0, 0, 0, 0.35);
  color: var(--color-text-soft);
  font-size: var(--font-size-xs);
}

.pill-accent {
  background-color: rgba(74, 156, 91, 0.16);
  color: var(--color-accent-soft);
}

/* ========================================================================
   Accessibility
   ======================================================================== */

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

button:focus-visible,
.btn:focus-visible,
.input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a[href]:focus-visible {
  outline: 2px solid var(--color-primary-soft);
  outline-offset: 3px;
}

/* High-contrast helper for status texts */
.status-success {
  color: var(--color-success);
}

.status-warning {
  color: var(--color-warning);
}

.status-danger {
  color: var(--color-danger);
}

/* ========================================================================
   Order / Real-time feedback cues (generic)
   ======================================================================== */

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.6rem;
  border-radius: var(--radius-full);
  background-color: rgba(74, 156, 91, 0.14);
  color: var(--color-accent-soft);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.badge-live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(74, 156, 91, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .badge-live-dot {
    box-shadow: 0 0 0 2px rgba(74, 156, 91, 0.5);
  }
}

/* ========================================================================
   End base.css
   ======================================================================== */
