/* ======================================================================
   TMB Unified Stylesheet
   Purpose:
   - Single shared visual system for TMB themes + plugin front-end output
   - Plugins should output structure/content only
   - This file owns tokens, layout primitives, surfaces, controls, tables,
     notices, and shared bridges for current TMB plugin markup
   ====================================================================== */

:root{
  /* Brand */
  --tmb-primary: #0f2740;
  --tmb-secondary: #cfd7e2;
  --tmb-accent: #f4b400;

  /* Typography */
  --tmb-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tmb-font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --tmb-font-primary: var(--tmb-font-sans);
  --tmb-font-heading: var(--tmb-font-sans);

  /* Text */
  --tmb-text: #0f172a;
  --tmb-text-muted: #475569;
  --tmb-text-soft: #64748b;
  --tmb-text-inverse: #ffffff;

  /* Surfaces */
  --tmb-page-bg: #f8fafc;
  --tmb-surface: #ffffff;
  --tmb-surface-soft: #f8fafc;
  --tmb-surface-tint: #f1f5f9;
  --tmb-surface-elevated: rgba(255,255,255,.82);

  /* Borders */
  --tmb-border: #dbe5ef;
  --tmb-border-strong: #cbd5e1;
  --tmb-border-soft: rgba(15,23,42,.08);

  /* Effects */
  --tmb-shadow-xs: 0 2px 8px rgba(15,23,42,.04);
  --tmb-shadow-sm: 0 8px 18px rgba(15,23,42,.07);
  --tmb-shadow: 0 14px 34px rgba(15,23,42,.10);
  --tmb-shadow-none: none;
  --tmb-blur: 14px;

  /* Radius */
  --tmb-radius-xs: 10px;
  --tmb-radius-sm: 14px;
  --tmb-radius: 18px;
  --tmb-radius-lg: 24px;
  --tmb-radius-xl: 30px;
  --tmb-radius-pill: 999px;

  /* Layout */
  --tmb-content-max: 1200px;
  --tmb-content-wide: 1280px;
  --tmb-content-narrow: 980px;
  --tmb-content-gutter: 18px;
  --tmb-section-space: clamp(48px, 6vw, 88px);
  --tmb-gap-xs: 8px;
  --tmb-gap-sm: 12px;
  --tmb-gap: 18px;
  --tmb-gap-lg: 24px;
  --tmb-gap-xl: 32px;
  --tmb-panel-pad: 24px;

  /* Motion */
  --tmb-duration-fast: .16s;
  --tmb-duration-base: .22s;
  --tmb-ease: ease;
  --tmb-focus: rgba(15,39,64,.18);

  /* Shared aliases for current plugin/theme usage */
  --tmb-color-primary: var(--tmb-primary);
  --tmb-color-secondary: var(--tmb-secondary);
  --tmb-color-accent: var(--tmb-accent);
  --tmb-color-10: var(--tmb-primary);
  --tmb-color-30: var(--tmb-secondary);
  --tmb-text-color: var(--tmb-text);
  --tmb-text-muted-color: var(--tmb-text-muted);
  --tmb-border-color: var(--tmb-border);
  --tmb-surface-card: var(--tmb-surface);
  --tmb-surface-card-soft: var(--tmb-surface-soft);
  --tmb-shadow-card: var(--tmb-shadow);
  --tmb-shadow-soft: var(--tmb-shadow-sm);
  --tmb-radius-base: var(--tmb-radius);

  /* Legacy bridge aliases */
  --kpf-ink: var(--tmb-text);
  --kpf-muted: var(--tmb-text-muted);
  --kpf-white: var(--tmb-surface);
  --kpf-sand: var(--tmb-page-bg);
  --kpf-navy: var(--tmb-primary);
  --kpf-teal: var(--tmb-primary);
  --kpf-lime: var(--tmb-accent);
  --kpf-border: var(--tmb-border);
  --kpf-border-2: var(--tmb-border-strong);
  --kpf-shadow: var(--tmb-shadow);
  --kpf-shadow-soft: var(--tmb-shadow-sm);
  --kpf-radius-sm: var(--tmb-radius-sm);
  --kpf-radius-lg: var(--tmb-radius-lg);
  --kpf-focus: var(--tmb-focus);
  --kpf-glass-bg: var(--tmb-surface-elevated);
  --kpf-glass-bg-2: var(--tmb-surface-soft);
  --kpf-glass-blur: var(--tmb-blur);
  --kpf-font: var(--tmb-font-primary);
}

