
/* ONLINE PRICE PRODUCT PHOTOS */
.products-image-field {
  display: grid;
  gap: 9px;
  margin: 14px 0;
}
.products-image-field > label {
  font-weight: 600;
}
.products-image-field small {
  color: #777;
}
#productsImagePreviewWrap[hidden],
.catalog-image-modal[hidden] {
  display: none;
}
#productsImagePreviewWrap {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}
#productsImagePreview {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: contain;
  border: 1px solid #ddd;
  border-radius: 8px;
}
.catalog-product-name-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}
.catalog-image-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  padding: 3px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  vertical-align: middle;
}
.catalog-image-button:hover {
  background: #eef2f7;
  color: #2563eb;
}
.catalog-image-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.catalog-image-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.78);
}
.catalog-image-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(900px, 100%);
  max-height: 90vh;
  padding: 16px;
  border-radius: 12px;
  background: white;
}
.catalog-image-dialog img {
  display: block;
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}
.catalog-image-dialog p {
  margin: 10px 0 0;
  text-align: center;
  color: #222;
}
.catalog-image-close {
  align-self: flex-end;
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 50%;
  background: #eee;
  color: #222;
  font-size: 25px;
  cursor: pointer;
}
@media (max-width: 600px) {
  .catalog-image-modal { padding: 10px; }
  .catalog-image-dialog { width: 100%; padding: 10px; }
  .catalog-image-dialog img { max-height: 78vh; }
}

/* ONLINE PRICE — более заметная кнопка фотографии */
#store #catalog .catalog-image-button {
  width: 23px;
  height: 23px;
  min-width: 23px;
  flex: 0 0 23px;
  padding: 3px;
  border: 1px solid rgba(174, 255, 0, .8);
  border-radius: 5px;
  background: rgba(125, 205, 0, .16);
  color: #b7ff24;
  box-shadow: 0 0 5px rgba(160, 255, 0, .18);
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease;
}

#store #catalog .catalog-image-button svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
}

#store #catalog .catalog-image-button:hover {
  background: rgba(160, 255, 0, .3);
  color: #d0ff62;
  box-shadow: 0 0 10px rgba(160, 255, 0, .5);
}

#store #catalog .catalog-image-button:focus-visible {
  outline: 2px solid #c3ff35;
  outline-offset: 2px;
}

/* ONLINE PRICE — PREMIUM PRODUCT IMAGE VIEWER */

body:has(.catalog-image-modal:not([hidden])) {
  overflow: hidden;
}

.catalog-image-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .84);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.catalog-image-modal[hidden] {
  display: none !important;
}

.catalog-image-dialog {
  --photo-glow: 145,220,35;
  position: relative;
  width: min(990px, 96vw);
  height: min(880px, 90vh);
  display: grid;
  grid-template-rows: 75px minmax(0, 1fr) 104px;
  overflow: hidden;
  border: 1px solid #9ce900;
  border-radius: 34px;
  background:
    radial-gradient(
      ellipse at 50% 43%,
      rgba(var(--photo-glow), .48) 0%,
      rgba(var(--photo-glow), .24) 24%,
      rgba(var(--photo-glow), .09) 48%,
      transparent 72%
    ),
    #030a07;
  box-shadow:
    0 0 25px rgba(var(--photo-glow), .12),
    0 0 55px rgba(150,255,0,.08),
    0 25px 90px rgba(0,0,0,.7);
}

.catalog-image-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
}

.catalog-image-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #f5fff3;
  font-size: 22px;
  font-weight: 750;
}

.catalog-image-heading-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid #b2f500;
  border-radius: 8px;
  color: #c4ff35;
  font-size: 25px;
}

.catalog-image-close {
  width: 50px;
  height: 50px;
  border: 1px solid #b5f600;
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  color: #c5ff28;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: .2s ease;
}

.catalog-image-close:hover {
  background: #a4ed00;
  color: #071000;
  box-shadow: 0 0 18px rgba(180,255,0,.45);
}

.catalog-image-stage {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 12px 65px;
  background: radial-gradient(
    ellipse at center,
    rgba(var(--photo-glow), .12),
    transparent 72%
  );
}

.catalog-image-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 15px 40px rgba(0,0,0,.25);
  transition: transform .2s ease;
  transform-origin: center;
}

.catalog-image-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 30px;
  border-top: 1px solid rgba(190,255,170,.15);
  background: rgba(0,0,0,.23);
}

