.custom-finishes-wrapper {
  margin: 1.5rem 0;
}

.finish-group-label {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: block;
}

.selected-finish-name {
  font-weight: 400;
  text-transform: none;
  color: #666;
}

.finishes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.finish-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #fff;
}

.finish-card-item:hover {
  border-color: #999;
}

.finish-card-item.is-selected {
  border-color: #000;
  box-shadow: 0 0 0 1px #000;
}

.finish-swatch-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f8f8;
}

.finish-swatch-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.finish-swatch-color {
  width: 100%;
  height: 100%;
  display: block;
}

.finish-swatch-fallback {
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
}

.finish-details {
  text-align: center;
  display: flex;
  flex-direction: column;
}

.finish-title {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.finish-price-tag {
  font-size: 0.7rem;
  color: #666;
}

/* --- DEMO STYLES --- */
.demo-area {
   background: #e9ecef;
   border: 2px dashed #adb5bd;
   padding: 60px 20px;
   display: flex;
   justify-content: center;
   gap: 25px;
   margin-bottom: 30px;
}

.finish-swatch-wrapper {
   width: 70px;
   height: 70px;
   border-radius: 12px;
   border: 3px solid var(--border-color);
   overflow: hidden;
   background: #fff;
}

.finish-swatch-color {
   display: block;
   width: 100%;
   height: 100%;
}

/* --- TOOLTIP CSS (The actual code to copy) --- */
.finish-card-item {
   position: relative;
   cursor: pointer;
}

.custom-tooltip {
   position: absolute;
   bottom: 125%;
   left: 50%;
   transform: translateX(-50%);
   background-color: #ffffff;
   color: #000000;
   padding: 8px 14px;
   border: 3px solid #000000;
   box-shadow: 4px 4px 0px #000000;
   font-size: 14px;
   font-weight: 700;
   white-space: nowrap;
   opacity: 0;
   visibility: hidden;
   transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
   z-index: 100;
   pointer-events: none;
}

/* Flecha principal (borde negro) */
.custom-tooltip::after {
   content: '';
   position: absolute;
   top: 100%;
   left: 50%;
   margin-left: -9px;
   border-width: 9px;
   border-style: solid;
   border-color: #000000 transparent transparent transparent;
}

/* Triángulo interior (fondo blanco para tapar la flecha principal y dejar solo el borde) */
.custom-tooltip::before {
   content: '';
   position: absolute;
   top: calc(100% - 4px);
   left: 50%;
   margin-left: -5px;
   border-width: 5px;
   border-style: solid;
   border-color: #ffffff transparent transparent transparent;
   z-index: 1;
}

.finish-card-item:hover .custom-tooltip {
   opacity: 1;
   visibility: visible;
   transform: translate(-50%, -8px);
}

.tooltip-price {
   display: inline-block;
   margin-left: 6px;
   padding-left: 6px;
   border-left: 2px solid #000000;
   color: #ff0055;
}

/* --- CODE BLOCKS --- */
pre {
   background: #111111;
   color: #f8f8f2;
   padding: 20px;
   border-radius: 0;
   border: 3px solid var(--border-color);
   box-shadow: 4px 4px 0px var(--border-color);
   overflow-x: auto;
   font-family: "Fira Code", "Courier New", Courier, monospace;
   font-size: 14px;
   margin-bottom: 20px;
}

code {
   font-family: inherit;
}

/* Oculta visualmente el selector nativo, pero lo deja en el DOM para que nuestro JS pueda hacer clic en él */
.finish-group-container {
  margin-bottom: 2rem; /* Espacio debajo del bloque */
  padding-bottom: 1.5rem; /* Espacio antes de la línea */
  border-bottom: 1px solid #eaeaea; /* Línea gris separadora (opcional) */
}

/* Evita que el último grupo tenga espacio o línea extra debajo */
.finish-group-container:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
