/* ========================================================================== */
/*  EssenceBloom Base Styles                                                  */
/*  File: assets/css/base.css                                                */
/* ========================================================================== */

/* ========================================================================== */
/*  Variables                                                                 */
/* ========================================================================== */

:root {
  /* Color Palette - EssenceBloom */
  --color-background: #faf7f8; /* soft, airy blush-tinged background */
  --color-surface: #ffffff;    /* elevated cards, headers, panels */
  --color-surface-muted: #f4eff0;

  --color-text: #3b3034;       /* deep, soft cocoa for primary text */
  --color-text-muted: #7a646d; /* secondary text */
  --color-border-subtle: #e5d8dd;

  --color-primary: #e8b6c3;    /* blush rose */
  --color-primary-soft: #f5d7df;
  --color-primary-strong: #d28da1;

  --color-success: #4f9d7a;
  --color-warning: #c89a46;
  --color-danger: #cc4b5f;

  /* Neutral grays for structure */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f4f4f5;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d4d4d8;
  --color-gray-400: #a1a1aa;
  --color-gray-500: #71717a;
  --color-gray-600: #52525b;
  --color-gray-700: #3f3f46;
  --color-gray-800: #27272a;
  --color-gray-900: #18181b;

  /* Typography */
  --font-family-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-family-heading: "Playfair Display", "Cormorant Garamond", "Georgia", "Times New Roman", serif;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 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-normal: 1.5;
  --line-height-relaxed: 1.7;

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

  /* Radii */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Shadows - soft, cosmetic-like */
  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 4px 10px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.08);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 180ms ease-out;
  --transition-slow: 240ms ease-out;
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-normal: 0ms;
    --transition-slow: 0ms;
  }
}

/* ========================================================================== */
/*  Reset / Normalize                                                         */
/* ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
}

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

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

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

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

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

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/* Remove default list styles for navs; enable utility classes to restore */
nav ul,
nav ol {
  list-style: none;
}

/* ========================================================================== */
/*  Base Typography & Layout                                                  */
/* ========================================================================== */

body {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  background-color: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 60vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: 500;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.1rem, 2.2vw + 1.7rem, 2.7rem);
  margin-bottom: var(--space-16);
}

h2 {
  font-size: clamp(1.7rem, 1.5vw + 1.3rem, 2.1rem);
  margin-bottom: var(--space-12);
}

h3 {
  font-size: clamp(1.4rem, 1.2vw + 1.1rem, 1.7rem);
  margin-bottom: var(--space-10);
}

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

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

h6 {
  font-size: var(--font-size-base);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

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

strong {
  font-weight: 600;
}

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

a {
  color: var(--color-primary-strong);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-text);
}

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

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

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

/* 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;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

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

/* Layout container - for main content width */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-16);
  padding-right: var(--space-16);
  max-width: 1120px;
}

@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }
}

/* 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;
}

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

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

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

.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-16);
}

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

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

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-8 { margin-top: var(--space-8); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-16 { margin-top: var(--space-16); }
.mb-16 { margin-bottom: var(--space-16); }

.pt-16 { padding-top: var(--space-16); }
.pb-16 { padding-bottom: var(--space-16); }
.pt-24 { padding-top: var(--space-24); }
.pb-24 { padding-bottom: var(--space-24); }

/* Elevation & radius helpers */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-pill { border-radius: var(--radius-pill); }

.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

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

/* Buttons */
.button,
button.button,
input[type="submit"].button,
input[type="button"].button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-soft) 100%);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition:
    background-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

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

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

.button:focus-visible {
  outline: 2px solid var(--color-primary-strong);
  outline-offset: 3px;
}

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

.button--ghost:hover {
  background-color: rgba(232, 182, 195, 0.08);
  box-shadow: none;
}

.button--secondary {
  background: var(--color-surface);
  border-color: var(--color-border-subtle);
  color: var(--color-text);
}

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

/* Form controls */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: var(--color-surface);
  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-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary-strong);
  box-shadow: 0 0 0 1px rgba(210, 141, 161, 0.6);
}

input[disabled],
select[disabled],
textarea[disabled] {
  background-color: var(--color-surface-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

label {
  display: block;
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
}

/* Cards - for products, content sections */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: var(--space-16);
  border: 1px solid rgba(229, 216, 221, 0.6);
}

.card--elevated {
  box-shadow: var(--shadow-sm);
}

.card__header {
  margin-bottom: var(--space-12);
}

.card__title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
}

.card__meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.card__body {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card__footer {
  margin-top: var(--space-12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

/* Badges / Pills - e.g., for offers, new products */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background-color: var(--color-primary-soft);
  color: var(--color-text);
}

.badge--success {
  background-color: rgba(79, 157, 122, 0.12);
  color: #326f55;
}

.badge--warning {
  background-color: rgba(200, 154, 70, 0.12);
  color: #8b6525;
}

.badge--danger {
  background-color: rgba(204, 75, 95, 0.12);
  color: #8b2c3a;
}

/* Messages / Alerts (for trust & transparency notes) */
.alert {
  border-radius: var(--radius-md);
  padding: var(--space-10) var(--space-12);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-8);
  border: 1px solid var(--color-border-subtle);
  background-color: var(--color-surface);
}

.alert--info {
  border-color: var(--color-primary-soft);
  background-color: rgba(245, 215, 223, 0.35);
}

.alert--success {
  border-color: rgba(79, 157, 122, 0.3);
  background-color: rgba(79, 157, 122, 0.08);
}

.alert--warning {
  border-color: rgba(200, 154, 70, 0.3);
  background-color: rgba(200, 154, 70, 0.08);
}

.alert--danger {
  border-color: rgba(204, 75, 95, 0.3);
  background-color: rgba(204, 75, 95, 0.08);
}

/* ========================================================================== */
/*  Media & Images                                                            */
/* ========================================================================== */

/* Refined image presentation for product galleries */
.img-soft-radius {
  border-radius: var(--radius-lg);
}

.img-shadow {
  box-shadow: var(--shadow-sm);
}

/* Ensure decorative images do not exceed layout */
figure {
  margin: 0;
}

figcaption {
  margin-top: var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-align: center;
}

/* ========================================================================== */
/*  Reduced Motion Support                                                    */
/* ========================================================================== */

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