/* === Per-Directory Master CSS === */
/* Template: modern */
/* Last synced to Sanity: 2026-02-19T06:06:15.456903+00:00 */

/* --- Base CSS --- */
/**
 * Base CSS Framework for Directory Templates
 * Provides shared variables, CSS reset, and responsive utilities
 * All templates inherit from this base
 */

/* ============================================
   CSS Variables - Workspace Override Architecture
   ============================================ */
:root {
  /* Brand Colors - workspace settings override via inline style injection */
  --brand-primary: var(--workspace-primary, #1a1a1a);
  --brand-accent: var(--workspace-accent, #0066cc);
  --brand-background: var(--workspace-background, #ffffff);
  --brand-text: var(--workspace-text, #1a1a1a);
  --brand-surface: var(--workspace-surface, #f8f9fa);
  --brand-border: var(--workspace-border, #e5e7eb);

  /* Header/Footer Theme Colors - workspace settings override */
  --brand-header-bg: var(--workspace-header-bg, var(--brand-surface));
  --brand-header-text: var(--workspace-header-text, var(--brand-text));
  --brand-footer-bg: var(--workspace-footer-bg, var(--brand-surface));
  --brand-footer-text: var(--workspace-footer-text, var(--brand-text));

  /* Breadcrumb Colors - workspace settings override */
  --brand-breadcrumb-text: var(--workspace-breadcrumb-text, var(--brand-text));
  --brand-breadcrumb-separator: var(
    --workspace-breadcrumb-separator,
    var(--brand-border)
  );

  /* Status Colors - workspace settings override */
  --brand-status-available: var(--workspace-status-available, #22c55e);
  --brand-status-unavailable: var(--workspace-status-unavailable, #ef4444);

  /* Typography */
  --font-family-heading: var(
    --workspace-font-heading,
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif
  );
  --font-family-body: var(
    --workspace-font-body,
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif
  );

  /* Font Sizes - Fluid Typography Scale */
  --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --font-size-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --font-size-base: clamp(1rem, 0.925rem + 0.375vw, 1.125rem);
  --font-size-lg: clamp(1.125rem, 1rem + 0.625vw, 1.375rem);
  --font-size-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.625rem);
  --font-size-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2.25rem);
  --font-size-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 3rem);
  --font-size-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 4rem);

  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Spacing Scale */
  --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;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl:
    0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal: 400;
  --z-tooltip: 500;

  /* Container Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1440px;
}

/* ============================================
   CSS Reset - Modern Normalize
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  font-family: var(--font-family-body);
  font-feature-settings: normal;
  font-variation-settings: normal;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  line-height: inherit;
  background-color: var(--brand-background);
  color: var(--brand-text);
}

hr {
  height: 0;
  color: inherit;
  border-top-width: 1px;
  border-color: var(--brand-border);
}

abbr:where([title]) {
  text-decoration: underline dotted;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
  font-family: var(--font-family-heading);
}

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

b,
strong {
  font-weight: bolder;
}

code,
kbd,
samp,
pre {
  font-family:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
  font-feature-settings: normal;
  font-variation-settings: normal;
  font-size: 1em;
}

small {
  font-size: 80%;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

table {
  text-indent: 0;
  border-color: inherit;
  border-collapse: collapse;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button,
select {
  text-transform: none;
}

button,
input:where([type="button"]),
input:where([type="reset"]),
input:where([type="submit"]) {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
}

:-moz-focusring {
  outline: auto;
}

:-moz-ui-invalid {
  box-shadow: none;
}

progress {
  vertical-align: baseline;
}

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

[type="search"] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}

::-webkit-search-decoration {
  -webkit-appearance: none;
}

::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}

summary {
  display: list-item;
}

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

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

dialog {
  padding: 0;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: color-mix(in srgb, var(--brand-primary) 50%, transparent);
}

button,
[role="button"] {
  cursor: pointer;
}

:disabled {
  cursor: default;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  vertical-align: middle;
}

img,
video {
  max-width: 100%;
  height: auto;
}

[hidden]:where(:not([hidden="until-found"])) {
  display: none;
}

/* ============================================
   Responsive Utilities
   ============================================ */

/* Container */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 640px) {
  .container {
    max-width: var(--container-sm);
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

@media (min-width: 1440px) {
  .container {
    max-width: var(--container-2xl);
  }
}

/* Visually Hidden - Accessible hiding */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Visible - Accessibility */
:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Skip Link - Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand-accent);
  color: white;
  padding: var(--space-2) var(--space-4);
  z-index: var(--z-tooltip);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   Common Layout Patterns
   ============================================ */

/* Flex utilities */
.flex {
  display: flex;
}

.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-1 {
  gap: var(--space-1);
}
.gap-2 {
  gap: var(--space-2);
}
.gap-3 {
  gap: var(--space-3);
}
.gap-4 {
  gap: var(--space-4);
}
.gap-6 {
  gap: var(--space-6);
}
.gap-8 {
  gap: var(--space-8);
}

/* Grid utilities */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sm\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Text utilities */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.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;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Spacing utilities */
.m-auto {
  margin: auto;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

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

.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}
.py-6 {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}
.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}
.py-12 {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}
.py-16 {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.px-4 {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}
.px-6 {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.mt-4 {
  margin-top: var(--space-4);
}
.mt-6 {
  margin-top: var(--space-6);
}
.mt-8 {
  margin-top: var(--space-8);
}

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

/* ============================================
   Directory Component Styles (.dir-* prefix)
   These match HTML template class names
   ============================================ */

/* Page Layout */
.dir-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dir-skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand-accent);
  color: white;
  padding: var(--space-2) var(--space-4);
  z-index: var(--z-tooltip);
  transition: top var(--transition-fast);
  text-decoration: none;
}

.dir-skip-link:focus {
  top: 0;
}

/* Header */
.dir-header {
  padding: var(--space-4) 0;
  background-color: var(--brand-background);
  border-bottom: 1px solid var(--brand-border);
}

.dir-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 1024px) {
  .dir-header-inner {
    padding: 0 var(--space-8);
  }
}

.dir-logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
}

.dir-logo {
  max-height: 48px;
  max-width: 180px;
  object-fit: contain;
}

.dir-logo-text {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--brand-primary);
}

/* Navigation */
.dir-nav {
  display: flex;
  gap: var(--space-4);
}

.dir-nav a {
  font-size: var(--font-size-sm);
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.dir-nav a:hover {
  color: var(--brand-accent);
}

/* Breadcrumbs */
.dir-breadcrumb {
  padding: var(--space-3) 0;
  background-color: var(--brand-surface);
  border-bottom: 1px solid var(--brand-border);
}

.dir-breadcrumb-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 1024px) {
  .dir-breadcrumb-inner {
    padding: 0 var(--space-8);
  }
}

.dir-breadcrumb-list {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dir-breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.dir-breadcrumb-link {
  font-size: var(--font-size-sm);
  color: var(--brand-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.dir-breadcrumb-link:hover {
  color: color-mix(in srgb, var(--brand-accent) 80%, black);
  text-decoration: underline;
}

.dir-breadcrumb-separator {
  color: var(--brand-border);
  font-size: var(--font-size-sm);
}

.dir-breadcrumb-current {
  font-size: var(--font-size-sm);
  color: var(--brand-primary);
}

/* Main Content */
.dir-main {
  flex: 1;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
  width: 100%;
}

@media (min-width: 1024px) {
  .dir-main {
    padding: var(--space-8);
  }
}

/* Footer */
.dir-footer {
  padding: var(--space-6) 0;
  background-color: var(--brand-surface);
  border-top: 1px solid var(--brand-border);
  margin-top: auto;
}

.dir-footer-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}

@media (min-width: 640px) {
  .dir-footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .dir-footer-inner {
    padding: 0 var(--space-8);
  }
}

.dir-footer-text {
  font-size: var(--font-size-sm);
  color: color-mix(in srgb, var(--brand-primary) 60%, transparent);
}

/* Grid Layouts */
.dir-grid {
  display: grid;
  gap: var(--space-6);
}

.dir-grid-product {
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .dir-grid-product {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }
}

.dir-grid-products {
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-6);
}

@media (min-width: 640px) {
  .dir-grid-products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .dir-grid-products {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
  }
}

@media (min-width: 1280px) {
  .dir-grid-products {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Product Gallery */
.dir-product-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dir-gallery-main {
  aspect-ratio: 1 / 1;
  background-color: var(--brand-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dir-gallery-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dir-gallery-thumbnails {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
}

.dir-gallery-thumb {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: none;
  padding: 0;
  transition: border-color var(--transition-fast);
}

.dir-gallery-thumb:hover,
.dir-gallery-thumb.active {
  border-color: var(--brand-accent);
}

.dir-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product Info */
.dir-product-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dir-product-brand {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-1);
}

.dir-product-brand a {
  color: var(--brand-accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-weight-medium);
}

.dir-product-brand a:hover {
  text-decoration: underline;
}

.dir-product-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--brand-primary);
  line-height: var(--line-height-tight);
  margin: 0;
}

.dir-product-price-block {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.dir-product-price {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--brand-primary);
}

.dir-product-original-price {
  font-size: var(--font-size-base);
  color: color-mix(in srgb, var(--brand-primary) 50%, transparent);
  text-decoration: line-through;
}

.dir-product-availability {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--brand-primary);
}

.dir-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand-status-available);
}

