/* PlumbingSoftwares.com — Global Design System */
:root {
  --navy: #0B1F3A;
  --navy-deep: #071526;
  --blue: #1769E0;
  --blue-hover: #1254b8;
  --blue-light: #EEF5FF;
  --blue-mid: #B8D4F8;
  --white: #FFFFFF;
  --text: #152238;
  --muted: #5E6B7A;
  --border: #DCE5F0;
  --bg: #F7FAFC;
  --green: #0D9488;
  --green-bg: #F0FDFA;
  --orange: #D97706;
  --orange-bg: #FFFBEB;
  --red: #DC2626;
  --red-bg: #FEF2F2;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(11,31,58,0.06), 0 1px 2px rgba(11,31,58,0.04);
  --shadow-md: 0 4px 12px rgba(11,31,58,0.08);
  --shadow-lg: 0 12px 32px rgba(11,31,58,0.12);
  --max: 1200px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 64px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 1000; background: var(--white); border-bottom: 1px solid var(--border); height: var(--header-h); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 1rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; color: var(--navy); text-decoration: none; }
.logo:hover { text-decoration: none; color: var(--blue); }
.logo-mark { width: 32px; height: 32px; background: var(--blue); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-size: 0.85rem; font-weight: 800; }
.nav-desktop { display: none; align-items: center; gap: 0.25rem; }
.nav-desktop a, .nav-desktop button.nav-link { color: var(--text); font-weight: 500; font-size: 0.9rem; padding: 0.5rem 0.85rem; border-radius: var(--radius-sm); background: none; border: none; cursor: pointer; font-family: inherit; }
.nav-desktop a:hover, .nav-desktop button.nav-link:hover { background: var(--blue-light); text-decoration: none; color: var(--blue); }
.btn-cta { background: var(--blue) !important; color: var(--white) !important; padding: 0.5rem 1.1rem !important; border-radius: var(--radius-sm); font-weight: 600 !important; }
.btn-cta:hover { background: var(--blue-hover) !important; text-decoration: none !important; }
.menu-toggle { display: flex; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.45rem; cursor: pointer; }
.menu-toggle svg { width: 22px; height: 22px; stroke: var(--navy); }

/* Mega menu */
.mega-wrap { position: relative; }
.mega-menu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1.25rem; min-width: 640px; grid-template-columns: repeat(2, 1fr); gap: 0.35rem 1.5rem; z-index: 100; }
.mega-wrap.open .mega-menu, .mega-wrap:focus-within .mega-menu { display: grid; }
.mega-menu a { display: block; padding: 0.55rem 0.75rem; border-radius: var(--radius-sm); color: var(--text); font-size: 0.9rem; font-weight: 500; }
.mega-menu a:hover { background: var(--blue-light); color: var(--blue); text-decoration: none; }

/* Mobile nav */
.mobile-nav { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: var(--white); z-index: 999; overflow-y: auto; padding: 1rem 1.25rem 2rem; }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 0.75rem 0; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 500; }
.mobile-nav .mob-cat { font-weight: 600; color: var(--navy); margin-top: 1rem; padding-top: 0.5rem; }
.mobile-nav .mob-sub a { padding-left: 1rem; font-weight: 400; font-size: 0.9rem; }

@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .menu-toggle { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.7rem 1.4rem; border: none; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.15s; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--blue-light); border-color: var(--blue-mid); }

/* Cards */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; transition: box-shadow 0.15s, border-color 0.15s; }
.card:hover { box-shadow: var(--shadow-md); border-color: var(--blue-mid); }
.card h3 { font-size: 1.05rem; color: var(--navy); margin-bottom: 0.4rem; }
.card p { font-size: 0.9rem; color: var(--muted); margin: 0; }
.card a.stretched { text-decoration: none; color: inherit; }
.card a.stretched:hover { text-decoration: none; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.grid-5 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.cat-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 600px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cat-grid { grid-template-columns: repeat(5, 1fr); } }

