/* DPCL image sliders + enlarge viewer (30 Oct 2026). No libraries.
   Markup:  .dps > .dps-viewport > .dps-track > slides      (controls and counter are added by js/slider.js)
   Sizes:   .dps--p1 (1 per view), .dps--p2 (2 desktop/tablet, 1 + peek on phone), .dps--p3 (3 / 2 / 1 + peek)
   Without JS the track is still a swipeable, scroll-snapping strip. */

.dps { --gap: 1rem; --per: 1; position: relative; min-width: 0; }
.dps--p2, .dps--p3 { --per: 1.12; }
@media (min-width: 576px) { .dps--p2, .dps--p3 { --per: 2; } }
@media (min-width: 992px) { .dps--p3 { --per: 3; } }
.dps--p1 { --per: 1; }

.dps-track {
  display: flex !important; flex-wrap: nowrap !important; gap: var(--gap);
  margin: 0 !important; padding: 0 !important; list-style: none;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain; cursor: grab; outline: none;
}
.dps-track::-webkit-scrollbar { display: none; }
.dps-track:focus-visible { outline: 3px solid var(--brand-red); outline-offset: 3px; border-radius: 6px; }
.dps-track > * {
  flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per)) !important;
  width: auto !important; max-width: none !important; min-width: 0;
  margin: 0 !important; padding: 0 !important; scroll-snap-align: start;
}
.dps-track.is-drag { scroll-snap-type: none; cursor: grabbing; user-select: none; scroll-behavior: auto; }
.dps-track.is-drag img { pointer-events: none; }
.dps-track img { -webkit-user-drag: none; user-select: none; cursor: zoom-in; }
.dps-track .gf-photo { height: auto; }
.dps-track .gf-card { height: 100%; }
.dps-track .gf-card:hover { transform: none; }

/* Hero (main photo + extra photos of a product page) */
.dps--hero { --gap: 0px; }
.dps--hero .dps-viewport { position: relative; border-radius: 1rem; overflow: hidden; box-shadow: var(--shadow-xl); }
.dps--hero .product-media--main { box-shadow: none; border-radius: 0; }
.dps-count {
  position: absolute; right: .75rem; bottom: .75rem; z-index: 2; pointer-events: none;
  background: rgba(8, 16, 30, .72); color: #fff; font: 600 .72rem/1 'Inter', sans-serif; letter-spacing: .04em;
  padding: .38rem .65rem; border-radius: 999px;
}

