/* SS Motors SEO & Sales – front end. Colours follow the Drivco theme variables. */
:root {
  --ssm-accent: var(--primary-color1, #34fcf6);
  --ssm-ink: var(--title-color, #072227);
  --ssm-wa: #0f7b3e;
  --ssm-line: rgba(7, 34, 39, .14);
  --ssm-soft: #f3f8f8;
  --ssm-error: #b42318;
  --ssm-ok: #0f7b3e;
  --ssm-radius: 6px;
}

/* Buttons */
.ssm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border: 1px solid var(--ssm-ink); border-radius: var(--ssm-radius);
  background: #fff; color: var(--ssm-ink); font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s;
}
.ssm-btn:hover, .ssm-btn:focus-visible { background: var(--ssm-ink); color: #fff; }
.ssm-btn--primary { background: var(--ssm-accent); border-color: var(--ssm-accent); color: var(--ssm-ink); }
.ssm-btn--primary:hover, .ssm-btn--primary:focus-visible { background: var(--ssm-ink); border-color: var(--ssm-ink); color: #fff; }
.ssm-btn--wa { background: var(--ssm-wa); border-color: var(--ssm-wa); color: #fff; }
.ssm-btn--wa:hover, .ssm-btn--wa:focus-visible { background: #0b5e2f; border-color: #0b5e2f; color: #fff; }
.ssm-btn svg, .ssm-bar-btn svg, .ssm-form-car svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.ssm-btn:focus-visible, .ssm-bar-btn:focus-visible { outline: 3px solid var(--ssm-ink); outline-offset: 2px; }

/* Car page: buttons under the contact block */
.ssm-side { display: grid; gap: 10px; margin: -30px 0 40px; }
.ssm-side .ssm-btn { width: 100%; }

/* About this car */
.ssm-about { margin-bottom: 50px; }
.ssm-about-title { font-size: 22px; font-weight: 600; margin: 0; color: var(--ssm-ink); }
.ssm-about-body p { margin: 0 0 14px; line-height: 1.7; }
.ssm-about-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0 0; padding: 0; list-style: none; }
.ssm-about-links a { color: var(--ssm-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ssm-about:not(.ssm-placed), .ssm-intro:not(.ssm-placed) { max-width: 1140px; margin: 40px auto; padding: 0 15px; }

/* Listing intro */
.ssm-intro { margin: 0 0 30px; }
.ssm-intro h2 { font-size: 24px; margin: 0 0 10px; color: var(--ssm-ink); }
.ssm-intro p { margin: 0; line-height: 1.7; max-width: 860px; }

/* Mobile action bar */
.ssm-bar { display: none; }
@media (max-width: 991px) {
  .ssm-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990; display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -4px 18px rgba(0, 0, 0, .12);
  }
  .ssm-bar-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 6px;
    border: 0; border-radius: var(--ssm-radius); font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
  }
  .ssm-bar-call { background: var(--ssm-ink); color: #fff; }
  .ssm-bar-wa { background: var(--ssm-wa); color: #fff; }
  .ssm-bar-enq { background: var(--ssm-accent); color: var(--ssm-ink); }
  body.ssm-has-bar { padding-bottom: 72px; }
  .ssm-dialog-open .ssm-bar { display: none; }
}

/* Enquiry dialog */
.ssm-dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 10px;
  color: var(--ssm-ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); overflow: auto;
}
.ssm-dialog::backdrop { background: rgba(7, 34, 39, .6); }
.ssm-dialog:not([open]) { display: none; }
.ssm-dialog[open] { position: fixed; inset: 0; margin: auto; z-index: 99999; }

/* Form */
.ssm-form { position: relative; padding: 26px 24px 22px; background: #fff; }
.ssm-form--inline { padding: 24px; border: 1px solid var(--ssm-line); border-radius: 10px; max-width: 640px; }
.ssm-form-title { margin: 0 34px 6px 0; font-size: 24px; line-height: 1.2; color: var(--ssm-ink); }
.ssm-form-car { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 10px 12px; background: var(--ssm-soft); border-radius: var(--ssm-radius); font-weight: 600; }
.ssm-form-car[hidden] { display: none; }
.ssm-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--ssm-soft); color: var(--ssm-ink); font-size: 26px; line-height: 1; cursor: pointer; }
.ssm-close:hover { background: var(--ssm-line); }
.ssm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ssm-row[hidden], .ssm-field[hidden], .ssm-form [hidden] { display: none !important; }
@media (max-width: 520px) { .ssm-row { grid-template-columns: 1fr; } }
.ssm-field { margin: 0 0 14px; }
.ssm-field > label { display: block; margin: 0 0 5px; font-size: 14px; font-weight: 600; }
.ssm-form input[type="text"], .ssm-form input[type="tel"], .ssm-form input[type="email"], .ssm-form select, .ssm-form textarea {
  display: block; width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid rgba(7, 34, 39, .35); border-radius: var(--ssm-radius);
  background: #fff; color: #1d2327; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 16px; line-height: 1.4; text-transform: none;
}
.ssm-form textarea { min-height: 84px; resize: vertical; }
.ssm-form input:focus, .ssm-form select:focus, .ssm-form textarea:focus { outline: 3px solid var(--ssm-accent); outline-offset: 0; border-color: var(--ssm-ink); }
.ssm-form [aria-invalid="true"] { border-color: var(--ssm-error); }
.ssm-err { display: block; margin-top: 5px; color: var(--ssm-error); font-size: 13px; font-weight: 600; line-height: 1.4; }
.ssm-consent label { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; font-weight: 400; line-height: 1.5; }
.ssm-consent input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--ssm-ink); }
.ssm-consent a { color: inherit; text-decoration: underline; }
.ssm-form button[type="submit"] { width: 100%; margin-top: 4px; }
.ssm-form button[disabled] { opacity: .7; cursor: wait; }
.ssm-form-msg { margin: 12px 0 0; font-weight: 600; }
.ssm-form-msg:empty { display: none; }
.ssm-form-msg.is-error { color: var(--ssm-error); }
.ssm-form-msg.is-success { color: var(--ssm-ok); font-size: 16px; line-height: 1.6; }
.ssm-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Shortcodes */
.ssm-stock { display: grid; gap: 24px; margin: 20px 0 30px; }
.ssm-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ssm-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ssm-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 991px) { .ssm-cols-3, .ssm-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .ssm-stock { grid-template-columns: 1fr; } }
.ssm-card .product-img img { width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; }
.ssm-card .features { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0; list-style: none; }
.ssm-empty { padding: 16px; background: var(--ssm-soft); border-radius: var(--ssm-radius); }
.ssm-dealer { padding: 20px; background: var(--ssm-soft); border-radius: 10px; }
.ssm-dealer p { margin: 0 0 10px; }
.ssm-map { margin-top: 14px; aspect-ratio: 16 / 9; border-radius: var(--ssm-radius); overflow: hidden; }
.ssm-map iframe { width: 100%; height: 100%; border: 0; }
.ssm-area { margin: 0 0 24px; }
.ssm-brands { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; list-style: none; }
.ssm-brands span { opacity: .7; }

@media (prefers-reduced-motion: reduce) { .ssm-btn { transition: none; } }