.dir-status-dot.dir-status-unavailable {
  background-color: var(--brand-status-unavailable);
}

.dir-product-short-desc {
  font-size: var(--font-size-base);
  color: color-mix(in srgb, var(--brand-primary) 80%, transparent);
  line-height: var(--line-height-relaxed);
}

.dir-product-features {
  list-style: disc;
  padding-left: var(--space-6);
  margin: var(--space-2) 0;
}

.dir-product-features li {
  font-size: var(--font-size-sm);
  color: color-mix(in srgb, var(--brand-primary) 80%, transparent);
  margin-bottom: var(--space-1);
}

.dir-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.dir-product-meta {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--brand-border);
}

.dir-meta-row {
  display: flex;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-1);
}

.dir-meta-row dt {
  color: color-mix(in srgb, var(--brand-primary) 60%, transparent);
}

.dir-meta-row dd {
  color: var(--brand-primary);
  margin: 0;
}

/* Card Component */
.dir-card {
  background-color: var(--brand-background);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dir-card-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--brand-border);
  background-color: var(--brand-surface);
}

.dir-card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--brand-primary);
  margin: 0;
}

.dir-card-body {
  padding: var(--space-6);
}

/* Section Component */
.dir-section {
  margin-bottom: var(--space-8);
}

.dir-section-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--brand-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--brand-border);
}