.catalog-image-caption {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.catalog-image-caption strong {
  color: #fff;
  font-size: 23px;
  overflow-wrap: anywhere;
}

.catalog-image-caption small {
  color: #d0ded2;
  font-size: 14px;
}

.catalog-image-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
}

.catalog-image-controls button {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(180,255,0,.55);
  border-radius: 17px;
  background: rgba(0,0,0,.3);
  color: #c4ff28;
  font-size: 28px;
  cursor: pointer;
}

.catalog-image-controls button:hover {
  background: rgba(160,240,0,.2);
  box-shadow: 0 0 12px rgba(170,255,0,.3);
}

.catalog-image-controls [data-zoom-label] {
  min-width: 48px;
  text-align: center;
  font-size: 15px;
}

.catalog-image-dialog:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: 0;
}

@media (max-width: 600px) {
  .catalog-image-modal {
    padding: 9px;
  }

  .catalog-image-dialog {
    width: 100%;
    height: min(88vh, 850px);
    grid-template-rows: 62px minmax(0, 1fr) 100px;
    border-radius: 22px;
  }

  .catalog-image-header {
    padding: 0 15px;
  }

  .catalog-image-heading {
    font-size: 17px;
    gap: 9px;
  }

  .catalog-image-heading-icon {
    width: 29px;
    height: 29px;
  }

  .catalog-image-close {
    width: 40px;
    height: 40px;
    font-size: 25px;
  }

  .catalog-image-stage {
    padding: 10px 12px;
  }

  .catalog-image-footer {
    padding: 0 12px;
    gap: 5px;
  }

  .catalog-image-caption strong {
    font-size: 16px;
  }

  .catalog-image-caption small {
    font-size: 11px;
  }

  .catalog-image-controls {
    gap: 5px;
  }

  .catalog-image-controls button {
    width: 36px;
    height: 38px;
    border-radius: 11px;
    font-size: 23px;
  }

  .catalog-image-controls [data-zoom-label] {
    min-width: 36px;
    font-size: 12px;
  }
}

/* PHOTO VIEWER FINAL DESIGN OVERRIDES */

.catalog-image-dialog {
  width: min(980px, 96vw);
  height: min(860px, 90vh);
  background:
    radial-gradient(
      circle at center,
      rgba(var(--photo-glow), .30) 0%,
      rgba(var(--photo-glow), .16) 22%,
      rgba(var(--photo-glow), .08) 38%,
      transparent 58%
    ),
    linear-gradient(180deg, #06100a, #020705);
}

.catalog-image-stage {
  padding: 26px 56px 18px;
  background:
    radial-gradient(
      circle at center,
      rgba(var(--photo-glow), .15) 0%,
      rgba(var(--photo-glow), .07) 24%,
      transparent 55%
    );
}

.catalog-image-stage img {
  max-width: min(78vw, 880px);
  max-height: min(66vh, 700px);
  border-radius: 12px;
  box-shadow:
    0 12px 40px rgba(0,0,0,.28),
    0 0 0 1px rgba(255,255,255,.04);
}

.catalog-image-footer {
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.04),
    rgba(0,0,0,.18)
  );
}

.catalog-image-caption strong {
  font-size: 24px;
  font-weight: 800;
}

.catalog-image-close,
.catalog-image-controls button {
  box-shadow: 0 0 0 1px rgba(180,255,0,.22) inset;
}

.catalog-image-close:hover,
.catalog-image-controls button:hover {
  box-shadow:
    0 0 0 1px rgba(180,255,0,.4) inset,
    0 0 16px rgba(180,255,0,.2);
}

@media (max-width: 600px) {
  .catalog-image-dialog {
    width: 100%;
    height: min(88vh, 820px);
  }

  .catalog-image-stage {
    padding: 14px;
  }

  .catalog-image-stage img {
    max-width: 100%;
    max-height: 62vh;
    border-radius: 10px;
  }

  .catalog-image-caption strong {
    font-size: 17px;
  }
}


/* PHOTO VIEWER HEADER FIX */

.catalog-image-header {
  background: linear-gradient(
    180deg,
    rgba(15,35,25,.98),
    rgba(5,15,10,.96)
  ) !important;
  border-bottom: 1px solid rgba(180,255,0,.25) !important;
}

.catalog-image-heading {
  color: #f4ffe9 !important;
}

.catalog-image-heading-icon {
  color: #baff00 !important;
  background: rgba(180,255,0,.08) !important;
}

