/* ==========================================================================   
   Paw Accessories - Base Styles (base.css)
   Modern, vibrant, friendly, clean, trustworthy, responsive
   ========================================================================== */

/* ==========================================================================   
   1. CSS VARIABLES
   -------------------------------------------------------------------------- */

:root {
  /* Color Palette ---------------------------------------------------------- */
  --color-bg: #f9fafb;                /* Soft neutral background */
  --color-surface: #ffffff;           /* Card / surface */
  --color-text: #111827;              /* Primary text (near-black) */
  --color-text-muted: #6b7280;        /* Muted text */
  --color-border-subtle: #e5e7eb;     /* Subtle borders */

  /* Brand & Accents (playful but trustworthy) */
  --color-primary: #fb7185;           /* Warm pink (primary accent) */
  --color-primary-soft: #ffe4ea;      /* Soft tint of primary */
  --color-primary-strong: #f43f5e;    /* Darker primary for hover */

  --color-success: #10b981;           /* Green */
  --color-warning: #f59e0b;           /* Amber */
  --color-danger: #ef4444;            /* Red */

  /* Neutral Grays (for UI states & backgrounds) */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2933;
  --gray-900: #111827;

  /* Typography ------------------------------------------------------------- */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text',
    'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-heading: var(--font-sans);

  --text-xs: 0.75rem;   /* 12px */
  --text-sm: 0.875rem;  /* 14px */
  --text-base: 1rem;    /* 16px */
  --text-lg: 1.125rem;  /* 18px */
  --text-xl: 1.25rem;   /* 20px */
  --text-2xl: 1.5rem;   /* 24px */
  --text-3xl: 1.875rem; /* 30px */
  --text-4xl: 2.25rem;  /* 36px */

  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-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: 0.125rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-pill: 999px;

  /* Shadows (soft & friendly) -------------------------------------------- */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);

  /* Transitions ----------------------------------------------------------- */
  --transition-fast: 150ms ease-out;
  --transition-normal: 200ms ease-out;
  --transition-slow: 300ms ease-out;
}

/* Dark mode hook (optional, can be extended in other CSS files) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #020617;
    --color-surface: #020617;
    --color-text: #e5e7eb;
    --color-text-muted: #9ca3af;
    --color-border-subtle: #1f2937;
  }
}


/* ==========================================================================   
   2. RESET & NORMALIZE
   -------------------------------------------------------------------------- */

/* Box sizing and layout --------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
}

/* Remove default margins on typographic elements ------------------------- */
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

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

li {
  list-style: none;
}

/* Media elements are responsive by default ------------------------------- */
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* Form elements inherit fonts -------------------------------------------- */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

/* Reset anchor defaults --------------------------------------------------- */
a {
  text-decoration: none;
  color: inherit;
}

/* Tables ------------------------------------------------------------------ */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Smooth fonts on macOS & iOS -------------------------------------------- */
body,
input,
button,
textarea,
select {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ==========================================================================   
   3. BASE STYLES
   -------------------------------------------------------------------------- */

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background-color: var(--color-bg);
  color: var(--color-text);
}

/* Body wrapper for global layouts can be added in other CSS files */

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

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

h2 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

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

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

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

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

p:last-child {
  margin-bottom: 0;
}

/* Links ------------------------------------------------------------------- */
a {
  color: var(--color-primary);
  transition: color var(--transition-normal),
              opacity var(--transition-fast);
}

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

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

/* Lists ------------------------------------------------------------------- */
ul.list,
ol.list {
  padding-left: 1.25rem;
  margin-bottom: var(--space-3);
}

ul.list li,
ol.list li {
  list-style: disc;
}

/* Strong & emphasis ------------------------------------------------------ */
strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

/* Code -------------------------------------------------------------------- */
code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    'Liberation Mono', 'Courier New', monospace;
}


/* ==========================================================================   
   4. ACCESSIBILITY & MOTION
   -------------------------------------------------------------------------- */

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

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


/* ==========================================================================   
   5. UTILITIES
   -------------------------------------------------------------------------- */

/* Layout containers ------------------------------------------------------ */
.container {
  width: 100%;
  max-width: 1200px;
  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-row {
  flex-direction: row;
}

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

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

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

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

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

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

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

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

.gap-6 {
  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-4);
}

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

/* Spacing utilities ------------------------------------------------------ */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.py-6 {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.p-4 {
  padding: var(--space-4);
}

.p-6 {
  padding: var(--space-6);
}

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

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

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


/* ==========================================================================   
   6. BASIC COMPONENTS
   -------------------------------------------------------------------------- */

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color var(--transition-normal),
    border-color var(--transition-normal),
    color var(--transition-normal),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

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

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary-soft);
  background-image: linear-gradient(135deg, rgba(251, 113, 133, 0.1), transparent);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  background-color: var(--color-primary-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
}

.btn-ghost:hover {
  background-color: rgba(148, 163, 184, 0.12);
}

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

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

/* Inputs & form controls ------------------------------------------------- */
.input,
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: var(--color-surface);
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--color-text);
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              background-color var(--transition-fast);
}

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

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-soft);
}

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

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

.form-field {
  margin-bottom: var(--space-4);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  margin-top: var(--space-1);
}

/* Card component --------------------------------------------------------- */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-4);
}

.card--padded-lg {
  padding: var(--space-6);
}

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

.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--color-text);
}

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

.card-footer {
  margin-top: var(--space-4);
}

/* Simple badge for categories / pet type --------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background-color: var(--color-primary-soft);
  color: var(--color-primary-strong);
}

/* Helper for high-resolution product imagery ----------------------------- */
.product-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--gray-100);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Price styling ---------------------------------------------------------- */
.price {
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-text);
}

.price--old {
  font-size: var(--text-sm);
  color: var(--gray-400);
  text-decoration: line-through;
  margin-left: var(--space-2);
}

.price--highlight {
  color: var(--color-success);
}

/* Notification banners --------------------------------------------------- */
.alert {
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.alert-success {
  background-color: #ecfdf3;
  color: #166534;
}

.alert-warning {
  background-color: #fffbeb;
  color: #92400e;
}

.alert-danger {
  background-color: #fef2f2;
  color: #b91c1c;
}

/* Tagline / microcopy helper (e.g. "Z miłości do zwierząt") ------------- */
.tagline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* End of base.css */