/* Table Styles */
.dir-table {
  width: 100%;
  border-collapse: collapse;
}

.dir-table th,
.dir-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--brand-border);
}

.dir-table-specs th {
  width: 35%;
  font-weight: var(--font-weight-medium);
  color: color-mix(in srgb, var(--brand-primary) 70%, transparent);
  background-color: var(--brand-surface);
}

.dir-table-label {
  font-weight: var(--font-weight-medium);
}

/* Product Card (for listings) */
.dir-product-card {
  display: flex;
  flex-direction: column;
  background-color: var(--brand-background);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.dir-product-card:hover {
  border-color: var(--brand-accent);
  box-shadow: var(--shadow-md);
}

.dir-product-card-image {
  aspect-ratio: 4 / 3;
  background-color: var(--brand-surface);
  overflow: hidden;
}

.dir-product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.dir-product-card:hover .dir-product-card-image img {
  transform: scale(1.02);
}

.dir-product-card-title {
  padding: var(--space-4);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--brand-primary);
  margin: 0;
}

.dir-product-card-title a {
  color: inherit;
  text-decoration: none;
}

.dir-product-card-title a:hover {
  color: var(--brand-accent);
}

.dir-product-card-price {
  padding: 0 var(--space-4) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--brand-primary);
}

/* Button Component */
.dir-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.dir-btn-primary {
  background-color: var(--brand-accent);
  color: white;
  border-color: var(--brand-accent);
}

.dir-btn-primary:hover {
  background-color: color-mix(in srgb, var(--brand-accent) 85%, black);
  border-color: color-mix(in srgb, var(--brand-accent) 85%, black);
}

.dir-btn-secondary {
  background-color: var(--brand-background);
  color: var(--brand-primary);
  border-color: var(--brand-border);
}

.dir-btn-secondary:hover {
  background-color: var(--brand-surface);
  border-color: var(--brand-accent);
}

.dir-btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--font-size-base);
}

/* Prose Content */
.dir-prose {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: color-mix(in srgb, var(--brand-primary) 85%, transparent);
}

.dir-prose p {
  margin-bottom: var(--space-4);
}

