/* ==========================================================================
   Flatsome Child — Sofa 360° Viewer Styles
   ========================================================================== */

.jkm-sofa360-trigger {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 40px;
  height: 40px;
  padding: 0 10px !important;
  border-radius: 999px !important;
  background-color: rgba(255, 255, 255, 0.94) !important;
  color: #1f1f1f !important;
  border: 1px solid rgba(0, 0, 0, 0.14) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.jkm-sofa360-trigger:hover,
.jkm-sofa360-trigger:focus-visible {
  background-color: #111111 !important;
  color: #ffffff !important;
  border-color: #111111 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.jkm-sofa360-trigger svg {
  flex-shrink: 0;
}

.jkm-sofa360-trigger-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
}

/* Modal Container */
.jkm-sofa360-modal {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.jkm-sofa360-modal.is-open {
  display: flex;
}

.jkm-sofa360-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 21, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.jkm-sofa360-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
  height: min(86vh, 720px);
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: jkm360PopIn 0.2s ease-out;
}

@keyframes jkm360PopIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.jkm-sofa360-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid #eceef2;
  background: #ffffff;
}

.jkm-sofa360-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.jkm-sofa360-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1f2328;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jkm-sofa360-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #1f2328;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
  margin: 0;
  padding: 0;
}

.jkm-sofa360-close:hover {
  background: #e5e7eb;
}

/* Inline Shortcode Container */
.jkm-sofa360-inline {
  width: 100%;
  height: var(--jkm-360-height, 520px);
  border: 1px solid #eceef2;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

/* Canvas Stage */
.jkm-sofa360-stage {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  background: #ffffff;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.jkm-sofa360-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
}

.jkm-sofa360-stage.is-dragging canvas {
  cursor: grabbing;
}

.jkm-sofa360-stage.is-zoomed canvas {
  cursor: move;
  touch-action: none;
}

/* Progress Bar */
.jkm-sofa360-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.06);
  z-index: 4;
  transition: opacity 0.35s ease;
}

.jkm-sofa360-progress.is-done {
  opacity: 0;
  pointer-events: none;
}

.jkm-sofa360-progress-bar {
  width: 0%;
  height: 100%;
  background: #111111;
  transition: width 0.12s linear;
}

/* Drag Hint Overlay */
.jkm-sofa360-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.72);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.45s ease;
}

.jkm-sofa360-hint.is-hidden {
  opacity: 0;
}

/* Floating Glass Toolbar */
.jkm-sofa360-controls {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.jkm-sofa360-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #222222;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.jkm-sofa360-btn:hover,
.jkm-sofa360-btn.is-active {
  background: #111111;
  color: #ffffff;
}

.jkm-sofa360-counter {
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #555555;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.jkm-sofa360-divider {
  width: 1px;
  height: 18px;
  background: rgba(0, 0, 0, 0.12);
  margin: 0 2px;
}

@media (max-width: 767px) {
  .jkm-sofa360-modal {
    padding: 0;
  }

  .jkm-sofa360-dialog {
    height: 100vh;
    height: 100dvh;
    max-width: none;
    border-radius: 0;
  }

  .jkm-sofa360-inline {
    height: min(var(--jkm-360-height, 420px), 75vw);
    min-height: 280px;
  }

  .jkm-sofa360-controls {
    bottom: 12px;
    padding: 4px 8px;
  }

  .jkm-sofa360-btn {
    width: 30px;
    height: 30px;
  }
}
