/* =====================================================================
   Essex Home Garden Rooms - [ehgr_finishes] cladding & decking viewer.
   Markup: inc/ehgr-finishes.php. Behaviour: ehgr-finishes.js.
   Tokens come from ehgr.css. Every <button> sets its own :hover/:focus
   colours because Hello Elementor turns buttons pink on hover and focus.
   ===================================================================== */
.ehgr .ehgr-fin { color: var(--ehgr-ink); }

/* Heading block */
.ehgr .ehgr-fin-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: clamp(24px, 3vw, 36px); }
@media (min-width: 900px) { .ehgr .ehgr-fin-head { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: end; gap: 48px; } }
.ehgr .ehgr-fin-eyebrow { margin: 0 0 14px; font-family: var(--ehgr-manrope); font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--ehgr-gold); line-height: 1.4; }
.ehgr .ehgr-fin-title { margin: 0; font-family: var(--ehgr-jakarta); font-weight: 700; font-size: clamp(32px, 4vw, 56px); line-height: 1.05; letter-spacing: -.02em; color: var(--ehgr-ink); text-wrap: balance; }
.ehgr .ehgr-fin-intro { margin: 0; font-family: var(--ehgr-manrope); font-size: clamp(15px, 1.15vw, 17px); line-height: 1.6; color: var(--ehgr-muted); }

/* Range tabs */
.ehgr .ehgr-fin-tabs { display: flex; gap: 8px; margin: 0 0 20px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px; }
.ehgr .ehgr-fin-tabs::-webkit-scrollbar { display: none; }
.ehgr .ehgr-fin-tab { flex: 0 0 auto; scroll-snap-align: start; appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--ehgr-border-soft); background: transparent; color: var(--ehgr-ink-2); font-family: var(--ehgr-manrope); font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; transition: border-color .3s, color .3s, background .3s; }
.ehgr .ehgr-fin-tab:hover, .ehgr .ehgr-fin-tab:focus { background: transparent; border-color: var(--ehgr-gold); color: var(--ehgr-ink); }
.ehgr .ehgr-fin-tab:focus-visible { outline: 2px solid var(--ehgr-gold); outline-offset: 2px; }
.ehgr .ehgr-fin-tab.is-active, .ehgr .ehgr-fin-tab.is-active:hover, .ehgr .ehgr-fin-tab.is-active:focus { background: var(--ehgr-gold); border-color: var(--ehgr-gold); color: var(--ehgr-bg); }
.ehgr .ehgr-fin-tabcount { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: rgba(241,235,225,0.08); font-family: var(--ehgr-mono); font-size: 11px; font-weight: 600; color: var(--ehgr-muted); }
.ehgr .ehgr-fin-tab.is-active .ehgr-fin-tabcount { background: rgba(11,11,11,0.16); color: var(--ehgr-bg); }

/* Layout */
.ehgr .ehgr-fin-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1000px) { .ehgr .ehgr-fin-body { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: stretch; } }

/* Stage */
.ehgr .ehgr-fin-stage { margin: 0; min-width: 0; }
.ehgr .ehgr-fin-frame { position: relative; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; background: var(--ehgr-surface-2); border: 1px solid var(--ehgr-hairline); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ehgr .ehgr-fin-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; transition: opacity .3s var(--ehgr-ease); }
.ehgr .ehgr-fin-frame.is-swapping .ehgr-fin-img { opacity: .35; }
.ehgr .ehgr-fin-frame::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgba(11,11,11,0.82) 0%, rgba(11,11,11,0.35) 26%, rgba(11,11,11,0) 48%), linear-gradient(to bottom, rgba(11,11,11,0.45) 0%, rgba(11,11,11,0) 22%); }