.dir-prose h1,
.dir-prose h2,
.dir-prose h3,
.dir-prose h4 {
  font-weight: var(--font-weight-semibold);
  color: var(--brand-primary);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.dir-prose h1 {
  font-size: var(--font-size-2xl);
  margin-top: 0;
}

.dir-prose h2 {
  font-size: var(--font-size-xl);
}

.dir-prose h3 {
  font-size: var(--font-size-lg);
}

.dir-prose ul,
.dir-prose ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.dir-prose li {
  margin-bottom: var(--space-2);
}

.dir-prose a {
  color: var(--brand-accent);
  text-decoration: underline;
}

.dir-prose a:hover {
  color: color-mix(in srgb, var(--brand-accent) 80%, black);
}

/* Back to Top */
.dir-back-to-top {
  display: inline-block;
  margin-top: var(--space-8);
  font-size: var(--font-size-sm);
  color: var(--brand-accent);
  text-decoration: none;
}

.dir-back-to-top:hover {
  text-decoration: underline;
}

/* Format Links */
.dir-format-links {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--brand-border);
}

/* ============================================
   Legacy CSS Classes (Story 38.4b)
   Pre-rendered HTML sections use these class names.
   Tech Debt: Refactor to .dir-* naming convention.
   ============================================ */

/* Legacy contact-info CSS (business pages) */
.contact-info {
  margin: 2em 0;
  padding: 1.5em;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}
.contact-info h2 {
  margin: 0 0 1em 0;
  font-size: 1.1em;
  color: #333;
  font-weight: 600;
}
.contact-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5em 1em;
  margin: 0;
}
.contact-info dt {
  font-weight: 600;
  color: #555;
}
.contact-info dd {
  margin: 0;
}
.contact-info a {
  color: #1976d2;
  text-decoration: none;
}
.contact-info a:hover {
  text-decoration: underline;
}

/* Legacy extended-info CSS (business details) */
.extended-info {
  margin: 2em 0;
  padding: 1.5em;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}
.extended-info h2 {
  margin: 0 0 1em 0;
  font-size: 1.1em;
  color: #333;
  font-weight: 600;
}
.extended-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5em 1em;
  margin: 0;
}
.extended-info dt {
  font-weight: 600;
  color: #555;
}
.extended-info dd {
  margin: 0;
}
.extended-info a {
  color: #1976d2;
  text-decoration: none;
}
.extended-info a:hover {
  text-decoration: underline;
}

/* Legacy custom-attributes CSS (additional business info) */
.custom-attributes {
  margin: 2em 0;
  padding: 1.5em;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}
.custom-attributes h2 {
  margin: 0 0 1em 0;
  font-size: 1.1em;
  color: #333;
  font-weight: 600;
}
.custom-attributes h3 {
  margin: 1.5em 0 0.5em 0;
  font-size: 0.95em;
  color: #495057;
  font-weight: 600;
}
.custom-attributes h3:first-child {
  margin-top: 0;
}
.custom-attributes dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5em 1em;
  margin: 0 0 1em 0;
}
.custom-attributes dt {
  font-weight: 600;
  color: #555;
}
.custom-attributes dd {
  margin: 0;
}

/* Legacy attribute-category CSS */
.attribute-category {
  margin-bottom: 1.5em;
}
.attribute-category:last-child {
  margin-bottom: 0;
}

/* Legacy breadcrumbs CSS */
.breadcrumbs {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 1.5em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid #eee;
}
.breadcrumbs a {
  color: #1976d2;
  text-decoration: none;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}
.breadcrumb-separator {
  margin: 0 0.5em;
  color: #999;
}

/* Legacy format-links CSS */
.format-links {
  margin-top: 2em;
  padding: 1em;
  background: #f5f5f5;
  border-radius: 4px;
}
.format-links a {
  color: #1976d2;
  text-decoration: none;
  margin: 0 0.5em;
}
.format-links a:hover {
  text-decoration: underline;
}

/* Legacy page-metadata CSS */
.page-metadata {
  margin-top: 2em;
  padding: 1em;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 0.85em;
  color: #666;
}
.page-metadata p {
  margin: 0.25em 0;
}

/* Legacy product-facts CSS */
.product-facts {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}
.product-facts h2 {
  margin: 0 0 15px 0;
  font-size: 1.2em;
  color: #1e293b;
}
.product-facts dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
}
.product-facts dt {
  font-weight: 600;
  color: #475569;
}
.product-facts dd {
  margin: 0;
  color: #1e293b;
}