body{
  background: var(--tmb-page-bg);
  color: var(--tmb-text);
  font-family: var(--tmb-font-primary);
}

/* Optional mode hooks */
body.tmb-theme-mode-dark{
  --tmb-page-bg: #0b1220;
  --tmb-surface: #111827;
  --tmb-surface-soft: #172033;
  --tmb-surface-tint: #0f172a;
  --tmb-surface-elevated: rgba(17,24,39,.82);
  --tmb-text: #f8fafc;
  --tmb-text-muted: #cbd5e1;
  --tmb-text-soft: #94a3b8;
  --tmb-border: rgba(255,255,255,.10);
  --tmb-border-strong: rgba(255,255,255,.16);
  --tmb-shadow-xs: none;
  --tmb-shadow-sm: none;
  --tmb-shadow: none;
  --tmb-focus: rgba(255,255,255,.15);
}

body.tmb-surface-style-minimal{
  --tmb-surface-elevated: var(--tmb-surface);
  --tmb-shadow-sm: none;
  --tmb-shadow: none;
  --tmb-blur: 0px;
}

/* Base box sizing */
.tmb-section,
.tmb-section *,
.tmb-card,
.tmb-card *,
.tmb-grid,
.tmb-grid *,
.tmb-field,
.tmb-field *,
.tmb-form,
.tmb-form *,
.wcrs,
.wcrs *,
.dealer-locator-container,
.dealer-locator-container *{ box-sizing: border-box; }