.ehgr .ehgr-fin-label { font-style: normal; text-align: left; position: absolute; z-index: 2; left: clamp(16px, 2.4vw, 28px); bottom: clamp(16px, 2.4vw, 26px); right: 90px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ehgr .ehgr-fin-range { font-family: var(--ehgr-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ehgr-gold); }
.ehgr .ehgr-fin-name { font-family: var(--ehgr-jakarta); font-weight: 700; font-size: clamp(24px, 2.6vw, 38px); line-height: 1.05; letter-spacing: -.01em; color: #fff; text-shadow: 0 1px 12px rgba(0,0,0,0.35); }
.ehgr .ehgr-fin-count { position: absolute; z-index: 2; right: clamp(16px, 2.4vw, 28px); bottom: clamp(18px, 2.4vw, 28px); font-family: var(--ehgr-mono); font-size: 12px; letter-spacing: .1em; color: var(--ehgr-ink-2); }

.ehgr .ehgr-fin-view { position: absolute; z-index: 2; top: 14px; left: 14px; display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(11,11,11,0.72); border: 1px solid var(--ehgr-hairline-2); }
.ehgr .ehgr-fin-viewbtn { appearance: none; -webkit-appearance: none; padding: 9px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ehgr-ink-2); font-family: var(--ehgr-manrope); font-size: 12px; font-weight: 700; letter-spacing: .06em; line-height: 1; cursor: pointer; transition: background .3s, color .3s; }
.ehgr .ehgr-fin-viewbtn:hover, .ehgr .ehgr-fin-viewbtn:focus { background: rgba(241,235,225,0.1); color: var(--ehgr-ink); }
.ehgr .ehgr-fin-viewbtn:focus-visible { outline: 2px solid var(--ehgr-gold); outline-offset: 1px; }
.ehgr .ehgr-fin-viewbtn.is-active, .ehgr .ehgr-fin-viewbtn.is-active:hover, .ehgr .ehgr-fin-viewbtn.is-active:focus { background: var(--ehgr-ink); color: var(--ehgr-bg); }

.ehgr .ehgr-fin-nav { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); appearance: none; -webkit-appearance: none; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 1px solid var(--ehgr-hairline-2); background: rgba(11,11,11,0.6); color: var(--ehgr-ink); cursor: pointer; transition: border-color .3s, color .3s, background .3s; }
.ehgr .ehgr-fin-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ehgr .ehgr-fin-nav:hover, .ehgr .ehgr-fin-nav:focus { background: rgba(11,11,11,0.82); border-color: var(--ehgr-gold); color: var(--ehgr-gold); }
.ehgr .ehgr-fin-nav:focus-visible { outline: 2px solid var(--ehgr-gold); outline-offset: 2px; }
.ehgr .ehgr-fin-prev { left: 14px; }
.ehgr .ehgr-fin-next { right: 14px; }