/* Hero */
.hero { background: linear-gradient(135deg, var(--navy) 0%, #0d2d56 50%, #123a6e 100%); color: var(--white); padding: 2.5rem 0 3rem; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.25rem); font-weight: 750; line-height: 1.2; margin-bottom: 0.75rem; }
.hero .lead { font-size: 1.1rem; opacity: 0.9; max-width: 560px; margin-bottom: 1.5rem; }
.search-box { display: flex; background: var(--white); border-radius: var(--radius); overflow: hidden; max-width: 520px; box-shadow: var(--shadow-lg); }
.search-box input { flex: 1; border: none; padding: 0.9rem 1.1rem; font-size: 1rem; font-family: inherit; color: var(--text); outline: none; }
.search-box button { background: var(--blue); color: white; border: none; padding: 0 1.25rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.search-box button:hover { background: var(--blue-hover); }
.trust-row { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 1.5rem; font-size: 0.9rem; opacity: 0.85; }
.trust-row span { display: flex; align-items: center; gap: 0.35rem; }
.search-results { display: none; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 0.5rem; max-width: 520px; max-height: 320px; overflow-y: auto; box-shadow: var(--shadow-lg); }
.search-results.open { display: block; }
.search-results a { display: block; padding: 0.7rem 1rem; color: var(--text); border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.search-results a:hover { background: var(--blue-light); text-decoration: none; }
.search-results .sr-cat { font-size: 0.75rem; color: var(--muted); }

/* Sections */
.section { padding: 2.5rem 0; }
.section-title { font-size: 1.4rem; color: var(--navy); margin-bottom: 0.35rem; }
.section-sub { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.95rem; }
.section-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.section-header h2 { margin: 0; }

/* Category card */
.cat-card { text-align: center; padding: 1.35rem 1rem; }
.cat-card .icon { width: 44px; height: 44px; margin: 0 auto 0.75rem; background: var(--blue-light); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--blue); font-size: 1.25rem; }
.cat-card h3 { font-size: 0.9rem; margin-bottom: 0.25rem; }
.cat-card p { font-size: 0.8rem; }

/* Tool card */
.tool-card { display: flex; flex-direction: column; gap: 0.35rem; }
.tool-card .badge { display: inline-block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--blue); background: var(--blue-light); padding: 0.2rem 0.5rem; border-radius: 4px; width: fit-content; }

/* Footer */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.8); padding: 3rem 0 1.5rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.site-footer h4 { color: var(--white); font-size: 0.9rem; margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.site-footer a { color: rgba(255,255,255,0.7); font-size: 0.875rem; display: block; padding: 0.25rem 0; }
.site-footer a:hover { color: var(--white); }
.footer-brand { font-weight: 700; font-size: 1.1rem; color: var(--white); margin-bottom: 0.5rem; }
.footer-desc { font-size: 0.875rem; line-height: 1.6; max-width: 280px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.25rem; font-size: 0.8rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; }

/* Breadcrumb */
.breadcrumb { padding: 1rem 0 0.5rem; font-size: 0.875rem; color: var(--muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 0.35rem; color: var(--border); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 500; }

/* Page content */
.page-header { padding: 0.5rem 0 1.5rem; }
.page-header h1 { font-size: clamp(1.5rem, 3.5vw, 1.9rem); color: var(--navy); margin-bottom: 0.5rem; }
.page-header .lead { color: var(--muted); max-width: 70ch; }

/* Content blocks */
.content-block { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.content-block h2 { font-size: 1.2rem; color: var(--navy); margin-bottom: 0.75rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--border); }

/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.filter-bar button { padding: 0.4rem 0.9rem; border: 1px solid var(--border); background: var(--white); border-radius: 20px; font-size: 0.85rem; font-weight: 500; cursor: pointer; font-family: inherit; color: var(--muted); }
.filter-bar button.active, .filter-bar button:hover { background: var(--blue); color: white; border-color: var(--blue); }

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mb-2 { margin-bottom: 1rem; }
