/* FWD product gallery. Compact page layout; modal below is preserved. */
.fwd-product-gallery,
.fwd-product-gallery *{box-sizing:border-box}
.fwd-gallery-card{display:grid;grid-template-columns:minmax(0,1fr) 145px;align-items:stretch;gap:10px;width:100%;background:#f5f7fb;border-radius:14px;padding:8px;overflow:hidden}
.fwd-gallery-main{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;aspect-ratio:var(--fwd-main-ratio,1/1);background:#fff;border-radius:12px;overflow:hidden}
.fwd-gallery-open{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:0;padding:0;border:0;background:transparent;cursor:zoom-in}
.fwd-gallery-main-image{display:block;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important;transform:none!important}
.fwd-gallery-side-previews{display:grid;grid-template-rows:repeat(2,minmax(0,1fr));align-items:stretch;gap:10px;min-height:0;padding:0;margin:0}
.fwd-gallery-side-previews.has-single-preview{grid-template-rows:minmax(0,1fr)}
.fwd-gallery-side-thumb{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:0;padding:0;border:2px solid transparent;border-radius:11px;background:#fff;overflow:hidden;cursor:pointer}
.fwd-gallery-side-thumb:hover,.fwd-gallery-side-thumb:focus-visible{border-color:#1378d4}
.fwd-gallery-side-thumb img{display:block;width:100%!important;height:100%!important;max-height:none!important;object-fit:contain!important;object-position:center!important}
.fwd-gallery-more{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:8px;color:#fff;text-align:center;background:#dcae55ab;-webkit-border-radius: 7px;-moz-border-radius: 7px;border-radius: 7px;}
.fwd-gallery-more strong{font-size:28px;line-height:1}.fwd-gallery-more small{font-size:12px;line-height:1.25;font-weight:700}
.fwd-gallery-arrow{position:absolute!important;top:50%;z-index:3;width:48px;height:48px;margin-top:-24px;border:0;border-radius:50%;background:#fff;color:#17365d;font-size:25px;line-height:48px;box-shadow:0 2px 16px rgba(0,0,0,.14);cursor:pointer}
.fwd-gallery-prev{left:12px}.fwd-gallery-next{right:12px}
.fwd-gallery-counter{position:absolute;bottom:14px;left:16px;padding:8px 12px;border-radius:9px;background:rgba(0,0,0,.78);color:#fff;font-size:13px}

.fwd-gallery-modal{position:fixed;inset:0;z-index:999999;display:none;padding:14px;background:rgba(0,0,0,.55)}
.fwd-gallery-modal.is-open{display:block}.fwd-gallery-modal-dialog{display:grid;grid-template-rows:58px minmax(0,1fr) 78px;width:100%;height:100%;background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 15px 50px rgba(0,0,0,.25)}
.fwd-gallery-modal-header{display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-bottom:1px solid #e7ebf0;background:#fff}
.fwd-gallery-modal-header-spacer{display:block;min-width:1px;min-height:1px}
.fwd-gallery-close{width:46px;height:46px;border:0;background:transparent;color:#9ca4ad;font-size:42px;font-weight:200;line-height:1;cursor:pointer}
.fwd-gallery-modal-body{display:grid;grid-template-columns:245px minmax(0,1fr);min-height:0}
.fwd-gallery-modal-thumbs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:9px;overflow-y:auto;padding:18px;border-right:1px solid #e7ebf0;background:#fff}
.fwd-gallery-modal-thumb{display:flex;align-items:center;justify-content:center;aspect-ratio:1/1;padding:5px;border:1px solid #e3e7eb;border-radius:8px;background:#fff;overflow:hidden;cursor:pointer}
.fwd-gallery-modal-thumb.is-active{border:2px solid #1684e8}.fwd-gallery-modal-thumb img{display:block;width:100%!important;height:100%!important;object-fit:contain!important;object-position:center!important}
.fwd-gallery-stage{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;padding:22px 78px 66px;background:#fff;overflow:hidden}
.fwd-gallery-image-viewport{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-width:0;min-height:0;overflow:auto;touch-action:pan-x pan-y}
.fwd-gallery-modal-image{display:block;width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important;transform:scale(1);transform-origin:center center;transition:transform .15s ease;user-select:none}
.fwd-gallery-stage-arrow{position:absolute;top:50%;z-index:5;width:50px;height:82px;margin-top:-41px;border:1px solid #e1e5ea;border-radius:7px;background:#fff;color:#55aaf3;font-size:34px;box-shadow:0 2px 8px rgba(0,0,0,.03);cursor:pointer}
.fwd-gallery-stage-prev{left:38px}.fwd-gallery-stage-next{right:38px}
.fwd-gallery-tools{position:absolute;bottom:16px;left:50%;display:flex;gap:12px;transform:translateX(-50%)}
.fwd-gallery-tools button{width:42px;height:42px;border:1px solid #dde2e7;border-radius:50%;background:#fff;color:#66717c;font-size:25px;line-height:40px;cursor:pointer}
.fwd-gallery-modal-counter{position:absolute;right:22px;bottom:23px;color:#66717c;font-size:14px}
.fwd-gallery-modal-footer{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:12px 20px;border-top:1px solid #e7ebf0;background:#fff}.fwd-gallery-footer-title{min-width:0;overflow:hidden;color:#273444;font-size:16px;font-weight:700;white-space:nowrap;text-overflow:ellipsis}
.fwd-gallery-offer-button{min-width:250px;height:52px;padding:0 28px;border:0;border-radius:6px;background:#dcae55;color:#fff;font-size:14px;font-weight:800;letter-spacing:.01em;cursor:pointer;box-shadow:none;transition:background-color .2s ease,transform .2s ease}.fwd-gallery-offer-button:hover,.fwd-gallery-offer-button:focus-visible{background:#c99a40;color:#fff;transform:translateY(-1px)}
body.fwd-gallery-lock{overflow:hidden!important}

@media (max-width:1024px){.fwd-gallery-card{grid-template-columns:minmax(0,1fr) 125px;padding:7px;gap:8px}.fwd-gallery-modal-body{grid-template-columns:190px}.fwd-gallery-modal-thumbs{padding:12px}.fwd-gallery-stage{padding-right:62px;padding-left:62px}.fwd-gallery-stage-prev{left:12px}.fwd-gallery-stage-next{right:12px}}
@media (max-width:767px){.fwd-gallery-card{display:block;padding:8px}.fwd-gallery-main{aspect-ratio:var(--fwd-main-ratio,1/1)}.fwd-gallery-side-previews,.fwd-gallery-side-previews.has-single-preview{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:110px;min-height:0;margin-top:8px}.fwd-gallery-side-previews.has-single-preview{grid-template-columns:minmax(0,1fr)}.fwd-gallery-side-thumb{height:110px}.fwd-gallery-side-thumb img{max-height:none!important}.fwd-gallery-arrow{width:40px;height:40px;margin-top:-20px;line-height:40px}.fwd-gallery-prev{left:8px}.fwd-gallery-next{right:8px}.fwd-gallery-modal{padding:0}.fwd-gallery-modal-dialog{border-radius:0;grid-template-rows:52px minmax(0,1fr) 68px}.fwd-gallery-modal-body{display:flex;flex-direction:column-reverse}.fwd-gallery-modal-thumbs{grid-template-columns:repeat(5,74px);grid-auto-flow:column;grid-auto-columns:74px;flex:0 0 96px;overflow-x:auto;overflow-y:hidden;padding:10px;border-top:1px solid #e7ebf0;border-right:0}.fwd-gallery-modal-thumb{width:74px;height:74px}.fwd-gallery-stage{flex:1;padding:12px 44px 58px}.fwd-gallery-stage-arrow{width:38px;height:60px;margin-top:-30px;font-size:24px}.fwd-gallery-stage-prev{left:4px}.fwd-gallery-stage-next{right:4px}.fwd-gallery-modal-footer{flex-direction:column;align-items:stretch;justify-content:center;gap:8px;padding:10px}.fwd-gallery-footer-title{text-align:center;font-size:14px}.fwd-gallery-offer-button{width:100%;min-width:0}}

/* Existing request-offer popup opened from the gallery must sit above the gallery viewer. */
.fwd-gallery-offer-overlay{
  z-index:1000025!important;
}
body.fwd-gallery-lock .elementor-popup-modal.fwd-gallery-offer-overlay,
body.fwd-gallery-lock .mfp-wrap.fwd-gallery-offer-overlay,
body.fwd-gallery-lock .wd-popup.fwd-gallery-offer-overlay,
body.fwd-gallery-lock .fwd-offer-modal.fwd-gallery-offer-overlay,
body.fwd-gallery-lock .fwd-request-offer-modal.fwd-gallery-offer-overlay,
body.fwd-gallery-lock [role="dialog"].fwd-gallery-offer-overlay,
body.fwd-gallery-lock [aria-modal="true"].fwd-gallery-offer-overlay{
  z-index:1000030!important;
}
body.fwd-gallery-lock .mfp-bg.fwd-gallery-offer-overlay,
body.fwd-gallery-lock .modal-backdrop.fwd-gallery-offer-overlay{
  z-index:1000020!important;
}


/* While the request-offer form is open, the gallery stays visible but must not capture clicks. */
body.fwd-gallery-offer-open .fwd-gallery-modal{
  pointer-events:none!important;
}
body.fwd-gallery-offer-open .fwd-gallery-offer-overlay,
body.fwd-gallery-offer-open .fwd-gallery-offer-overlay *,
body.fwd-gallery-offer-open .elementor-popup-modal,
body.fwd-gallery-offer-open .elementor-popup-modal *,
body.fwd-gallery-offer-open .mfp-wrap,
body.fwd-gallery-offer-open .mfp-wrap *,
body.fwd-gallery-offer-open .wd-popup,
body.fwd-gallery-offer-open .wd-popup *,
body.fwd-gallery-offer-open .fwd-offer-modal,
body.fwd-gallery-offer-open .fwd-offer-modal *,
body.fwd-gallery-offer-open .fwd-request-offer-modal,
body.fwd-gallery-offer-open .fwd-request-offer-modal *{
  pointer-events:auto!important;
}


/* Hard interaction fix: the form itself is the only clickable layer while open. */
body.fwd-gallery-offer-open .fwd-gallery-modal,
body.fwd-gallery-offer-open .fwd-gallery-modal-dialog,
body.fwd-gallery-offer-open .fwd-gallery-modal-body,
body.fwd-gallery-offer-open .fwd-gallery-modal-footer{
  pointer-events:none!important;
}
body.fwd-gallery-offer-open .fwd-gallery-offer-overlay{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
  z-index:2147483646!important;
}
body.fwd-gallery-offer-open .fwd-gallery-offer-overlay,
body.fwd-gallery-offer-open .fwd-gallery-offer-overlay *{
  pointer-events:auto!important;
}

/* Definitive request-offer interaction layer. The real form panel is moved here. */
.fwd-gallery-offer-host{
  position:fixed!important;
  inset:0!important;
  z-index:2147483647!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:24px!important;
  overflow:auto!important;
  background:rgba(22,29,38,.58)!important;
  pointer-events:auto!important;
  isolation:isolate!important;
}
.fwd-gallery-offer-host .fwd-gallery-offer-panel,
.fwd-gallery-offer-host .fwd-gallery-offer-panel *{
  pointer-events:auto!important;
  touch-action:auto!important;
}
.fwd-gallery-offer-host .fwd-gallery-offer-panel{
  width:min(820px,calc(100vw - 32px))!important;
  max-height:calc(100vh - 32px)!important;
  overflow:auto!important;
  visibility:visible!important;
  opacity:1!important;
  transform:none!important;
}
body.fwd-gallery-offer-open .fwd-gallery-modal{
  pointer-events:none!important;
}
body.fwd-gallery-offer-open .fwd-gallery-offer-host{
  pointer-events:auto!important;
}
@media (max-width:767px){
  .fwd-gallery-offer-host{padding:8px!important;align-items:flex-start!important}
  .fwd-gallery-offer-host .fwd-gallery-offer-panel{width:100%!important;max-height:calc(100vh - 16px)!important}
}