/* Structural primitives */
.tmb-section{ padding: var(--tmb-section-space) 0; }
.tmb-container{
  width: min(100% - (var(--tmb-content-gutter) * 2), var(--tmb-content-max));
  margin-inline: auto;
}
.tmb-container--wide{ width: min(100% - (var(--tmb-content-gutter) * 2), var(--tmb-content-wide)); }
.tmb-container--narrow{ width: min(100% - (var(--tmb-content-gutter) * 2), var(--tmb-content-narrow)); }
.tmb-stack{ display: grid; gap: var(--tmb-gap); }
.tmb-stack--sm{ gap: var(--tmb-gap-sm); }
.tmb-stack--lg{ gap: var(--tmb-gap-lg); }
.tmb-stack--xl{ gap: var(--tmb-gap-xl); }
.tmb-row{ display:flex; flex-wrap:wrap; gap: var(--tmb-gap); }
.tmb-grid{ display:grid; gap: var(--tmb-gap); }
.tmb-grid--2{ grid-template-columns: repeat(2,minmax(0,1fr)); }
.tmb-grid--3{ grid-template-columns: repeat(3,minmax(0,1fr)); }
.tmb-grid--4{ grid-template-columns: repeat(4,minmax(0,1fr)); }
.tmb-col{ min-width:0; }
.tmb-col--copy{ display:grid; gap: var(--tmb-gap); align-content:start; }
.tmb-col--media{ min-height:100%; }
.tmb-copy{ max-width: 64ch; }
.tmb-copy--narrow{ max-width: 52ch; }
.tmb-copy--center{ margin-inline:auto; text-align:center; }
.tmb-actions{ display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.tmb-center{ text-align:center; }

/* Surface primitives */
.tmb-card{
  background: var(--tmb-surface);
  border: 1px solid var(--tmb-border);
  border-radius: var(--tmb-radius-lg);
  box-shadow: var(--tmb-shadow-sm);
}
.tmb-card--soft{ background: var(--tmb-surface-soft); }
.tmb-card--tint{ background: var(--tmb-surface-tint); }
.tmb-card--bare{ background: transparent; border: 0; box-shadow: none; }
.tmb-panel{ padding: var(--tmb-panel-pad); }
.tmb-media-frame{
  overflow:hidden;
  border-radius: var(--tmb-radius-lg);
  border: 1px solid var(--tmb-border);
  background: var(--tmb-surface);
  box-shadow: var(--tmb-shadow-sm);
}
.tmb-media-frame img{ display:block; width:100%; height:auto; object-fit:cover; }

/* Typography */
.tmb-title,
.tmb-heading{
  margin:0;
  color: var(--tmb-text);
  font-family: var(--tmb-font-heading);
  line-height:1.08;
  letter-spacing:-.03em;
}
.tmb-title--xl{ font-size: clamp(2rem, 4vw, 3.3rem); }
.tmb-title--lg{ font-size: clamp(1.9rem, 3.6vw, 3rem); }
.tmb-title--md{ font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.tmb-eyebrow{
  margin:0;
  color: var(--tmb-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.tmb-text,
.tmb-copy,
.tmb-lead,
.tmb-body{
  color: var(--tmb-text-muted);
  line-height:1.75;
}
.tmb-quote{
  padding: 20px 24px;
  border:1px solid var(--tmb-border);
  border-radius: var(--tmb-radius-lg);
  background: var(--tmb-surface-soft);
  color: var(--tmb-text);
  font-weight:600;
  line-height:1.7;
}

/* Controls */
.tmb-btn,
button.tmb-btn,
a.tmb-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:46px;
  padding:0 18px;
  border-radius: var(--tmb-radius-pill);
  border:1px solid var(--tmb-primary);
  background: var(--tmb-primary);
  color:#fff;
  font-weight:700;
  line-height:1;
  text-decoration:none;
  transition: transform var(--tmb-duration-fast) var(--tmb-ease), opacity var(--tmb-duration-fast) var(--tmb-ease), background var(--tmb-duration-fast) var(--tmb-ease), border-color var(--tmb-duration-fast) var(--tmb-ease);
}
.tmb-btn:hover{ color:#fff; text-decoration:none; opacity:.95; transform: translateY(-1px); }
.tmb-btn--secondary{
  background: var(--tmb-surface);
  color: var(--tmb-text);
  border-color: var(--tmb-border);
}
.tmb-btn--secondary:hover{ color: var(--tmb-text); background: var(--tmb-surface-soft); }
.tmb-btn--ghost{
  background: transparent;
  color: var(--tmb-text);
  border-color: transparent;
}

.tmb-field{ display:grid; gap:8px; }
.tmb-field label{ font-weight:700; color: var(--tmb-text); }
.tmb-input,
.tmb-field input,
.tmb-field textarea,
.tmb-field select,
.wpcf7 input:not([type=submit]),
.wpcf7 textarea,
.wpcf7 select{
  width:100%;
  min-height:46px;
  padding:12px 14px;
  border-radius: var(--tmb-radius);
  border:1px solid var(--tmb-border-strong);
  background:#fff;
  color: var(--tmb-text);
  font: inherit;
}
.tmb-field textarea,
.tmb-input--textarea{ min-height:140px; resize:vertical; }
.tmb-input:focus,
.tmb-field input:focus,
.tmb-field textarea:focus,
.tmb-field select:focus,
.wpcf7 input:not([type=submit]):focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus{
  outline:none;
  border-color: color-mix(in srgb, var(--tmb-primary) 32%, white);
  box-shadow: 0 0 0 3px var(--tmb-focus);
}

/* Notices */
.tmb-notice{
  padding:14px 16px;
  border-radius: var(--tmb-radius);
  border:1px solid var(--tmb-border);
  background: var(--tmb-surface-soft);
  font-weight:600;
}
.tmb-notice--success{ background:#ecfdf5; border-color:#bbf7d0; color:#166534; }
.tmb-notice--error{ background:#fef2f2; border-color:#fecaca; color:#991b1b; }

/* Tables */
.tmb-table-wrap{
  overflow:auto;
  border:1px solid var(--tmb-border);
  border-radius: var(--tmb-radius-lg);
  background: var(--tmb-surface);
  box-shadow: var(--tmb-shadow-sm);
}
.tmb-table,
.woocommerce table.shop_table,
.tmb-tracking__table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  margin:0;
  background: transparent;
}
.tmb-table thead th,
.woocommerce table.shop_table thead th,
.tmb-tracking__table thead th{
  background: var(--tmb-surface-soft);
  color: var(--tmb-text);
  font-weight:800;
  border-bottom:1px solid var(--tmb-border);
}
.tmb-table th,
.tmb-table td,
.woocommerce table.shop_table th,
.woocommerce table.shop_table td,
.tmb-tracking__table th,
.tmb-tracking__table td{
  padding:12px 14px;
  vertical-align:top;
  border-color: var(--tmb-border);
}

/* Hide native title helper */
.tmb-hide-native-title .entry-title,
.tmb-hide-native-title .page-title,
.tmb-hide-native-title .wp-block-post-title{ display:none !important; }

/* ------------------------------------------------------------------
   Shared bridges for current plugin markup
   These keep existing plugin output unified without per-plugin CSS.
   ------------------------------------------------------------------ */

/* Pages */
.tmb-about-page,
.tmb-about-split,
.tmb-contact-page,
.tmb-faq-page,
.tmb-home-cta,
.tmb-home-categories,
.tmb-home-products{ padding: var(--tmb-section-space) 0; color: var(--tmb-text); }
.tmb-about-page__container,
.tmb-about-split__container,
.tmb-contact-page__container,
.tmb-faq-page__container,
.tmb-home-cta__container,
.tmb-home-categories__container,
.tmb-home-products__container{ width:min(100% - (var(--tmb-content-gutter) * 2), var(--tmb-content-max)); margin-inline:auto; }
.tmb-about-page__features{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--tmb-gap); }
.tmb-about-split__features,
.tmb-contact-page__items,
.tmb-faq-page__list{ display:grid; gap:var(--tmb-gap-sm); }
.tmb-about-split__hero,
.tmb-contact-page__grid,
.tmb-home-cta__panel{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--tmb-gap-lg); align-items:center; }
.tmb-about-page__feature,
.tmb-about-split__feature,
.tmb-contact-page__content,
.tmb-contact-page__form-shell,
.tmb-contact-page__item,
.tmb-home-cta__panel,
.tmb-home-products__empty,
.tmb-faq-page__item,
.tmb-about-page__quote,
.tmb-about-split__quote{ background:var(--tmb-surface); border:1px solid var(--tmb-border); border-radius:var(--tmb-radius-lg); box-shadow:var(--tmb-shadow-sm); }
.tmb-about-page__feature,
.tmb-about-split__feature,
.tmb-contact-page__content,
.tmb-contact-page__form-shell,
.tmb-home-cta__panel,
.tmb-home-products__empty{ padding:var(--tmb-panel-pad); }
.tmb-contact-page__item,
.tmb-about-page__quote,
.tmb-about-split__quote{ padding:20px; }
.tmb-about-page__image,
.tmb-about-split__media,
.tmb-contact-page__image,
.tmb-home-cta__media{ overflow:hidden; border-radius:var(--tmb-radius-lg); border:1px solid var(--tmb-border); background:var(--tmb-surface); box-shadow:var(--tmb-shadow-sm); }
.tmb-about-page__image img,
.tmb-about-split__media img,
.tmb-contact-page__image img,
.tmb-home-cta__media img{ display:block; width:100%; height:100%; object-fit:cover; }
.tmb-about-page__button,
.tmb-about-split__button,
.tmb-faq-page__button,
.tmb-home-cta__button,
.tmb-form__submit,
.tmb-home-products__button{ display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:46px; padding:0 18px; border-radius:var(--tmb-radius-pill); text-decoration:none; font-weight:700; }
.tmb-about-page__button,
.tmb-about-split__button,
.tmb-faq-page__button,
.tmb-home-cta__button,
.tmb-form__submit,
.tmb-home-products__button--primary{ background:var(--tmb-primary); border:1px solid var(--tmb-primary); color:#fff; }
.tmb-home-products__button{ background:var(--tmb-surface); border:1px solid var(--tmb-border); color:var(--tmb-text); }
.tmb-home-products__products{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--tmb-gap); list-style:none; padding:0 !important; margin:0 !important; }
.tmb-home-products__products::before,
.tmb-home-products__products::after{ content:none !important; }
.tmb-form__notice--success{ background:#ecfdf5; border:1px solid #bbf7d0; color:#166534; }
.tmb-form__notice--error{ background:#fef2f2; border:1px solid #fecaca; color:#991b1b; }
.tmb-faq-page__question{ width:100%; display:flex; justify-content:space-between; gap:16px; padding:18px 20px; background:transparent; border:0; color:var(--tmb-text); font-weight:700; text-align:left; cursor:pointer; }
.tmb-faq-page__answer{ display:none; padding:0 20px 20px; color:var(--tmb-text-muted); }
.tmb-faq-page__item.is-open .tmb-faq-page__answer{ display:block; }
#tmb-splash{ position:fixed; inset:0; z-index:9999; display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,.96); opacity:0; pointer-events:none; transition:opacity .35s ease; }
#tmb-splash.is-visible{ opacity:1; pointer-events:auto; }
#tmb-splash.is-hidden{ opacity:0; pointer-events:none; }
.tmb-splash__inner{ display:flex; flex-direction:column; align-items:center; gap:14px; padding:28px 34px; border-radius:var(--tmb-radius-lg); background:#fff; border:1px solid var(--tmb-border); box-shadow:var(--tmb-shadow); }
.tmb-splash__logo{ width:min(320px,70vw); height:auto; display:block; }
.tmb-splash__welcome{ margin:0; font-size:15px; letter-spacing:.12em; text-transform:uppercase; font-weight:800; color:var(--tmb-text-soft); }

/* Products search */
.wcrs{ display:flex; flex-direction:column; gap:12px; position:relative; }
.wcrs__field{ width:100%; }
.wcrs__input{ width:100%; box-sizing:border-box; border-radius:var(--tmb-radius-pill); border:1px solid var(--tmb-border-strong); background:var(--tmb-surface-elevated); padding:12px 14px; font-size:16px; font-weight:800; color:var(--tmb-text); outline:none; -webkit-appearance:none; box-shadow:var(--tmb-shadow-xs); }
.wcrs__input::placeholder{ color:color-mix(in srgb, var(--tmb-text) 40%, white); font-weight:800; }
.wcrs__results{ display:flex; flex-direction:column; gap:8px; }
.wcrs__hint{ padding:10px 12px; border-radius:var(--tmb-radius-sm); border:1px solid var(--tmb-border); background:var(--tmb-surface-soft); color:var(--tmb-text-muted); font-weight:800; font-size:13px; }
.wcrs__result{ display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:var(--tmb-radius); border:1px solid var(--tmb-border); background:var(--tmb-surface-elevated); text-decoration:none; color:inherit; box-shadow:var(--tmb-shadow-xs); }
.wcrs__thumb{ width:44px; height:44px; border-radius:12px; overflow:hidden; flex:0 0 auto; border:1px solid var(--tmb-border); background:var(--tmb-surface); display:flex; align-items:center; justify-content:center; }
.wcrs__thumb img{ display:block; width:100%; height:100%; object-fit:cover; }
.wcrs__thumb--ph{ font-weight:900; color:var(--tmb-text-soft); font-size:12px; letter-spacing:.04em; }
.wcrs__text{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.wcrs__title{ font-weight:900; font-size:14px; color:var(--tmb-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wcrs__sub{ font-weight:800; font-size:12px; color:var(--tmb-text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wcrs__chev{ width:18px; height:18px; opacity:.65; flex:0 0 18px; color:var(--tmb-text); }
.wcrs__chev path{ fill:currentColor; }
.wcrs-notice{ border-radius:var(--tmb-radius-sm); border:1px solid var(--tmb-border); background:var(--tmb-surface-elevated); padding:12px 14px; font-weight:800; }
.wcrs-notice--error{ border-color:rgba(179,45,46,.35); color:#b32d2e; }

/* Locations */
.dealer-locator-container{ display:flex; flex-wrap:wrap; gap:20px; padding:40px 20px; background:var(--tmb-page-bg); }
.dealer-locator-container .dealer-list,
.dealer-locator-container .dealer-map{ border-radius:var(--tmb-radius-lg); border:1px solid var(--tmb-border); background:var(--tmb-surface-elevated); backdrop-filter:blur(var(--tmb-blur)); -webkit-backdrop-filter:blur(var(--tmb-blur)); box-shadow:var(--tmb-shadow); overflow:hidden; }
.dealer-locator-container .dealer-list{ flex:1; max-width:30%; height:600px; display:flex; flex-direction:column; }
.dealer-locator-container .dealer-map{ flex:1; min-width:0; min-height:600px; }
.dealer-locator-container .dealer-list-header{ padding:18px; background:var(--tmb-surface-soft); border-bottom:1px solid var(--tmb-border); box-shadow:var(--tmb-shadow-xs); }
.dealer-locator-container .dealer-list h2{ margin:0 0 10px; font-size:20px; line-height:1.2; font-weight:900; letter-spacing:-.01em; color:var(--tmb-primary); }
.dealer-locator-container .search-group{ display:flex; gap:0; margin-top:10px; }
.dealer-locator-container .dealer-search-input,
.dealer-locator-container .distance-filter-select{ min-height:44px; padding:10px 12px; font-size:15px; border:1px solid var(--tmb-border); background:rgba(255,255,255,.86); color:var(--tmb-text); box-shadow:inset 0 1px 2px rgba(15,23,32,.06); }
.dealer-locator-container .dealer-search-input{ flex:1; width:100%; border-right:0; border-radius:var(--tmb-radius-sm) 0 0 var(--tmb-radius-sm); }
.dealer-locator-container .distance-filter-select{ width:140px; border-left:0; border-radius:0 var(--tmb-radius-sm) var(--tmb-radius-sm) 0; }

/* Tracking */
.tmb-tracking{ display:grid; gap:18px; }
.tmb-tracking__heading{ margin:0 0 10px; color:var(--tmb-text); }
.tmb-tracking__table-wrap{ overflow:auto; border:1px solid var(--tmb-border); border-radius:var(--tmb-radius-lg); background:var(--tmb-surface); box-shadow:var(--tmb-shadow-sm); }
.tmb-tracking__table{ width:100%; margin:0; border-collapse:separate; border-spacing:0; }
.tmb-tracking__link,
.tmb-tracking__copy-link{ color:var(--tmb-primary); text-decoration:none; font-weight:700; }
.tmb-tracking__link:hover,
.tmb-tracking__copy-link:hover{ text-decoration:underline; }

/* Responsive */
@media (max-width: 1024px){
  .tmb-grid--4,
  .tmb-home-products__products{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tmb-about-page__features,
  .tmb-grid--3{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px){
  .tmb-grid--2,
  .tmb-grid--3,
  .tmb-grid--4,
  .tmb-about-split__hero,
  .tmb-contact-page__grid,
  .tmb-home-cta__panel{ grid-template-columns:1fr; }
  .tmb-about-split__media,
  .tmb-home-cta__media,
  .tmb-contact-page__form-shell{ order:-1; }
  .dealer-locator-container{ flex-direction:column; }
  .dealer-locator-container .dealer-list{ max-width:none; height:auto; }
}
@media (max-width: 680px){
  :root{ --tmb-content-gutter: 16px; --tmb-panel-pad: 20px; }
  .tmb-home-products__products,
  .tmb-about-page__features,
  .tmb-about-split__features{ grid-template-columns:1fr; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ scroll-behavior:auto !important; transition:none !important; animation:none !important; }
}
