/* Keystone Bathrooms skin: the same Plumbstore/Fayers layout as the other UKPS
   sites, restyled to the live www.keystonebathrooms.co.uk look (read-only GET:
   Astra/Elementor computed colours and screenshots, t256). Tokens, chrome
   contrast, locator colours and a few Keystone-only overrides where base.css
   hard-codes white text on the top bar and footer. No WordPress-shaped layout
   CSS. Fayers placeholder banners are unchanged. */
:root {
  /* Official Astra primary — used as the interactive accent, not as a painted nav. */
  --ks-blue: #0170b9;             /* --ast-global-color-0 */
  --ks-ink: #000000;              /* --ast-global-color-8; computed heading / button / content-link text */
  --ks-body: #4b4f58;             /* --ast-global-color-3; header, nav, footer body */
  --ks-hover: #3a3a3a;            /* --ast-global-color-1 / -2; Astra a:hover */
  --ks-muted-bar: #f5f5f5;        /* --ast-global-color-4; live copyright bar (~#f4f4f4 sampled) */
  --ks-border: #ddd;              /* --ast-border-color; .main-header-bar border */
  --ks-current: #9e9e9e;          /* computed colour of the live current "HOME" nav link */

  --brand-primary: var(--ks-ink);
  --brand-primary-contrast: #ffffff;
  --brand-accent: var(--ks-blue);
  --brand-accent-strong: var(--ks-ink);
  --brand-accent-stronger: var(--ks-hover);
  --brand-nav-bg: #ffffff;        /* live header / nav are white; --ast-global-color-5 */
  --brand-nav-text: var(--ks-body);
  --brand-topbar: #ffffff;
  --brand-ink: var(--ks-ink);
  --brand-footer-strip: #ffffff;  /* live Elementor footer is white, not the unused Astra #3a3a3a overlay */
  --brand-footer-bar: var(--ks-muted-bar);

  --header-bg: #ffffff;
  --action-title: var(--ks-ink);
  --action-sub: var(--ks-body);
  --action-icon: var(--ks-ink);
  --nav-hover-text: var(--ks-ink); /* Astra menu hover / current rule: color:#000 */
  --link: var(--ks-ink);           /* computed content links */
  --link-hover: var(--ks-blue);
  --footer-link-hover: var(--ks-blue);
  --mobile-bar-bg: #ffffff;       /* dark wordmark must stay visible on the mobile bar */
  --drawer-account-bg: var(--ks-ink);
  --drawer-account-text: #ffffff;
  --tile-text: var(--ks-ink);
  --highlight-color: var(--ks-ink); /* accent bar echoes the live footer rule, not a blue merchant stripe */

  --text: var(--ks-body);
  --surface-muted: var(--ks-muted-bar);
  --border: var(--ks-border);
  --font-body: "Montserrat", Arial, Helvetica, sans-serif;
  --logo-width: 260px;
  --logo-max-height: 80px;          /* t263u: 10px clear in the 100px header */
  --compact-logo-width: 151px;     /* 170 * 80/90 */
  --compact-logo-max-height: 46px; /* 52 * 80/90 */
}

