/* base.css — Reset, custom properties, typography, base elements */

/* ---- Custom Properties ---- */

:root {
  /* Pharmacy green palette */
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;

  /* Neutral palette */
  --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: #1f2937;
  --gray-900: #111827;

  /* Accent colors */
  --red-50:  #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-800: #991b1b;

  --yellow-50:  #fefce8;
  --yellow-100: #fef9c3;
  --yellow-700: #a16207;
  --yellow-800: #854d0e;

  --blue-100: #dbeafe;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;

  --orange-600: #ea580c;

  /* Semantic tokens */
  --color-text:       var(--gray-900);
  --color-text-secondary: var(--gray-500);
  --color-text-muted: var(--gray-400);
  --color-bg:         #fff;
  --color-bg-alt:     var(--gray-50);
  --color-border:     var(--gray-200);
  --color-border-light: var(--gray-100);

  --color-primary:      var(--green-700);
  --color-primary-hover: var(--green-800);

  --color-link:       var(--blue-600);
  --color-link-hover: var(--blue-700);

  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --text-xs:  0.75rem;
  --text-sm:  0.875rem;
  --text-base: 1rem;
  --text-lg:  1.125rem;
  --text-xl:  1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  --leading-tight:   1.25;
  --leading-normal:  1.5;
  --leading-relaxed: 1.625;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius:    0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);

  /* Category placeholder colors */
  --color-category-vitaminas-suplementos: #d1fae5;
  --color-category-dermocosmetica:        #fce7f3;
  --color-category-cuidado-solar:         #fef3c7;
  --color-category-higiene-pessoal:       #dbeafe;
  --color-category-saude-oral:            #cffafe;
  --color-category-bebe-crianca:          #ede9fe;
  --color-category-cabelo:                #f3e8ff;
  --color-category-saude-bem-estar:       #fee2e2;
  --color-category-corpo-hidratacao:      #e0f2fe;
  --color-category-nutricao-desportiva:   #ffedd5;
  --color-category-primeiros-socorros:    #fef2f2;
  --color-category-veterinaria:           #fef9c3;
}


/* ---- Reset ---- */

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

* {
  margin: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  cursor: pointer;
}

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

ul, ol {
  list-style: none;
  padding: 0;
}

table {
  border-collapse: collapse;
}

h1, h2, h3, h4 {
  line-height: var(--leading-tight);
  font-weight: 700;
}


/* ---- Base Typography ---- */

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

p + p { margin-top: var(--space-4); }

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

strong { font-weight: 600; }

.text-muted    { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link {
  color: var(--color-link);
  text-decoration: underline;
}
.link:hover {
  color: var(--color-link-hover);
}

.link-subtle {
  color: var(--color-text-secondary);
}
.link-subtle:hover {
  color: var(--color-text);
}


/* ---- Visibility ---- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── View transitions ──────────────────────────────────────────────── */

::view-transition-old(root) {
  animation: fade-out 0.15s ease-in;
}
::view-transition-new(root) {
  animation: fade-in 0.15s ease-out;
}
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