/* Legacy openai-spec-section CSS */
.openai-spec-section {
  margin: 30px 0;
  padding: 20px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
}
.openai-spec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}
.openai-spec-header h3 {
  margin: 0;
  color: #0369a1;
  font-size: 1.1em;
}
.view-json-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: #0ea5e9;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9em;
  transition: background 0.2s;
}
.view-json-button:hover {
  background: #0284c7;
}
.brand-info {
  margin: 10px 0;
  padding: 8px 12px;
  background: white;
  border-radius: 4px;
  font-size: 0.95em;
}
.brand-missing {
  color: #92400e;
  background: #fef3c7;
}
.json-preview {
  margin: 15px 0 0 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}
.json-preview summary {
  padding: 12px 16px;
  background: #f8f9fa;
  cursor: pointer;
  font-weight: 600;
  color: #1976d2;
}
.json-preview summary:hover {
  background: #e3f2fd;
}
.json-preview pre {
  margin: 0;
  padding: 16px;
  background: #1e1e1e;
  color: #d4d4d4;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.5;
}
.json-preview code {
  font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Legacy nav-tree CSS */
.nav-tree {
  margin-top: 3em;
  padding: 1.5em;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}
.nav-tree h3 {
  margin: 0 0 1em 0;
  font-size: 1em;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tree-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.9em;
}
.tree-list ul {
  list-style: none;
  padding-left: 1.5em;
  margin: 0.25em 0;
  border-left: 1px solid #dee2e6;
}
.tree-item {
  padding: 0.3em 0;
}
.tree-item.current {
  font-weight: bold;
}
.tree-item.current span {
  background: #e3f2fd;
  padding: 2px 8px;
  border-radius: 4px;
  color: #1976d2;
}
.tree-children {
  list-style: none;
  margin-top: 0.5em;
}
.tree-branch,
.tree-leaf {
  padding: 0.2em 0;
}
.tree-leaf::before {
  content: "• ";
  color: #adb5bd;
}
.nav-tree a {
  color: #1976d2;
  text-decoration: none;
}
.nav-tree a:hover {
  text-decoration: underline;
}
.nav-tree details {
  margin: 0.25em 0;
}
.nav-tree summary {
  cursor: pointer;
  padding: 0.3em 0;
  color: #495057;
  font-weight: 500;
}
.nav-tree summary:hover {
  color: #1976d2;
}
.nav-tree summary::marker {
  color: #adb5bd;
}
.nav-tree summary a {
  font-weight: 500;
}
.nav-tree details[open] > summary {
  margin-bottom: 0.25em;
}
.openai-spec-link {
  margin-left: 0.5em;
  font-size: 0.85em;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.openai-spec-link:hover {
  background: #bae6fd;
}

/* Legacy table-of-contents CSS */
.table-of-contents {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5em;
  margin: 1.5em 0;
}
.table-of-contents h2 {
  margin: 0 0 1em 0;
  font-size: 1.1em;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.table-of-contents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.table-of-contents li {
  padding: 0.3em 0;
}
.table-of-contents a {
  color: #1976d2;
  text-decoration: none;
}
.table-of-contents a:hover {
  text-decoration: underline;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}


/* --- Template: modern --- */
/**
 * Modern Crisp Template
 * Tech-forward design with clean lines, badges, and contemporary UI patterns.
 * Based on target: modern-crisp theme
 *
 * Overrides base.css .dir-* styles with modern-specific theming
 */

/* ============================================
   Modern Template Variables
   Inherits from workspace brand settings via base.css cascade
   ============================================ */
:root {
  /* Modern Crisp Colors - Inherit from workspace or use template defaults */
  --modern-background: var(--brand-background, #f8fafc);
  --modern-background-card: #ffffff;
  --modern-foreground: var(--brand-text, #0f172a);
  /* Derive muted from brand-text for consistent theming */
  --modern-muted: color-mix(
    in srgb,
    var(--brand-text, #0f172a) 60%,
    transparent
  );
  /* Derive border from brand-border for consistent theming */
  --modern-border: var(--brand-border, #e2e8f0);
  --modern-primary: var(--brand-primary, #eab308);
  --modern-primary-dark: color-mix(in srgb, var(--modern-primary) 85%, black);

  /* Header/Footer Theme Colors - Controllable via workspace settings */
  --modern-header-bg: var(--brand-header-bg, #ffffff);
  --modern-header-text: var(--brand-header-text, var(--modern-foreground));
  --modern-footer-bg: var(--brand-footer-bg, #ffffff);
  --modern-footer-text: var(--brand-footer-text, var(--modern-muted));

  /* Breadcrumb Colors - Controllable via workspace settings */
  --modern-breadcrumb-text: var(--brand-breadcrumb-text, var(--modern-muted));
  --modern-breadcrumb-separator: var(
    --brand-breadcrumb-separator,
    var(--modern-border)
  );

  /* Status Colors - Controllable via workspace settings */
  --modern-status-available: var(--brand-status-available, #16a34a);
  --modern-status-unavailable: var(--brand-status-unavailable, #ef4444);

  /* Typography - Inherit from workspace or use template defaults */
  --modern-font-heading: var(
    --font-family-heading,
    "Open Sans",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif
  );
  --modern-font-body: var(
    --font-family-body,
    "Open Sans",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif
  );

  /* Shadows */
  --modern-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
  --modern-shadow-card-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Page - Light gray background
   ============================================ */
.dir-page {
  background-color: var(--modern-background);
  font-family: var(--modern-font-body);
  color: var(--modern-foreground);
}

/* ============================================
   Header - White with yellow accent bar
   ============================================ */
.dir-header {
  background-color: var(--modern-header-bg);
  border-bottom: 1px solid var(--modern-border);
  padding: 1rem 0;
}

.dir-header::after {
  /* Yellow accent bar below header */
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    135deg,
    var(--modern-primary) 0%,
    var(--modern-primary-dark) 100%
  );
}

.dir-header-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
}

.dir-logo {
  max-height: 48px;
  max-width: 160px;
}

.dir-logo-text {
  font-family: var(--modern-font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--modern-primary-dark);
  letter-spacing: normal;
}

.dir-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--modern-header-text) 60%, transparent);
}

.dir-nav a {
  color: color-mix(in srgb, var(--modern-header-text) 60%, transparent);
  font-weight: 500;
  transition: color 0.2s;
}

.dir-nav a:hover {
  color: var(--modern-header-text);
}

/* ============================================
   Main Content - Wide modern layout
   ============================================ */
.dir-main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ============================================
   Breadcrumbs - Clean modern style
   ============================================ */
.dir-breadcrumb {
  padding: 0.5rem 0;
  background-color: var(--modern-background);
  border-bottom: 1px solid var(--modern-border);
}

.dir-breadcrumb-inner {
  max-width: 72rem;
  margin: 0 auto;
}

.dir-breadcrumb-item a {
  color: var(--modern-breadcrumb-text);
  font-size: 0.875rem;
}

.dir-breadcrumb-item a:hover {
  color: var(--modern-foreground);
}

.dir-breadcrumb-separator {
  color: var(--modern-breadcrumb-separator);
}

.dir-breadcrumb-current {
  color: var(--modern-foreground);
  font-weight: 500;
}

/* ============================================
   Section Titles - Bold sans-serif
   ============================================ */
.dir-section-title {
  font-family: var(--modern-font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--modern-foreground);
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.5rem;
}

/* ============================================
   Cards - Clean white with subtle borders
   ============================================ */
.dir-card {
  background-color: var(--modern-background-card);
  border: 1px solid var(--modern-border);
  border-radius: 0.75rem;
  box-shadow: none;
  transition: box-shadow 0.2s;
}

.dir-card:hover {
  box-shadow: var(--modern-shadow-card-hover);
}

.dir-card-header {
  background-color: transparent;
  border-bottom: none;
  padding: 1.5rem 1.5rem 0;
}

.dir-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--modern-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.dir-card-body {
  padding: 1.5rem;
}

/* ============================================
   Badges - Verified Business style
   ============================================ */
.dir-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--modern-status-available);
}

.dir-badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--modern-status-available);
  border-radius: 9999px;
}

/* ============================================
   Info Rows - Space between layout
   ============================================ */
.dir-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 0.625rem 0;
  font-size: 0.875rem;
}

/* ============================================
   Links - Gold accent color
   ============================================ */
.dir-card a,
.dir-prose a {
  color: var(--modern-primary-dark);
  text-decoration: none;
}

.dir-card a:hover,
.dir-prose a:hover {
  text-decoration: underline;
}

/* ============================================
   Buttons - Rounded with gradient CTA
   ============================================ */
.dir-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.dir-btn-primary {
  background: linear-gradient(
    135deg,
    var(--modern-primary) 0%,
    var(--modern-primary-dark) 100%
  );
  color: var(--modern-foreground);
  border: none;
}

.dir-btn-primary:hover {
  box-shadow: var(--modern-shadow-card-hover);
}

.dir-btn-secondary {
  background-color: transparent;
  border: 1px solid var(--modern-border);
  color: var(--modern-foreground);
}

.dir-btn-secondary:hover {
  background-color: var(--modern-background);
}

/* ============================================
   Tags/Pills - Yellow background pills
   ============================================ */
.dir-tag {
  padding: 0.375rem 0.75rem;
  background-color: #fef9c3;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--modern-primary-dark);
}

/* ============================================
   Tables - Clean modern lines
   ============================================ */
.dir-table {
  font-size: 0.875rem;
}

.dir-table th,
.dir-table td {
  padding: 0.625rem 0;
  border-bottom: none;
}

.dir-table th {
  color: var(--modern-muted);
  font-weight: 400;
}

.dir-table td {
  color: var(--modern-foreground);
  font-weight: 500;
  text-align: right;
}

.dir-table-specs th {
  background-color: transparent;
}

/* ============================================
   Product Gallery - Modern rounded
   ============================================ */
.dir-gallery-main {
  border-radius: 0.75rem;
  border: 1px solid var(--modern-border);
}

.dir-gallery-thumb {
  border-radius: 0.5rem;
  border-color: var(--modern-border);
}

.dir-gallery-thumb:hover {
  border-color: var(--modern-primary);
}

.dir-gallery-thumb.active {
  border-color: var(--modern-primary);
}

/* ============================================
   Product Info - Modern typography
   ============================================ */
.dir-product-brand a {
  color: var(--modern-primary-dark);
  font-size: 0.875rem;
  font-weight: 500;
}

.dir-product-title {
  font-family: var(--modern-font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--modern-foreground);
}

.dir-product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--modern-foreground);
}

.dir-product-original-price {
  color: var(--modern-muted);
}

.dir-product-short-desc {
  font-size: 1.125rem;
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.6;
}

/* ============================================
   Product Cards - Modern hover
   ============================================ */
.dir-product-card {
  background-color: var(--modern-background-card);
  border: 1px solid var(--modern-border);
  border-radius: 0.75rem;
  box-shadow: none;
  transition: box-shadow 0.2s;
}

.dir-product-card:hover {
  box-shadow: var(--modern-shadow-card-hover);
}

.dir-product-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--modern-foreground);
}

