/* ==========================================================================
   Sombreros Estacionales (Todas las temporadas en seasons.json)
   Posicionamiento 100% relativo al marco (#specialty) y a la Gift Card
   mediante variables CSS (--hat-x, --hat-y, --hat-w, --hat-r) persistidas
   en app/data/season_hats_positions.json.
   Efecto 3D en 2 capas: .ws-hat-back (z-index: 0, detrás de la foto/card)
   + foto/card (z-index: 2) + capa frontal del sombrero (z-index: 6 / 25).
   Version: v1.11.0
   ========================================================================== */

.specialty-frame-wrap {
  position: relative;
  width: 100%;
  overflow: visible;
  isolation: isolate;
}

.specialty-frame-wrap .split-img {
  position: relative;
  z-index: 2;
}

.ws-season-hat-corner {
  position: absolute;
  left: var(--hat-x, 67%);
  top: var(--hat-y, -13%);
  width: var(--hat-w, 44%);
  height: auto;
  max-width: none;
  z-index: 6;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: center center;
  transform: rotate(var(--hat-r, 0deg));
  filter: drop-shadow(0 12px 18px rgba(24, 6, 10, 0.34));
}

.ws-season-hat-corner.ws-hat-back {
  z-index: 0;
  pointer-events: none !important;
  outline: none !important;
  box-shadow: none !important;
  filter: drop-shadow(0 8px 14px rgba(24, 6, 10, 0.22));
}

/* Gift Card — Sándwich 3D: capa trasera (z:0) < tarjeta (z:2) < capa frontal (z:25) */
.gc-card-link {
  position: relative;
  overflow: visible;
  isolation: isolate;
}

.gc-credit-card {
  position: relative;
  z-index: 2;
}

.ws-season-hat-gc {
  position: absolute;
  left: var(--hat-x, -5.8%);
  top: var(--hat-y, -10.2%);
  width: var(--hat-w, 22%);
  height: auto;
  max-width: none;
  z-index: 25;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: center center;
  transform: rotate(var(--hat-r, 0deg));
  filter: drop-shadow(0 6px 10px rgba(20, 4, 8, 0.34));
  transition: transform 0.45s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ws-season-hat-gc.ws-hat-back {
  z-index: 0;
  pointer-events: none !important;
  outline: none !important;
  box-shadow: none !important;
  filter: drop-shadow(0 4px 8px rgba(20, 4, 8, 0.22));
}

.gc-card-link:hover .ws-season-hat-gc {
  transform: translateY(-8px) scale(1.02) rotate(var(--hat-r, 0deg));
}

/* ==========================================================================
   Modo Calibrador Visual (EXCLUSIVO en localhost — jamás se carga en prod)
   ========================================================================== */
html.ws-hat-edit-mode .ws-season-hat-corner,
html.ws-hat-edit-mode .ws-season-hat-gc {
  pointer-events: auto;
  cursor: grab;
  transition: none !important;
  outline: 2px dashed rgba(37, 99, 235, 0.85);
  outline-offset: 2px;
  border-radius: 6px;
}

html.ws-hat-edit-mode .ws-season-hat-corner.is-hat-selected,
html.ws-hat-edit-mode .ws-season-hat-gc.is-hat-selected {
  outline: 2px solid #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

html.ws-hat-edit-mode .ws-season-hat-corner:active,
html.ws-hat-edit-mode .ws-season-hat-gc:active {
  cursor: grabbing;
}

html.ws-hat-edit-mode .gc-card-link:hover .gc-credit-card {
  transform: none !important;
}

html.ws-hat-edit-mode .gc-card-link:hover .ws-season-hat-gc {
  transform: rotate(var(--hat-r, 0deg)) !important;
}

/* Gizmos flotantes (escala + rotación) montados en el contenedor del sombrero */
.ws-hat-gizmo {
  position: absolute;
  z-index: 40;
  pointer-events: none;
  transform-origin: center center;
  box-sizing: border-box;
  border: 1.5px dashed rgba(245, 158, 11, 0.95);
  border-radius: 6px;
}

.ws-hat-gizmo-rot-stem {
  position: absolute;
  left: 50%;
  top: -28px;
  width: 2px;
  height: 28px;
  margin-left: -1px;
  background: #f59e0b;
  pointer-events: none;
}

.ws-hat-gizmo-rot {
  position: absolute;
  left: 50%;
  top: -40px;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: grab;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.ws-hat-gizmo-scale {
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: nwse-resize;
  pointer-events: auto;
}

/* Botón lanzador flotante (localhost) */
.ws-hat-cal-launcher {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 99990;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(18, 18, 22, 0.92);
  color: #fff;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.ws-hat-cal-launcher:hover {
  transform: translateY(-2px);
  background: #111;
}

/* Panel flotante del calibrador */
.ws-hat-cal-panel {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 99995;
  width: 318px;
  max-width: calc(100vw - 36px);
  background: rgba(17, 18, 23, 0.95);
  color: #f5f5f7;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px;
  overflow: hidden;
  user-select: none;
}

.ws-hat-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  cursor: move;
}

.ws-hat-cal-title {
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-hat-cal-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.ws-hat-cal-status.is-saving {
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
}

.ws-hat-cal-status.is-error {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.ws-hat-cal-close {
  background: transparent;
  border: 0;
  color: #a1a1aa;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.ws-hat-cal-close:hover {
  color: #fff;
}

.ws-hat-cal-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-hat-cal-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-hat-cal-select {
  flex: 1;
  background: #23252e;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.ws-hat-cal-btn {
  background: #272935;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ws-hat-cal-btn:hover {
  background: #353848;
}

.ws-hat-cal-btn.is-active {
  background: #2563eb;
  border-color: #60a5fa;
}

.ws-hat-cal-btn.is-primary {
  background: #16a34a;
  border-color: #4ade80;
  flex: 1;
}

.ws-hat-cal-btn.is-primary:hover {
  background: #15803d;
}

.ws-hat-cal-sliders {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  background: rgba(255, 255, 255, 0.04);
  padding: 9px 10px;
  border-radius: 10px;
}

.ws-hat-cal-slider-item {
  display: grid;
  grid-template-columns: 62px 1fr 48px;
  align-items: center;
  gap: 8px;
}

.ws-hat-cal-slider-item label {
  color: #d4d4d8;
  font-size: 11.5px;
  font-weight: 600;
}

.ws-hat-cal-slider-item input[type="range"] {
  width: 100%;
  accent-color: #f59e0b;
  cursor: pointer;
}

.ws-hat-cal-slider-item output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #fde68a;
  font-size: 11.5px;
  font-weight: 600;
}

.ws-hat-cal-hint {
  font-size: 11px;
  line-height: 1.4;
  color: #a1a1aa;
  margin: 0;
}
