/* ==========================================================================
   0. RESET E COMPONENTES OCULTOS
   ========================================================================== */
.radio-oculto {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  display: none !important;
}

/* ==========================================================================
   1. PREVIEW CONTAINER (Estrutura Base Estabilizada)
   ========================================================================== */
.tag-preview {
  padding: 10px;
  display: inline-block;
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 550px;
  /* Mantém um tamanho controlado na tela */
}

.earring-wrapper {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
}

/* Camada de cor inteligente (Usa máscara para não vazar o fundo) */
#earringColorLayer {
  position: absolute;
  inset: 0;
  z-index: 1;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* Imagem base do brinco */
#earringPreview {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   2. ELEMENTOS INTERNOS DO PREVIEW
   ========================================================================== */

/* Nome da Fazenda (SVG) - Ajustado para alinhar perfeitamente sobre a imagem */
.farm-name-svg {
  position: absolute;
  top: 50px;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: visible;
}

#farmNameTextPath {
  font-size: 24px;
  font-weight: 900;
  fill: #000 !important;
  letter-spacing: 1px;
  dominant-baseline: middle;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

/* Logomarca no Simulador */
.logo-preview-img {
  position: absolute;
  top: 53%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 130px;
  max-height: 90px;
  object-fit: contain;
  z-index: 5;
  pointer-events: none;
}

/* Texto Livre Tratado (Quebra linha e não sai da imagem) */
.free-text-preview {
  position: absolute;
  top: 63%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: bold;
  color: #000;
  text-align: center;
  width: 70%;
  max-width: 70%;
  line-height: 1.2;
  pointer-events: none;
  z-index: 10;
  white-space: pre-line;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Numeração Principal */
.earring-number {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 6.5rem;
  /* Ajustado para não estourar em códigos grandes */
  font-weight: 800;
  color: #000;
  z-index: 11;
  text-align: center;
  width: 80%;
  white-space: nowrap;
  letter-spacing: -2px;
}

/* ==========================================================================
   3. SELEÇÃO DE TAMANHOS (Cards)
   ========================================================================== */
.earring-sizes-container {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

.size-option {
  cursor: pointer;
  border: 2px solid #999;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  background: white;
  padding: 1rem;
  flex: 1;
}

.size-option-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}

.size-option-info {
  flex-grow: 1;
  text-align: center;
}

.size-option-info strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.dimensions {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.indication {
  font-size: 0.75rem;
  color: #666;
}

.size-option:hover {
  border-color: #28a745;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

.size-option.selected {
  border: 3px solid #28a745;
  background: white;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

/* ==========================================================================
   4. SELEÇÃO DE CORES
   ========================================================================== */
.color-option {
  cursor: pointer;
  display: inline-block !important;
  width: 32px !important;
  height: 32px !important;

  /* display: inline-flex !important; */
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s ease;
  /* width: 56px !important;
  height: 56px !important; */
}

.color-option:hover {
  transform: scale(1.1);
}

.color-circle {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #1a1a1a;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

/* .color-circle {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  display: block !important;
  border: 2px solid #ccc !important;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
} */

input[type='radio'][name='earring_color']:checked+label .color-circle {
  border: 3px solid #000 !important;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
  transform: scale(1.05);
}

.color-circle.border-dark {
  border-color: #bbb !important;
}

/* ==========================================================================
   5. ESTILIZAÇÃO COMPLEMENTAR DO FORMULÁRIO
   ========================================================================== */
.mb-4 {
  margin-bottom: 2rem;
}

label.fw-bold {
  color: #333;
  margin-bottom: 1rem;
  display: block;
  font-size: 1.1rem;
}

.preview-info-text {
  text-align: right !important;
  padding-left: 2.2rem;
}

/* ==========================================================================
   6. RESPONSIVIDADE MOBILE
   ========================================================================== */
@media (max-width: 768px) {
  .tag-preview {
    margin-bottom: 30px;
    max-width: 320px;
  }

  .earring-number {
    font-size: 4.5rem;
  }

  .earring-sizes-container {
    flex-direction: column;
  }

  .preview-info-text {
    text-align: left !important;
    padding-left: 0rem;

  }
}

/* Formatação do texto de instruções do Upload */
.upload-instructions {
  font-size: 0.82rem;
  line-height: 1.45;
}

.upload-instructions .instruction-line {
  color: #6c757d;
}