.dir-product-card-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--modern-foreground);
}

/* ============================================
   Prose Content
   ============================================ */
.dir-prose {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--modern-foreground);
}

.dir-prose h1,
.dir-prose h2,
.dir-prose h3 {
  font-family: var(--modern-font-heading);
  font-weight: 700;
  color: var(--modern-foreground);
}

/* ============================================
   Status Indicators
   ============================================ */
.dir-status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--modern-status-available);
}

.dir-status-dot.dir-status-unavailable {
  background-color: var(--modern-status-unavailable);
}

/* ============================================
   Footer - Clean white with border
   ============================================ */
.dir-footer {
  background-color: var(--modern-footer-bg);
  border-top: 1px solid var(--modern-border);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.dir-footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dir-footer-text {
  font-size: 0.875rem;
  color: var(--modern-footer-text);
}

.dir-footer a {
  color: var(--modern-footer-text);
}

.dir-footer a:hover {
  color: color-mix(in srgb, var(--modern-footer-text) 100%, black 30%);
}

/* ============================================
   Format Links & Back to Top
   ============================================ */
.dir-format-links a {
  color: var(--modern-muted);
  font-size: 0.875rem;
}

.dir-back-to-top {
  color: var(--modern-muted);
  font-size: 0.875rem;
  background-color: transparent;
  padding: 0;
}

.dir-back-to-top:hover {
  color: var(--modern-foreground);
}

/* ============================================
   Grid Layouts - Modern spacing
   ============================================ */
.dir-grid-products {
  gap: 1.5rem;
}