.catalog-image-close {
  background: rgba(180,255,0,.10) !important;
  color: #c5ff28 !important;
  border-color: #a8ef00 !important;
}

.catalog-image-dialog {
  background:
    radial-gradient(
      ellipse at center,
      rgba(var(--photo-glow), .42) 0%,
      rgba(var(--photo-glow), .22) 25%,
      rgba(var(--photo-glow), .09) 48%,
      transparent 72%
    ),
    #030a07 !important;
}

.catalog-image-stage {
  background: radial-gradient(
    ellipse at center,
    rgba(var(--photo-glow), .22),
    transparent 70%
  ) !important;
}

.catalog-image-footer {
  background: rgba(3,12,7,.92) !important;
}


/* UNIFIED PHOTO VIEWER CONTROLS */

.catalog-image-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.catalog-image-controls button {
  box-sizing: border-box;
  width: 46px !important;
  height: 46px !important;
  min-width: 46px;
  min-height: 46px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border: 1px solid rgba(180,255,0,.65) !important;
  border-radius: 14px !important;
  background: rgba(5,15,8,.85) !important;
  color: #baff00 !important;
  box-shadow: inset 0 0 0 1px rgba(180,255,0,.08);
  transition: background .2s, box-shadow .2s, transform .2s;
  outline: none;
}

.catalog-image-controls button svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.catalog-image-controls button:hover {
  background: rgba(180,255,0,.14) !important;
  box-shadow: 0 0 15px rgba(180,255,0,.22);
}

.catalog-image-controls button:active {
  transform: scale(.94);
}

.catalog-image-controls button:focus {
  outline: none;
}

.catalog-image-controls button:focus-visible {
  outline: 2px solid #baff00 !important;
  outline-offset: 3px;
  box-shadow: 0 0 12px rgba(180,255,0,.25);
}

.catalog-image-controls [data-zoom-label] {
  min-width: 52px;
  text-align: center;
  color: #f4fff0;
  font-size: 15px;
  font-weight: 700;
}

@media (max-width: 600px) {
  .catalog-image-controls {
    gap: 7px;
  }

  .catalog-image-controls button {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    min-height: 38px;
    border-radius: 11px !important;
  }

  .catalog-image-controls button svg {
    width: 19px;
    height: 19px;
  }
}


/* PHOTO VIEWER — REMOVE TOP OUTER BORDER */
.catalog-image-dialog {
  border-top: 0 !important;
}

/* FINAL FIX — ROUNDED PHOTO VIEWER HEADER */
.catalog-image-header {
  border-radius: 22px 22px 0 0 !important;
  overflow: hidden;
  background-clip: padding-box;
  border-top: 1px solid rgba(180,255,0,.08);
}

.catalog-image-dialog {
  overflow: hidden;
}


/* CLOSE BUTTON — REFINED PROPORTIONS */
.catalog-image-close {
  width: 54px !important;
  height: 54px !important;
  min-width: 54px !important;
  min-height: 54px !important;
  font-size: 27px !important;
  border-radius: 50% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
}


/* RESTORE GREEN TOP BORDER */
.catalog-image-dialog {
  position: relative;
}

.catalog-image-dialog::before {
  content: "";
  position: absolute;
  top: 0;
  left: 34px;
  right: 34px;
  height: 1px;
  background: #9ce900;
  box-shadow: 0 0 5px rgba(156, 233, 0, .25);
  z-index: 20;
  pointer-events: none;
}


/* HARMONIZE TOP BORDER AND ROUNDED CORNERS */

.catalog-image-dialog::before {
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  height: 34px !important;
  background: transparent !important;
  border-top: 1px solid #9ce900;
  border-radius: 34px 34px 0 0;
  box-shadow: none !important;
  box-sizing: border-box;
}

.catalog-image-header {
  border-radius: 22px 22px 0 0;
}

.catalog-image-close {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  font-size: 24px !important;
}


/* CLOSE BUTTON — COMPACT SIZE */
.catalog-image-header .catalog-image-close {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  font-size: 22px !important;
  line-height: 1 !important;
  flex: 0 0 42px !important;
  border-radius: 50% !important;
}


/* FORCE COMPACT CLOSE BUTTON */
#catalogImageModal .catalog-image-dialog
.catalog-image-header .catalog-image-close {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  flex: 0 0 42px !important;
  font-size: 21px !important;
  transform: scale(.82) !important;
  transform-origin: center;
}

