@layer base {
  :root {
    --cl-indigo: #312e81;
    --cl-teal: #0d9488;
    --cl-amber: #f59e0b;
    --cl-bg: #f9fafb;
    --cl-surface: #ffffff;
    --cl-border: #e5e7eb;
    --cl-text: #0f172a;
    --cl-muted: #475569;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  }

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

  body {
    margin: 0;
    background: var(--cl-bg);
    color: var(--cl-text);
    font-size: 17px;
    line-height: 1.7;
    min-height: 100vh;
  }

  img {
    display: block;
    width: 100%;
  }

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

  h1,
  h2,
  h3,
  h4 {
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 0.5rem;
  }

  p {
    margin: 0 0 0.75rem;
    color: var(--cl-muted);
  }

  .eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--cl-muted);
    margin-bottom: 0.75rem;
  }
}

@layer layout {
  .site-header {
    position: sticky;
    top: 0;
    background: var(--cl-surface);
    z-index: 50;
    border-bottom: 1px solid rgba(14, 165, 233, 0.1);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  }

  .header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    gap: 1rem;
  }

  .site-header .logo {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    color: var(--cl-indigo);
  }

  .primary-nav {
    display: flex;
    gap: 1.25rem;
  }

  .primary-nav a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cl-text);
  }

  .menu-toggle {
    display: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--cl-border);
    background: var(--cl-surface);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--cl-text);
    margin-bottom: 5px;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .menu-toggle span:last-child {
    margin-bottom: 0;
  }

  .menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .mobile-menu {
    position: fixed;
    inset: 0;
    padding-top: 7rem;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    visibility: hidden;
  }

  .mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .mobile-menu a {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
  }

  .menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 48;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.35s ease;
  }

  .menu-open .mobile-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
  }

  .menu-open .menu-backdrop {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  .menu-open {
    overflow: hidden;
  }

  .main-wrapper {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 3rem 2rem 6rem;
  }

  section {
    margin-bottom: 3rem;
    background: transparent;
    border-radius: 18px;
  }

  .section-divider {
    height: 1px;
    width: 100%;
    background: var(--cl-border);
    margin: 2rem 0 2.5rem;
  }

  .hero {
    display: flex;
    align-items: center;
    background: var(--cl-surface);
    border-radius: 24px;
    gap: 2rem;
    padding: 2.5rem;
    border: 1px solid var(--cl-border);
  }

  .hero-content {
    flex: 1;
  }

  .hero-content h1 {
    font-size: clamp(2.2rem, 3vw, 3rem);
    color: var(--cl-text);
  }

  .hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
  }

  .btn {
    display: inline-flex;
    padding: 0.75rem 1.6rem;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    text-align: center;
  }

  .btn-primary {
    background: var(--cl-indigo);
    color: #fff;
  }

  .btn-secondary {
    background: var(--cl-teal);
    color: #fff;
  }

  .btn:hover {
    transform: translateY(-2px);
  }

  .hero-visual {
    flex: 0 0 320px;
    max-width: 320px;
  }

  .media {
    width: 100%;
    aspect-ratio: 5 / 3;
    overflow: hidden;
    border-radius: 14px;
    background: #e9eef5;
  }

  .media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .section-header h2 {
    font-size: clamp(1.8rem, 2vw, 2.4rem);
  }

  .category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
  }

  .label-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    align-items: center;
  }

  .label-grid ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--cl-text);
  }

  .label-grid li {
    margin-bottom: 0.35rem;
  }

  .about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .about-card {
    background: var(--cl-surface);
    border-radius: 20px;
    border: 1px solid var(--cl-border);
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  }

  .category-card {
    background: var(--cl-surface);
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--cl-border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  }

  .category-card h3 {
    font-size: 1.05rem;
    color: var(--cl-indigo);
  }

  .safety-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
  }

  .safety-card {
    background: var(--cl-surface);
    border-radius: 18px;
    border: 1px solid var(--cl-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .safety-card h3 {
    font-size: 1.1rem;
    color: var(--cl-teal);
  }

  .note {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.5);
    font-size: 0.9rem;
    color: var(--cl-text);
  }

  .cta-band {
    background: var(--cl-indigo);
    color: #fff;
    border-radius: 18px;
    padding: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .cta-band .btn {
    background: #fff;
    color: var(--cl-indigo);
  }

  .filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .filter-btn {
    border: 1px solid var(--cl-border);
    border-radius: 14px;
    padding: 0.6rem 1.2rem;
    background: var(--cl-surface);
    font-weight: 600;
    cursor: pointer;
    color: var(--cl-text);
    transition: background 0.3s ease, border-color 0.3s ease;
  }

  .filter-btn.active {
    border-color: var(--cl-indigo);
    background: rgba(49, 46, 129, 0.1);
  }

  .medicine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
  }

  .medicine-card {
    background: var(--cl-surface);
    border: 1px solid var(--cl-border);
    border-radius: 18px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  }

  .medicine-card .medicine-data {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .medicine-card .data-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--cl-border);
    font-size: 0.95rem;
  }

  .medicine-card .data-row:last-child {
    border-bottom: none;
  }

  .data-row span {
    font-weight: 600;
    color: var(--cl-muted);
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 0.6rem;
  }

  .accordion-toggle {
    border: none;
    background: none;
    color: var(--cl-indigo);
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-align: left;
  }

  .accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .accordion-content.open {
    max-height: 400px;
  }

  .accordion-content ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--cl-text);
  }

  .browse-search {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
  }

  .search-field {
    flex: 1;
    min-width: 220px;
  }

  .search-field input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--cl-border);
    border-radius: 12px;
    background: var(--cl-surface);
  }

  .contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    background: var(--cl-surface);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--cl-border);
  }

  .contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .form-field label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
  }

  .form-field input,
  .form-field select,
  .form-field textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--cl-border);
    font-family: inherit;
    font-size: 1rem;
    background: var(--cl-bg);
  }

  .form-field textarea {
    resize: vertical;
    min-height: 140px;
  }

  .form-message {
    min-height: 1.5rem;
    font-weight: 600;
    color: var(--cl-teal);
  }

  .form-message.error {
    color: var(--cl-amber);
  }

  .contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.95rem;
  }

  .contact-details span {
    font-weight: 600;
    color: var(--cl-indigo);
  }

  .footer {
    background: linear-gradient(180deg, #0c1223 0%, #0f172a 60%, #05080f 100%);
    color: #e2e8f0;
    padding: 3rem 1.5rem 1.5rem;
  }

  .footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.25);
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-logo {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.08em;
    color: #f8fafc;
  }

  .footer-brand p {
    color: rgba(226, 232, 240, 0.85);
    max-width: 280px;
  }

  .footer-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    color: rgba(226, 232, 240, 0.65);
    margin-bottom: 0.65rem;
  }

  .footer-inner nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .footer-inner a {
    color: #f8fafc;
    font-weight: 600;
  }

  .footer-inner a:hover {
    color: var(--cl-amber);
  }

  .footer-contact p {
    margin: 0;
    color: rgba(226, 232, 240, 0.8);
  }

  .footer-form {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .footer-form input {
    flex: 1;
    min-width: 180px;
    padding: 0.85rem 1.2rem;
    border-radius: 999px;
    border: none;
    background: #fff;
    color: #0f172a;
    font-size: 0.95rem;
  }

  .footer-form input:focus-visible {
    outline: 2px solid var(--cl-teal);
    outline-offset: 2px;
  }

  .footer-social {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .footer-social a {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(248, 250, 252, 0.4);
  }

  .footer-meta {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(226, 232, 240, 0.6);
  }

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

  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

@layer responsive {
  @media (max-width: 900px) {
    .hero {
      flex-direction: column;
      padding: 2rem;
    }

    .primary-nav {
      display: none;
    }

    .menu-toggle {
      display: flex;
    }

    .main-wrapper {
      padding: 2rem 1.25rem 5rem;
    }
  }

  @media (max-width: 600px) {
    .header-inner {
      padding: 0.75rem 1.25rem;
    }

    .hero {
      padding: 1.5rem;
    }

    .category-card,
    .safety-card,
    .medicine-card {
      padding: 1rem;
    }

    .menu-toggle span {
      margin-bottom: 4px;
    }
    .footer-inner {
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .footer-form {
      flex-direction: column;
    }

    .footer-form button {
      width: 100%;
    }
  }
}