/* Controls: arrows + dots, centred under the track */
.dps-ctrl { display: flex; align-items: center; justify-content: center; gap: .7rem; margin-top: .9rem; }
.dps-ctrl[hidden] { display: none; }
.dps-btn {
  width: 40px; height: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--gray-200); background: #fff; color: var(--brand-navy); box-shadow: var(--shadow-sm);
  transition: background .2s, color .2s, border-color .2s, opacity .2s;
}
.dps-btn svg { width: 18px; height: 18px; display: block; }
.dps-btn:hover:not(:disabled) { background: var(--brand-navy); color: #fff; border-color: var(--brand-navy); }
.dps-btn:disabled { opacity: .35; cursor: default; }
.dps-btn:focus-visible { outline: 3px solid var(--brand-red); outline-offset: 2px; }
.dps-dots { display: flex; align-items: center; gap: .45rem; }
.dps-dot {
  position: relative; width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--gray-300, #cbd5e1); transition: width .25s, background .25s;
}
.dps-dot::before { content: ''; position: absolute; inset: -10px -4px; }
.dps-dot[aria-current="true"] { width: 26px; border-radius: 6px; background: var(--brand-red); }
.dps-dot:focus-visible { outline: 3px solid var(--brand-red); outline-offset: 3px; }
@media (max-width: 575.98px) { .dps-btn { width: 38px; height: 38px; } .dps-ctrl { margin-top: .75rem; } }

/* Enlarge viewer */
html.dpl-lock { overflow: hidden; }
.dpl {
  position: fixed; inset: 0; z-index: 10050; display: flex; flex-direction: column;
  background: rgba(6, 14, 28, .95); opacity: 0; visibility: hidden; transition: opacity .22s, visibility .22s;
}
.dpl.on { opacity: 1; visibility: visible; }
.dpl-top { display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; color: #fff; font: 600 .85rem 'Inter', sans-serif; }
.dpl-cap { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .88; }
.dpl-n { opacity: .7; font-weight: 500; white-space: nowrap; }
.dpl-x, .dpl-nav {
  width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; transition: background .2s;
}
.dpl-x:hover, .dpl-nav:hover { background: rgba(255, 255, 255, .28); }
.dpl-x:focus-visible, .dpl-nav:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.dpl-x svg, .dpl-nav svg { width: 20px; height: 20px; }
.dpl-stage { flex: 1; min-height: 0; display: flex; overflow: auto; padding: 0 .75rem 1rem; position: relative; }
.dpl-img {
  margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; border-radius: 10px;
  cursor: zoom-in; touch-action: pinch-zoom pan-x pan-y; box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.dpl.z .dpl-img { max-width: none; max-height: none; width: 200%; cursor: zoom-out; }
.dpl-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.dpl-prev { left: .75rem; } .dpl-next { right: .75rem; }
.dpl-nav[hidden] { display: none; }
.dpl.z .dpl-nav { display: none; }
@media (max-width: 575.98px) { .dpl-nav { top: auto; bottom: 1.25rem; transform: none; background: rgba(255, 255, 255, .22); } .dpl-stage { padding-bottom: 4.5rem; } }
@media (prefers-reduced-motion: reduce) { .dpl, .dps-dot, .dps-btn { transition: none; } .dps-track { scroll-behavior: auto; } }

/* Single-product cells (catalogue pages split into one image per product, 30 Oct 2026) */
.dps--cells .gf-cell { display: flex; }
.dps--cells .gf-photo {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: .5rem;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; box-shadow: none;
}
.dps--cells .gf-photo img { width: 100%; height: auto !important; max-height: 540px; aspect-ratio: auto; object-fit: contain; }

/* 5 per view product tiles (Armorfire range) and double-width tiles */
.dps--p5 { --per: 2.15; --gap: .75rem; }
@media (min-width: 576px) { .dps--p5 { --per: 3; } }
@media (min-width: 992px) { .dps--p5 { --per: 4; } }
@media (min-width: 1200px) { .dps--p5 { --per: 5; } }
.dps--cells .dps-track > .gf-cell--wide { flex-basis: calc(2 * ((100% - (var(--per) - 1) * var(--gap)) / var(--per)) + var(--gap)) !important; }
.dps--p5.dps--cells .gf-photo { padding: .3rem; }

/* Brand logo card in the product page hero (31 Oct 2026) */
.hero-brand {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: .55rem 1rem; max-width: 100%;
  margin-top: 1.4rem; padding: .75rem 1.1rem; background: #fff; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(3, 10, 30, .35), 0 0 0 1px rgba(255, 255, 255, .6) inset;
}
.hero-brand__label {
  font: 700 .62rem/1.2 'Inter', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--gray-500, #64748b);
  padding-right: 1rem; border-right: 1px solid var(--gray-200, #e2e8f0); align-self: stretch; display: flex; align-items: center;
}
.hero-brand__logos { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1.25rem; min-width: 0; }
.hero-brand__img { display: block; width: auto; height: 34px; max-width: 150px; object-fit: contain; }
.hero-brand__img--new { height: 32px; }
.hero-brand__img--armorfire { height: 46px; }
.hero-brand__img--varsha { height: 34px; }
.hero-brand__img--druthi { height: 40px; }
.hero-brand__img--siemens, .hero-brand__img--abb, .hero-brand__img--schneider-electric { height: 22px; width: auto; max-width: 110px; }
.hero-brand__img--abb { height: 20px; }
.hero-brand__txt { font: 700 .95rem/1 'Inter', sans-serif; color: var(--brand-navy, #0b1f4d); letter-spacing: .01em; padding-left: 1rem; border-left: 1px solid var(--gray-200, #e2e8f0); }
@media (max-width: 575.98px) {
  .hero-brand { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    width: fit-content; max-width: 100%; margin: 1.4rem auto 0; padding: .8rem 1.3rem .9rem; gap: .5rem; }
  .hero-brand__label { border: 0; padding: 0; align-self: auto; justify-content: center; }
  .hero-brand__logos { justify-content: center; gap: .6rem 1.1rem; }
  .hero-brand__img { height: 36px; }
  .hero-brand__img--armorfire { height: 52px; }
  .hero-brand__img--siemens, .hero-brand__img--schneider-electric { height: 20px; }
  .hero-brand__img--abb { height: 18px; }
  .hero-brand__txt { padding-left: 0; border-left: 0; width: 100%; text-align: center; }
}
@media (min-width: 992px) {
  .has-brand .hero-copy-pad, .has-brand > h1, .has-brand > p, .has-brand > nav, .has-brand > .section-tag { max-width: calc(100% - 300px) !important; }
  .has-brand .hero-brand {
    position: absolute; right: calc(var(--bs-gutter-x, 1.5rem) * .5); top: 50%; transform: translateY(-50%); margin: 0;
    flex-direction: column; align-items: center; justify-content: center; gap: .7rem; width: 250px; padding: 1.15rem 1.25rem; border-radius: 18px;
  }
  .has-brand .hero-brand__label { border: 0; padding: 0; width: 100%; justify-content: center; align-self: auto; }
  .has-brand .hero-brand__logos { justify-content: center; gap: .85rem 1.25rem; }
  .has-brand .hero-brand__img { height: 56px; max-width: 200px; }
  .has-brand .hero-brand__img--new { height: 54px; }
  .has-brand .hero-brand__img--druthi { height: 64px; }
  .has-brand .hero-brand__img--armorfire { height: 84px; }
  .has-brand .hero-brand__img--siemens, .has-brand .hero-brand__img--schneider-electric { height: 28px; max-width: 120px; }
  .has-brand .hero-brand__img--abb { height: 24px; }
  .has-brand .hero-brand__txt { border: 0; padding: .1rem 0 0; font-size: 1rem; width: 100%; text-align: center; }
}
