/* =============================================================================
   Variables
   ========================================================================== */
:root {
  /* Colors */
  --color-background: #f5f8fc;
  --color-surface: #ffffff;
  --color-text: #0d1726;
  --color-text-muted: #6c7a8a;
  --color-primary: #1d7ed8;
  --color-primary-soft: rgba(29, 126, 216, 0.08);
  --color-primary-strong: #115a9b;
  --color-success: #22b573;
  --color-warning: #f7b500;
  --color-danger: #e0454c;

  /* Neutral grays */
  --color-gray-50: #f7f9fc;
  --color-gray-100: #edf1f8;
  --color-gray-200: #d9e2f0;
  --color-gray-300: #c2cfe0;
  --color-gray-400: #9fb0c5;
  --color-gray-500: #7b8ba0;
  --color-gray-600: #5a6778;
  --color-gray-700: #424d5c;
  --color-gray-800: #2b3440;
  --color-gray-900: #181d24;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  --font-serif: "Georgia", "Times New Roman", serif;
  --font-mono: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --font-size-xs: 0.75rem;  /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-md: 1rem;     /* 16px */
  --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 */

  --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: 999px;

  /* Shadows (soft, aquatic, non-intrusive) */
  --shadow-xs: 0 1px 2px rgba(6, 24, 44, 0.08);
  --shadow-sm: 0 4px 12px rgba(15, 35, 52, 0.10);
  --shadow-md: 0 10px 30px rgba(11, 36, 71, 0.16);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 200ms ease-out;
  --transition-slow: 280ms ease-out;

  /* Layout */
  --container-max-width: 1120px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
}

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

img {
  height: auto;
}

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

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

ul,
ol {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Remove default link styles for better control */
a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:active {
  text-decoration: none;
}

/* =============================================================================
   Base Styles
   ========================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings: clean hierarchy with controlled margins */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 {
  font-size: clamp(2rem, 3vw, 2.75rem);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  margin-bottom: var(--space-2);
}

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

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

h6 {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

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

strong,
b {
  font-weight: 600;
}

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

code,
pre {
  font-family: var(--font-mono);
}

/* Links: subtle, professional primary color */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-normal);
}

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

/* Focus-visible outline: accessible and on-brand */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* =============================================================================
   Accessibility & Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Screen-reader only utility */
.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;
}

/* =============================================================================
   Utilities
   ========================================================================== */
/* Layout container for centered, breathable content */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

/* Flex utilities */
.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-column {
  display: flex;
  flex-direction: column;
}

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

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

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

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

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

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

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

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

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

/* Simple spacing utilities (vertical rhythm) */
.section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

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

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

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

/* =============================================================================
   Components
   ========================================================================== */
/* Buttons: primary action for ordering / subscriptions */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background-color: var(--color-primary);
  color: #ffffff;
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color var(--transition-normal),
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.button:hover {
  background-color: var(--color-primary-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(29, 126, 216, 0.6);
}

.button--secondary {
  background-color: #ffffff;
  color: var(--color-primary);
  border-color: rgba(29, 126, 216, 0.24);
  box-shadow: var(--shadow-xs);
}

.button--secondary:hover {
  background-color: var(--color-primary-soft);
  border-color: rgba(29, 126, 216, 0.4);
}

.button--ghost {
  background-color: transparent;
  color: var(--color-primary);
  border-color: transparent;
  box-shadow: none;
}

.button--ghost:hover {
  background-color: var(--color-primary-soft);
}

.button[disabled],
.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Inputs: clean fields for forms & checkout */
.input,
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-gray-200);
  background-color: #ffffff;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

.input::placeholder,
textarea::placeholder {
  color: var(--color-gray-400);
}

.input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(29, 126, 216, 0.18);
  outline: none;
}

.input[disabled],
select[disabled],
textarea[disabled] {
  background-color: var(--color-gray-50);
  color: var(--color-gray-500);
  cursor: not-allowed;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* Cards: for product tiles, plan summaries, etc. */
.card {
  position: relative;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid rgba(205, 219, 237, 0.7);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  transition:
    box-shadow var(--transition-normal),
    transform var(--transition-normal),
    border-color var(--transition-fast),
    background-color var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(29, 126, 216, 0.2);
}

.card--muted {
  background: linear-gradient(135deg, #f6fbff, #ffffff);
}

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

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

.card-footer {
  margin-top: auto;
}

/* Helper for subtle, pill-like labels (e.g., delivery, subscription) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-soft);
  color: var(--color-primary-strong);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge--success {
  background-color: rgba(34, 181, 115, 0.1);
  color: var(--color-success);
}

.badge--neutral {
  background-color: rgba(123, 139, 160, 0.14);
  color: var(--color-gray-700);
}

/* =============================================================================
   Forms & Messages (basic)
   ========================================================================== */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: var(--space-4);
}

.form-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-gray-700);
}

.form-helper {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
  margin-top: 0.15rem;
}

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.alert--success {
  background-color: rgba(34, 181, 115, 0.06);
  border: 1px solid rgba(34, 181, 115, 0.3);
  color: var(--color-success);
}

.alert--warning {
  background-color: rgba(247, 181, 0, 0.06);
  border: 1px solid rgba(247, 181, 0, 0.3);
  color: var(--color-warning);
}

.alert--danger {
  background-color: rgba(224, 69, 76, 0.06);
  border: 1px solid rgba(224, 69, 76, 0.3);
  color: var(--color-danger);
}

/* =============================================================================
   Images & Media Presentation
   ========================================================================== */
/* For product imagery: smooth edges, subtle shadow */
.media-rounded {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.media-elevated {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* End of base.css */