/* Side panel */
.ehgr .ehgr-fin-side { display: flex; flex-direction: column; min-width: 0; padding: clamp(18px, 2vw, 24px); border: 1px solid var(--ehgr-hairline); border-radius: 4px; background: var(--ehgr-bg); }
.ehgr .ehgr-fin-panel[hidden] { display: none; }
.ehgr .ehgr-fin-spec { margin: 0 0 18px; font-family: var(--ehgr-manrope); font-size: 14px; line-height: 1.6; color: var(--ehgr-muted); }
.ehgr .ehgr-fin-sublabel { margin: 0 0 10px; font-family: var(--ehgr-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ehgr-muted-2); }
.ehgr .ehgr-fin-swatches { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ehgr .ehgr-fin-swatches li { margin: 0; padding: 0; }
.ehgr .ehgr-fin-swatch { appearance: none; -webkit-appearance: none; width: 100%; display: flex; align-items: center; gap: 14px; padding: 6px 14px 6px 6px; border: 1px solid var(--ehgr-hairline-2); border-radius: 4px; background: transparent; color: var(--ehgr-ink-2); font-family: var(--ehgr-manrope); font-size: 15px; font-weight: 600; line-height: 1.2; text-align: left; cursor: pointer; transition: border-color .3s, background .3s, color .3s; }
.ehgr .ehgr-fin-swatch img { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 3px; object-fit: cover; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.ehgr .ehgr-fin-swatch span { flex: 1 1 auto; }
.ehgr .ehgr-fin-swatch::after { content: ''; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--ehgr-border-soft); transition: background .3s, border-color .3s, box-shadow .3s; }
.ehgr .ehgr-fin-swatch:hover, .ehgr .ehgr-fin-swatch:focus { background: rgba(241,235,225,0.04); border-color: var(--ehgr-border-mid); color: var(--ehgr-ink); }
.ehgr .ehgr-fin-swatch:focus-visible { outline: 2px solid var(--ehgr-gold); outline-offset: 2px; }
.ehgr .ehgr-fin-swatch.is-active, .ehgr .ehgr-fin-swatch.is-active:hover, .ehgr .ehgr-fin-swatch.is-active:focus { border-color: var(--ehgr-gold); background: rgba(201,169,97,0.08); color: var(--ehgr-ink); }
.ehgr .ehgr-fin-swatch.is-active::after { background: var(--ehgr-gold); border-color: var(--ehgr-gold); box-shadow: 0 0 0 4px rgba(201,169,97,0.18); }

.ehgr .ehgr-fin-panel { padding-bottom: 22px; }
.ehgr .ehgr-fin-side .ehgr-fin-cta { margin-top: auto; justify-content: center; width: 100%; text-align: center; line-height: 1.3; }
.ehgr .ehgr-fin-cta .ehgr-wa-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: currentColor; }
.ehgr .ehgr-fin-note { margin: 12px 0 0; font-family: var(--ehgr-mono); font-size: 11px; letter-spacing: .04em; line-height: 1.6; color: var(--ehgr-muted-2); }

/* Tablet and phone: swatches become a swipeable row under the photo */
@media (max-width: 999px) {
  .ehgr .ehgr-fin-swatches { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -4px; padding: 4px; }
  .ehgr .ehgr-fin-swatches::-webkit-scrollbar { display: none; }
  .ehgr .ehgr-fin-swatches li { flex: 0 0 auto; scroll-snap-align: start; }
  .ehgr .ehgr-fin-swatch { width: 92px; flex-direction: column; align-items: center; gap: 8px; padding: 6px 6px 10px; font-size: 12px; text-align: center; }
  .ehgr .ehgr-fin-swatch img { width: 78px; height: 78px; }
  .ehgr .ehgr-fin-swatch::after { display: none; }
  .ehgr .ehgr-fin-tabs, .ehgr .ehgr-fin-swatches { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); padding-right: 36px; }
}
@media (max-width: 560px) {
  .ehgr .ehgr-fin-frame { aspect-ratio: 1 / 1; }
  .ehgr .ehgr-fin-nav { width: 40px; height: 40px; top: auto; bottom: 14px; transform: none; }
  .ehgr .ehgr-fin-prev { left: auto; right: 62px; }
  .ehgr .ehgr-fin-next { right: 14px; }
  .ehgr .ehgr-fin-count { display: none; }
  .ehgr .ehgr-fin-label { right: 120px; }
  .ehgr .ehgr-fin-view { top: 12px; left: 12px; }
  .ehgr .ehgr-fin-viewbtn { padding: 8px 12px; }
  .ehgr .ehgr-fin-tab { padding: 11px 15px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .ehgr .ehgr-fin-img, .ehgr .ehgr-fin-tab, .ehgr .ehgr-fin-swatch, .ehgr .ehgr-fin-nav { transition: none; }
}

/* Home page: sits under the construction explorer, same surface section. */
.ehgr .e-con.ehgr-fin-wrap { --padding-top: clamp(48px, 6vw, 88px); margin-top: clamp(48px, 6vw, 88px); border-top: 1px solid var(--ehgr-hairline); }
