@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 0 0% 9%;
    --primary: 0 0% 9%;
    --primary-foreground: 0 0% 98%;
    --secondary: 0 0% 96%;
    --secondary-foreground: 0 0% 9%;
    --muted: 0 0% 96%;
    --muted-foreground: 0 0% 45%;
    --accent: 0 0% 96%;
    --accent-foreground: 0 0% 9%;
    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 90%;
    --input: 0 0% 90%;
    --ring: 0 0% 9%;
    --card: 0 0% 100%;
    --card-foreground: 0 0% 9%;
    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 9%;
    --radius: 0.5rem;
  }

  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground antialiased;
  }
}

@layer components {
  /*
   * Merchant-authored HTML (a product description). Dependency-free on purpose: the Tailwind
   * typography plugin is not installed, so the old `prose` classes did nothing and a heading
   * read as body text and a list lost its bullets. Logical properties only, so it flips in RTL.
   */
  .prose-store {
    @apply text-[0.95rem] leading-7 text-muted-foreground;
    overflow-wrap: anywhere;
  }
  .prose-store > :first-child {
    @apply mt-0;
  }
  .prose-store > :last-child {
    @apply mb-0;
  }
  .prose-store p {
    @apply mb-3;
  }
  .prose-store strong,
  .prose-store b {
    @apply font-semibold text-foreground;
  }
  .prose-store h1,
  .prose-store h2,
  .prose-store h3,
  .prose-store h4 {
    @apply mb-2 mt-6 font-semibold leading-snug text-foreground;
  }
  .prose-store h1 {
    @apply text-2xl;
  }
  .prose-store h2 {
    @apply text-xl;
  }
  .prose-store h3 {
    @apply text-lg;
  }
  .prose-store h4 {
    @apply text-base;
  }
  .prose-store ul {
    @apply mb-3 list-disc ps-5;
  }
  .prose-store ol {
    @apply mb-3 list-decimal ps-5;
  }
  .prose-store li {
    @apply mb-1;
  }
  .prose-store blockquote {
    @apply mb-3 border-s-2 ps-4 italic;
  }
  .prose-store a {
    @apply text-primary underline underline-offset-2;
  }
  .prose-store img {
    @apply my-3 h-auto max-w-full rounded-md;
  }
  .prose-store table {
    @apply mb-3 w-full border-collapse text-sm;
  }
  .prose-store th,
  .prose-store td {
    @apply border px-2 py-1 text-start;
  }
}
