/* AweZoom v2.0 — Product Image Zoom (lafataeildrago-style layout) */

/* ─── Container: flex row, fill parent column ──────────── */
[data-awezoom] {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  position: relative;
}

/* ─── Main image wrapper ───────────────────────────────── */
.az-main {
  display: block;
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  border-radius: 4px;
  background: #f8f8f8;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.az-main img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.2s ease;
}

/* ─── Zoom hint icon ───────────────────────────────────── */
.az-zoom-hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: opacity 0.2s ease;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  z-index: 2;
}

/* ─── Lens ─────────────────────────────────────────────── */
.az-lens {
  display: none;
}

/* ─── Zoom layer (inner zoom, clipped to container) ────── */
.az-zoom-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  border-radius: 4px;
}

.az-zoom-layer.az-active {
  opacity: 1;
}

.az-zoom-img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none !important;
  will-change: transform;
}

/* ─── Navigation arrows (FD-style bare chevrons) ──────── */
.az-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 80px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(100, 100, 100, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.15s ease, background 0.15s ease;
  box-shadow: none;
  padding: 0;
}

.az-main:hover .az-arrow {
  opacity: 1;
}

.az-arrow:hover {
  color: rgba(60, 60, 60, 1);
  background: rgba(255, 255, 255, 0.4);
}

.az-prev { left: 0; }
.az-next { right: 0; }

/* ─── Thumbnails: vertical column on the left ──────────── */
.az-thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  order: -1;
  width: 100px;
}

.az-thumb {
  display: block;
  width: 100px;
  height: 100px;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
  background: #fff;
}

.az-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.az-thumb:hover {
  border-color: #999;
}

.az-thumb.az-active {
  border-color: #4a7c59;
  box-shadow: 0 0 0 1px #4a7c59;
}

/* ─── Fullscreen overlay ───────────────────────────────── */
.az-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.92);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.az-fullscreen.az-fs-open {
  opacity: 1;
}

.az-fs-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s ease;
  padding: 0;
}

.az-fs-close:hover {
  background: rgba(255,255,255,0.3);
}

.az-fs-counter {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  z-index: 2;
}

.az-fs-img-container {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.az-fs-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  transition: opacity 0.15s ease, transform 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.az-fs-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s ease;
  padding: 0;
}

.az-fs-arrow:hover {
  background: rgba(255,255,255,0.25);
}

.az-fs-prev { left: 16px; }
.az-fs-next { right: 16px; }

/* ─── Mobile responsive ────────────────────────────────── */
@media (max-width: 767px) {
  [data-awezoom] {
    flex-direction: column;
  }

  .az-thumbs {
    flex-direction: row;
    order: 0;
    width: auto;
    flex-wrap: wrap;
  }

  .az-thumb {
    width: 56px;
    height: 56px;
  }

  .az-arrow {
    width: 28px;
    height: 48px;
    opacity: 0.7;
  }
  .az-main:hover .az-arrow {
    opacity: 0.7;
  }
  .az-prev { left: 0; }
  .az-next { right: 0; }

  .az-zoom-hint {
    width: 30px;
    height: 30px;
    bottom: 8px;
    right: 8px;
  }

  .az-fs-arrow {
    width: 40px;
    height: 40px;
  }
  .az-fs-prev { left: 8px; }
  .az-fs-next { right: 8px; }

  .az-fs-close {
    top: 10px;
    right: 10px;
  }
}

/* ─── Accessibility / reduced motion ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  .az-main img,
  .az-lens,
  .az-zoom-layer,
  .az-fullscreen,
  .az-fs-img,
  .az-arrow {
    transition: none;
  }
}

/* ─── Product heading H1 fix ───────────────────────────── */
.product-heading h1,
h1.product-name {
  font-size: 25px;
}

/* ─── Fullscreen product info ──────────────────────────── */
.az-fs-info {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255,255,255,0.9);
  z-index: 100002;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  padding: 0 60px;
}

.az-fs-brand {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  margin-bottom: 4px;
}

.az-fs-title {
  display: block;
  font-size: 18px;
  font-weight: 500;
}