/*
 * Muebles Filadelfia — visor de producto V2
 * Ficha rápida, catálogo, ficha individual y vista previa administrativa.
 */

.tech-media,
.mf-product-media,
.visual,
.admin-image-preview-media {
  position: relative;
  overflow: hidden;
}

#techImage.mf-zoom-ready,
.mf-product-media > img.mf-zoom-ready,
.product-photo.mf-zoom-ready,
#adminImagePreviewImage.mf-zoom-ready {
  cursor: zoom-in;
  transition: transform .28s ease, opacity .2s ease;
  transform-origin: 50% 50%;
  will-change: transform;
}

.mf-zoom-label {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(63, 48, 40, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #3f3028;
  box-shadow: 0 5px 18px rgba(26, 20, 16, .12);
  font: 700 10px/1 Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  pointer-events: none;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.mf-zoom-label::before {
  content: "";
  width: 14px;
  height: 14px;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233f3028' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4M11 8v6M8 11h6'/%3E%3C/svg%3E");
}

@media (hover: hover) and (pointer: fine) {
  #techImage.mf-zoom-ready.mf-zoom-hover,
  .mf-product-media > img.mf-zoom-ready.mf-zoom-hover,
  #adminImagePreviewImage.mf-zoom-ready.mf-zoom-hover {
    transform: scale(1.65);
  }

  .product-photo.mf-zoom-ready.mf-zoom-hover {
    transform: scale(1.18) !important;
  }
}

.visual > .mf-zoom-label {
  top: 12px;
  right: 12px;
  bottom: auto;
  z-index: 5;
}

.admin-image-preview-media > .mf-zoom-label {
  z-index: 5;
}

.mf-zoom-lightbox[hidden] {
  display: none !important;
}

.mf-zoom-lightbox {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(12, 10, 9, .94);
  color: #fff;
  opacity: 0;
  transition: opacity .2s ease;
  touch-action: none;
}

.mf-zoom-lightbox.mf-zoom-open {
  opacity: 1;
}

.mf-zoom-topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 12px 18px;
  padding: 12px max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  background: rgba(12, 10, 9, .72);
}

.mf-zoom-title {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, .9);
  font: 600 13px/1.35 Arial, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mf-zoom-close,
.mf-zoom-control {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font: 400 25px/1 Arial, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mf-zoom-close:hover,
.mf-zoom-control:hover,
.mf-zoom-close:focus-visible,
.mf-zoom-control:focus-visible {
  border-color: #fff;
  background: rgba(255, 255, 255, .2);
  outline: none;
}

.mf-zoom-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.mf-zoom-stage.mf-is-zoomed { cursor: grab; }
.mf-zoom-stage.mf-is-dragging { cursor: grabbing; }

.mf-zoom-full-image {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: auto;
  height: auto;
  max-width: 88vw;
  max-height: calc(100vh - 158px);
  object-fit: contain;
  transform: translate(-50%, -50%) translate3d(0, 0, 0) scale(1);
  transform-origin: center;
  transition: transform .18s ease;
  pointer-events: none;
  -webkit-user-drag: none;
}

.mf-zoom-stage.mf-is-dragging .mf-zoom-full-image,
.mf-zoom-stage.mf-is-pinching .mf-zoom-full-image {
  transition: none;
}

.mf-zoom-toolbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 72px;
  padding: 10px 18px;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, .12);
  background: rgba(12, 10, 9, .72);
}

.mf-zoom-level {
  min-width: 58px;
  color: rgba(255, 255, 255, .88);
  font: 700 12px/1 Arial, sans-serif;
  text-align: center;
}

.mf-zoom-reset {
  width: auto;
  min-width: 88px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body.mf-zoom-body-lock {
  overflow: hidden !important;
  overscroll-behavior: none;
}

@media (max-width: 760px) {
  .mf-zoom-label {
    right: 10px;
    bottom: 10px;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 9px;
  }
  .mf-zoom-topbar { min-height: 60px; }
  .mf-zoom-toolbar { min-height: 66px; }
  .mf-zoom-full-image {
    max-width: 94vw;
    max-height: calc(100vh - 142px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #techImage.mf-zoom-ready,
  .mf-product-media > img.mf-zoom-ready,
  .product-photo.mf-zoom-ready,
  #adminImagePreviewImage.mf-zoom-ready,
  .mf-zoom-lightbox,
  .mf-zoom-full-image {
    transition: none !important;
  }
}