/* Top bar and footer: base.css hard-codes color:#fff, which would vanish on a white Keystone chrome. */
.site-header__top {
  color: var(--ks-body);
  /* t258u: 1px hairline under the white top bar, normal and compact.
     #e5e5e5 is live --ast-global-color-6, closest to the sampled live header edge (~#e7e7e7). */
  border-bottom: 1px solid #e5e5e5;
}
.site-footer {
  border-top: 3px solid var(--ks-body); /* sampled live footer rule, rgb(75, 79, 88) */
}
.site-footer__strip,
.site-footer__bar { color: var(--ks-body); }
.site-footer__strip a { color: var(--ks-body); }
.site-footer__strip a:hover,
.site-footer__strip a:focus-visible { color: var(--ks-blue); }
.site-footer__bar { color: #a1a2a1; } /* sampled live copyright text on the #f5f5f5 bar */

/* White nav needs a visible edge and a current-page state (live HOME is #9e9e9e). */
.site-nav { border-block: 1px solid var(--ks-border); }
.site-nav__item.is-active > .site-nav__link { color: var(--ks-current); }
.site-nav__item.is-active:hover > .site-nav__link,
.site-nav__item.is-active > .site-nav__link:focus-visible { color: var(--ks-ink); }
.site-nav__sub a { color: var(--ks-body); }
.site-nav__sub a:hover,
.site-nav__sub a:focus-visible { color: var(--ks-ink); background: var(--ks-muted-bar); }

/* Compact (tablet) burger: a white-on-white control would disappear. */
.site-header__burger {
  background: var(--ks-ink);
  color: #ffffff;
}
.site-header.is-compact .site-nav__item + .site-nav__item { border-top-color: var(--ks-border); }

/* Slider dots: inactive dots use --brand-nav-bg, which is now white. */
.slider__dot {
  background: var(--ks-ink);
  border-color: var(--ks-ink);
}
.slider__dot.is-active {
  background: #ffffff;
  border-color: var(--ks-ink);
}

/* Mobile header bar: 100px, white, so the dark Keystone wordmark stays readable.
   Hairline matches --ast-border-color rather than a 3px blue merchant stripe. */
@media (max-width: 767px) {
  .mobile-bar {
    height: 100px;
    min-height: 100px;
    box-sizing: border-box;
    background: #ffffff;
    border-bottom: 1px solid var(--ks-border);
    padding: 10px 12px;
  }
  .mobile-bar__logo img { max-height: 80px; width: auto; }
}

/* Location Finder (locations6.js, as on MDS): brand-blue links/pills, black headings. */
.location-card__type { color: var(--ks-blue); }
#ukps-map-wrapper { --nav-link-color: #0170b9; --secondary-color: #000000; }
#ukps-map-wrapper h1.ukps-locations-h1 { color: var(--ks-ink); }
#ukps-map-wrapper #ukps-stores-list .ukps-store h3 { color: var(--ks-ink); }

/* t260u / t261u: Keystone Bathrooms marketing page. Scoped to .ks-bath so other
   CMS pages are untouched. Palette is the t256 chrome: white, black, slate,
   Montserrat, #0170b9 accent. */
.ks-bath {
  --ks-wrap: calc(var(--container, 1280px) + 2 * var(--gutter, 15px));
  color: var(--ks-body, #4b4f58);
  background: #ffffff;
  font-family: var(--font-body);
}
.ks-bath .ks-wrap {
  width: 100%;
  max-width: var(--ks-wrap);
  margin-inline: auto;
  padding-inline: max(20px, var(--gutter, 15px));
  box-sizing: border-box;
}
.ks-bath h1,
.ks-bath h2,
.ks-bath h3 {
  margin: 0 0 .5em;
  color: var(--ks-ink, #000);
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.15;
}
.ks-bath h1 { font-size: clamp(2.1rem, 5.5vw, 4rem); font-weight: 200; letter-spacing: -0.03em; }
.ks-bath h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.ks-bath h3 { font-size: 1.05rem; letter-spacing: 0; }
.ks-bath p { margin: 0 0 1em; line-height: 1.65; }
.ks-bath p:last-child { margin-bottom: 0; }
.ks-kicker {
  margin: 0 0 .75rem;
  color: var(--ks-blue, #0170b9);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.ks-lead { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 36em; }
.ks-intro { max-width: 40em; margin-bottom: 2rem; }

.ks-actions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; margin-top: 1.75rem; }
.ks-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font: 700 .9rem/1 var(--font-body);
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.ks-btn--accent { background: var(--ks-blue, #0170b9); color: #fff; }
.ks-btn--accent:hover,
.ks-btn--accent:focus-visible { background: #015a94; color: #fff; }
.ks-btn--ghost { background: transparent; color: #fff; border-color: #fff; }
.ks-btn--ghost:hover,
.ks-btn--ghost:focus-visible { background: #fff; color: var(--ks-ink, #000); }
.ks-btn--light { background: #fff; color: var(--ks-ink, #000); }
.ks-btn--light:hover,
.ks-btn--light:focus-visible { background: var(--ks-muted-bar, #f5f5f5); color: var(--ks-ink, #000); }
.ks-cta .ks-btn--ghost { border-color: rgba(255,255,255,.7); }

/* Hero */
.ks-hero {
  position: relative;
  isolation: isolate;
  min-height: min(78vh, 720px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
  background: #111;
}
.ks-hero__media {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 60% 50%;
  z-index: 0;
}
.ks-hero__shade {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.5) 38%, rgba(0,0,0,.18) 62%, rgba(0,0,0,.06) 100%),
    linear-gradient(180deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.5) 100%);
}
.ks-hero__copy {
  position: relative; z-index: 2;
  padding-block: clamp(3.5rem, 10vw, 7rem);
  max-width: var(--ks-wrap);
}
/* t269u: beat any leftover CMS typography; white light/regular type, roomy
   line-height, and a light shadow so the copy stays readable on the photo. */
.ks-hero .ks-kicker,
.ks-hero h1,
.ks-hero .ks-lead {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.55), 0 6px 18px rgba(0,0,0,.35);
}
.ks-hero .ks-kicker { color: #fff; }
.ks-hero h1 {
  color: #fff;
  max-width: 12em;
  font-weight: 200;
  line-height: 1.2;
}
.ks-hero .ks-lead { color: rgba(255,255,255,.92); }

/* Alternating image / text */
.ks-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
  background: #fff;
}
.ks-split--muted { background: var(--ks-muted-bar, #f5f5f5); }
.ks-split--flip .ks-split__media { order: 2; }
.ks-split__media { min-height: 320px; overflow: hidden; }
.ks-split__media img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ks-split__copy {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem);
}

/* How we work */
.ks-process { padding: clamp(3rem, 7vw, 5.5rem) 0; background: #fff; }
.ks-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem 1.25rem;
  counter-reset: ks-step;
}
.ks-steps li {
  counter-increment: ks-step;
  padding-top: 1rem;
  border-top: 2px solid var(--ks-ink, #000);
}
.ks-steps li::before {
  content: counter(ks-step, decimal-leading-zero);
  display: block;
  margin-bottom: .75rem;
  color: var(--ks-blue, #0170b9);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .08em;
}
.ks-steps h3 { margin-bottom: .4rem; }
.ks-steps p { font-size: .95rem; }

/* Projects */
.ks-projects { padding: clamp(3rem, 7vw, 5.5rem) 0; background: var(--ks-muted-bar, #f5f5f5); }
.ks-projects__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.ks-projects__grid li { background: #fff; }
.ks-projects__grid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.ks-projects__grid h3 { margin: 0; padding: 1rem 1.1rem 1.15rem; font-size: 1rem; }

/* Gallery */
.ks-gallery { padding: clamp(3rem, 7vw, 5.5rem) 0; background: #fff; }
.ks-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .6rem;
}
.ks-grid a {
  display: block; overflow: hidden; background: var(--ks-muted-bar, #f5f5f5);
  aspect-ratio: 1 / 1;
}
.ks-grid img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s ease;
}
.ks-grid a:hover img,
.ks-grid a:focus-visible img { transform: scale(1.04); }

/* CTA + form */
.ks-cta {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  background: var(--ks-ink, #000);
  color: #fff;
  text-align: center;
}
.ks-cta h2 { color: #fff; line-height: 1.2; }
.ks-cta p { max-width: 32em; margin-inline: auto; color: rgba(255,255,255,.86); }
.ks-cta .ks-actions { justify-content: center; }
.ks-form { padding: clamp(3rem, 7vw, 5.5rem) 0 4.5rem; background: #fff; }
.ks-form__frame {
  display: block; width: 100%;
  min-height: 650px;
  border: 1px solid var(--ks-border, #ddd);
  background: #fff;
}

.ks-anchor { display: block; height: 0; overflow: hidden; }

/* t267u: supplier brochure logo grid (live www.keystonebathrooms.co.uk/supplier-brochures/).
   t270u: 10 tiles, so 5 columns on desktop (two even rows) and 2 on small screens. */
.ks-brochures { padding: clamp(3rem, 7vw, 5.5rem) 0 4.5rem; background: var(--ks-muted-bar, #f5f5f5); }
.ks-brochures .ks-intro { max-width: 36em; }
.ks-brochures__grid {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
.ks-brochures__card {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--ks-border, #ddd);
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ks-brochures__card:hover,
.ks-brochures__card:focus-visible {
  border-color: var(--ks-ink, #000);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.ks-brochures__card:focus-visible { outline: 2px solid var(--ks-blue, #0170b9); outline-offset: 2px; }
.ks-brochures__card img {
  max-width: 100%; max-height: 72%;
  width: auto; height: auto;
  object-fit: contain;
  display: block;
}
/* Light/silver logos (Esteem) sit on a black panel inside the white card, like Grohe/Roca. */
.ks-brochures__panel {
  display: flex; align-items: center; justify-content: center;
  width: 72%; height: 72%;
  padding: 12% 10%;
  box-sizing: border-box;
  background: #000;
}
.ks-brochures__card--panel { padding: 1.25rem; }
.ks-brochures__card--panel img,
.ks-brochures__panel img {
  max-width: 100%; max-height: 100%;
}

@media (max-width: 900px) {
  .ks-split,
  .ks-split--flip .ks-split__media { display: block; }
  .ks-split--flip .ks-split__media { order: 0; }
  .ks-split__media { height: 260px; min-height: 0; }
  .ks-steps { grid-template-columns: 1fr; gap: 0; }
  .ks-steps li { border-top: 1px solid var(--ks-border, #ddd); padding: 1.25rem 0; }
  .ks-projects__grid { grid-template-columns: 1fr; }
  .ks-hero { min-height: min(70vh, 560px); align-items: flex-end; }
  .ks-hero__shade {
    background:
      linear-gradient(180deg, rgba(0,0,0,.18) 15%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.82) 100%);
  }
}
@media (max-width: 700px) {
  .ks-brochures__grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
}
@media (max-width: 600px) {
  .ks-grid { grid-template-columns: repeat(2, 1fr); gap: .4rem; }
  .ks-form__frame { min-height: 790px; }
}
@media (max-width: 490px) {
  .ks-form__frame { min-height: 860px; }
}

/* Scroll fade-ins; honour reduced motion. */
.ks-reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .ks-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s ease, transform .7s ease;
  }
  .ks-reveal.is-in { opacity: 1; transform: none; }
}

/* Lightbox */
.ks-lightbox {
  position: fixed; inset: 0; z-index: 400;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.88);
  border: 0;
  width: 100%; height: 100%;
  max-width: none; max-height: none;
}
.ks-lightbox[open] { display: flex; }
.ks-lightbox::backdrop { background: transparent; }
.ks-lightbox[hidden] { display: none; }
.ks-lightbox__img {
  max-width: min(1200px, 100%);
  max-height: calc(100vh - 120px);
  width: auto; height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.ks-lightbox__caption {
  position: absolute; left: 0; right: 0; bottom: 16px;
  margin: 0; text-align: center;
  color: #fff; font-size: .9rem; letter-spacing: .04em;
}
.ks-lightbox__btn {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border: 0; border-radius: 2px;
  background: rgba(255,255,255,.12); color: #fff;
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.ks-lightbox__btn:hover,
.ks-lightbox__btn:focus-visible { background: var(--ks-blue, #0170b9); }
.ks-lightbox__prev { left: 12px; }
.ks-lightbox__next { right: 12px; }
.ks-lightbox__close {
  top: 16px; right: 16px; left: auto;
  transform: none;
  font-size: 1.4rem;
}
@media (prefers-reduced-motion: reduce) {
  .ks-grid img, .ks-btn { transition: none; }
}


/* t262u: outline My Account icon (stroked circle + person, ~1.5px, never filled on hover). */
.site-actions a[href="/account/dashboard"] .site-action__icon,
.sb-dock a[href="/account/dashboard"] .material-icons {
  position: relative;
  display: inline-block;
  width: 1em;
  height: 1em;
  overflow: hidden;
  color: transparent; /* hide the filled Material ligature */
}
.site-actions a[href="/account/dashboard"] .site-action__icon {
  font-size: var(--action-icon-size, 32px);
}
.site-header.is-compact .site-actions a[href="/account/dashboard"] .site-action__icon {
  font-size: 26px;
}
.sb-dock a[href="/account/dashboard"] .material-icons {
  font-size: 24px;
}
.site-actions a[href="/account/dashboard"] .site-action__icon::before,
.sb-dock a[href="/account/dashboard"] .material-icons::before,
.mobile-drawer__account-link::before {
  content: "";
  display: block;
  background-color: var(--action-icon, #000);
  -webkit-mask: url("/themes/keystone/img/icon-account.svg") no-repeat center / contain;
  mask: url("/themes/keystone/img/icon-account.svg") no-repeat center / contain;
}
.site-actions a[href="/account/dashboard"] .site-action__icon::before,
.sb-dock a[href="/account/dashboard"] .material-icons::before {
  position: absolute;
  inset: 0;
}
.site-actions a[href="/account/dashboard"]:hover .site-action__icon::before,
.site-actions a[href="/account/dashboard"]:focus-visible .site-action__icon::before {
  background-color: var(--action-icon, #000); /* stay outline, not filled */
}
.sb-dock a[href="/account/dashboard"] .material-icons::before {
  background-color: var(--text, #1c1c1b);
}
.sb-dock a[href="/account/dashboard"]:hover .material-icons::before,
.sb-dock a[href="/account/dashboard"]:focus-visible .material-icons::before {
  background-color: var(--text, #1c1c1b);
}
.mobile-drawer__account-link::before {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  background-color: currentColor;
}


/* t265u: invert the Sparesbase-style social icons for the white Keystone top bar.
   Same filled currentColor SVGs, painted black; hover uses the #0170b9 accent.
   The mobile drawer account block is black, so those icons stay white and only the hover changes. */
.site-header__social-link { color: var(--ks-ink); }
.site-header__social-link:hover,
.site-header__social-link:focus-visible {
  color: var(--ks-blue);
  opacity: 1;
}
.mobile-drawer__account .mobile-drawer__social-link:hover,
.mobile-drawer__account .mobile-drawer__social-link:focus-visible {
  color: var(--ks-blue);
  opacity: 1;
}
