/* ==========================================================================
   Estilos Generales y Body
   ========================================================================== */

   body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    text-align: left; /* Asegura alineación izquierda por defecto */
}

/* ==========================================================================
   Encabezado (header)
   ========================================================================== */

header {
    background-color: #f0ebeb;
    color: rgb(233, 32, 99);
    padding: 5px;
    width: 100%;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Sombra sutil */
}

/* ==========================================================================
   Contenedor Principal (main-container)
   ========================================================================== */

.main-container {
    display: flex;
    max-width: 1400px; /* O el ancho máximo deseado */
    margin: 20px auto;
    gap: 20px; /* Espacio entre controles y preview */
    padding: 0 20px; /* Padding lateral */
    flex-wrap: wrap; /* Permitir que pasen a modo columna en pantallas pequeñas */
}

/* ==========================================================================
   Controles (controls)
   ========================================================================== */

.controls {
    flex: 0 0 400px; /* Base de 400px, no crece, puede encoger */
    background: rgb(243, 222, 222);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px; /* Espacio entre elementos de control */
    position: relative; /* Contexto de apilamiento */
    z-index: 10;        /* Por encima del preview */
}

/* ==========================================================================
   Vista Previa del Producto (preview-container)
   ========================================================================== */

.preview-container {
    flex: 1; /* Ocupa el espacio restante */
    min-width: 300px; /* Ancho mínimo para evitar que sea muy pequeño */
    background: rgb(243, 222, 222);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative; /* Contexto de apilamiento */
    z-index: 5;         /* Debajo de .controls */
}

.product-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 650px;
    border: 1px dashed #ccc;
    overflow: hidden;
    background: #d4d4d4;
    position: relative; /* Clave para z-index hijos */
    z-index: 1;         /* Por encima del fondo de .preview-container */
}

/* ==========================================================================
   Elementos dentro de la Previsualización
   ========================================================================== */

#tshirt-image { /* Imagen base (actualizada por JS) */
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    z-index: 0; /* Siempre detrás de los elementos añadidos */
    user-select: none;
    pointer-events: none;
}

.draggable-image,
.draggable-text {
    position: absolute;
    cursor: grab;
    user-select: none;
    touch-action: none; /* Mejora para compatibilidad táctil */
    /* z-index será asignado por JS (>= 100) */
}

/* Estilo para el elemento seleccionado */
.selected {
    outline: 2px dashed deeppink !important;
    outline-offset: 3px;
}


/* ==========================================================================
   Controles Específicos
   ========================================================================== */

/* --- Controles Z-index y Borrado --- */
#zIndexControls {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 15px; /* Añadir espacio arriba */
}
#zIndexControls button {
    flex-grow: 1;
    background-color: #e9ecef; /* Un gris más claro */
    color: #495057;
    border: 1px solid #ced4da;
}
#zIndexControls button:hover {
    background-color: #dee2e6;
    border-color: #adb5bd;
}
#zIndexControls button:disabled {
     background-color: #f8f9fa;
     color: #adb5bd;
     cursor: not-allowed;
     border-color: #e9ecef;
 }

/* --- Botones genéricos en .controls --- */
.controls button,
.controls .btn,
.controls .style-btn,
.controls .btn-rotacion,
.action-buttons button /* Aplicar estilo base también a botones de acción */
 {
    background-color: rgb(233, 32, 99);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    padding: 8px 15px; /* Ajustar padding */
    font-size: 14px;
    border-radius: 6px; /* Un poco menos redondeado */
    line-height: 1.5;
    text-align: center;
    font-weight: bold; /* Negrita para más legibilidad */
    border: 1px solid rgba(233, 32, 99, 0.65);
}
.controls button:hover,
.controls .btn:hover,
.controls .style-btn:hover,
.controls .btn-rotacion:hover,
.action-buttons button:hover {
    background-color: rgb(255, 119, 164);
    color: rgb(37, 37, 37);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Sombra al hacer hover */
}
/* Estilo para botones deshabilitados */
.controls button:disabled,
.controls .btn:disabled,
.controls .style-btn:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    border-color: #b3b3b3;
    box-shadow: none; /* Quitar sombra al deshabilitar */
}

/* --- Botón Subir Imagen --- */
.upload-button {
    background-color: #5c9ded;
    border-radius: 6px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    color: white;
    text-align: center;
    transition: background-color 0.3s;
    border: 1px solid #4a8ad8; /* Borde para upload */
    font-weight: bold;
}
.upload-button:hover {
    background-color: #4a8ad8;
}
.upload-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

/* --- Controles de Imagen --- */
.image-controls-section {
    border-top: 1px solid #ddd;
    padding-top: 15px;
}
.image-size-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* --- Grupos de Controles (General) --- */
.control-group {
    margin-bottom: 15px;
}
.control-group label,
.image-size-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

/* Sliders */
.control-group input[type="range"],
.image-size-container input[type="range"] {
    width: 100%;
    margin: 5px 0;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
}
.control-group input[type="range"]::-webkit-slider-thumb,
.image-size-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: rgb(233, 32, 99); /* Color Principal */
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white; /* Borde blanco */
    box-shadow: 0 0 3px rgba(0,0,0,0.3);
}
.control-group input[type="range"]::-moz-range-thumb,
.image-size-container input[type="range"]::-moz-range-thumb { /* Firefox */
    width: 16px;
    height: 16px;
    background: rgb(233, 32, 99);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 0 3px rgba(0,0,0,0.2);
}

/* Spans para valor de sliders */
#spacing-value, #stretch-value, #rotation-value, #image-rotation-value, #curvature-value {
    display: inline-block;
    margin-left: 8px;
    color: #555;
    font-size: 13px;
    font-weight: bold;
    min-width: 35px; /* Más espacio */
    text-align: right;
}

/* --- Botón Desplegar Editor --- */
.ndx-Welcome_Lg-buttonImage { /* Se aplica al botón de Editor */
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    background-color: #eee;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s;
}
.ndx-Welcome_Lg-buttonImage:hover {
    background-color: #e0e0e0;
}
.ndx-Welcome_Lg-buttonImage img.upload-icon {
     width: 24px; /* Ajustar si es necesario */
     height: 24px;
}

/* --- Contenido Desplegable (SOLO PARA EDITOR AHORA) --- */
.collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.8s ease-in-out, padding-top 0.8s ease-in-out, padding-bottom 0.8s ease-in-out, border-color 0.8s ease-in-out;
    background-color: white;
    padding: 0 15px; /* Padding horizontal, 0 vertical inicial */
    border-radius: 5px;
    margin-top: 5px;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid transparent;
    position: relative;
    z-index: 1;
}
/* Estado Abierto */
.collapse.show {
    max-height: 1000px; /* Suficientemente grande, ajustar si se corta */
    padding-top: 15px;
    padding-bottom: 15px;
    border-color: #ddd;
}

/* --- Editor de Texto Dentro del Desplegable --- */
#desplegable hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}
#desplegable h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #555;
    font-size: 14px;
}
#desplegable input[type="text"] {
    width: calc(100% - 22px); /* Ajustar ancho por padding + border */
    padding: 10px; /* Más padding */
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}
#desplegable select {
     width: 100%;
     padding: 10px;
     margin-bottom: 15px;
     border: 1px solid #ddd;
     border-radius: 4px;
     background-color: white; /* Fondo blanco */
}
#desplegable .color-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}
#desplegable .color-preview {
    width: 24px;
    height: 24px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
/* Inputs de color */
#desplegable input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 40px; /* Tamaño fijo */
    height: 28px;
    background-color: transparent; /* Quitar fondo por defecto */
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    padding: 0; /* Quitar padding interno */
}
#desplegable input[type="color"]::-webkit-color-swatch {
    border-radius: 3px;
    border: none; /* Quitar borde interno de la muestra */
}
#desplegable input[type="color"]::-moz-color-swatch { /* Firefox */
    border-radius: 3px;
    border: none;
}


/* Botones Bold/Italic */
.style-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
.style-btn {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    background: #f0f0f0;
    font-size: 14px;
    transition: all 0.2s;
    flex-grow: 1;
    font-weight: normal; /* Quitar negrita heredada */
}
.style-btn N, .style-btn i { /* Usando los tags N e I */
     font-size: 16px;
     font-style: normal; /* Resetear estilo por defecto */
     font-weight: bold; /* Aplicar el estilo visual deseado */
}
.style-btn i {
     font-style: italic; /* Aplicar cursiva si es el botón de cursiva */
     font-weight: bold; /* Puede ser bold italic */
}
.style-btn:hover {
    background: #e0e0e0;
}
.style-btn.active { /* Estado activo para B/I */
    background: rgb(233, 32, 99); /* Usar color principal */
    color: white;
    border-color: rgba(233, 32, 99, 0.8);
}
.style-btn:disabled {
    background-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    border-color: #dee2e6;
}

/* === NUEVOS ESTILOS PARA SELECTOR DE VISTA Y COLOR UNIFICADO === */

.view-selector {
    display: flex; /* Usa Flexbox para alinear los items horizontalmente */
    justify-content: space-around; /* O space-between, o flex-start, según prefieras */
    align-items: flex-start; /* Alinea los items en la parte superior */
    flex-wrap: wrap; /* Permite que los items pasen a la siguiente línea si no caben */
    gap: 10px; /* Espacio entre los items */
}

/* Cada item individual (imagen + etiqueta) */
.thumbnail-item {
  display: flex;           /* Usa Flexbox para la disposición interna */
  flex-direction: column; /* Apila la imagen y la etiqueta verticalmente */
  align-items: center;   /* Centra la imagen y la etiqueta horizontalmente */
  text-align: center;    /* Asegura que el texto de la etiqueta esté centrado */
  cursor: pointer;       /* Mantiene el cursor de puntero en el item */
  /* Puedes añadir un ancho fijo si quieres que todos tengan el mismo tamaño */
  /* width: 80px; */
}

.view-thumbnail {
    width: 50px;
    height: 50px;
    border: 2px solid #ddd; /* Borde inicial */
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    object-fit: contain;
    background-color: #fff; /* Fondo por si las imágenes son transparentes */
    transition: border-color 0.3s, box-shadow 0.3s;
}

.view-thumbnail:hover {
    border-color: #aaa;
}

.view-thumbnail.active {
    border-color: rgb(233, 32, 99);
    box-shadow: 0 0 6px rgba(233, 32, 99, 0.6);
}

/* Estilo opcional para la etiqueta de texto */
.thumbnail-label {
  font-size: 0.8em;    /* Tamaño de fuente más pequeño */
  color: #555;       /* Color de texto gris oscuro */
  margin-top: 4px;   /* Pequeño espacio entre la imagen y la etiqueta */
}

.color-picker-unified {
    text-align: left; /* O 'center' */
    padding-top: 5px;
}

/* Botones de colores unificados */
.color-picker-unified .color-button {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    margin: 4px; /* Más espacio */
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative; /* Para tooltip si se añade */
    vertical-align: middle;
}
.color-picker-unified .color-button:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}
/* Estado activo para color seleccionado */
.color-picker-unified .color-button.active {
     transform: scale(1.1);
     box-shadow: 0 0 0 3px white, 0 0 0 5px rgb(233, 32, 99); /* Doble borde */
}

/* Colores específicos (heredados de la sección anterior, mantener aquí) */
.color-button[data-color="rojo"] { background-color: red; }
.color-button[data-color="blanco"] { background-color: #ffffff; border-color: #eee; }
.color-button[data-color="vinotinto"] { background-color: rgb(126, 8, 79); }
.color-button[data-color="negro"] { background-color: black; }
.color-button[data-color="gris_claro"] { background-color: #cccccc; }
.color-button[data-color="gris"] { background-color: #888888; }
.color-button[data-color="azul"] { background-color: blue; }
.color-button[data-color="cielo"] { background-color: #87CEEB; }
.color-button[data-color="rosada"] { background-color: pink; }
.color-button[data-color="verde"] { background-color: green; }
.color-button[data-color="amarilla"] { background-color: yellow; }
.color-button[data-color="naranja"] { background-color: orange; }
.color-button[data-color="verde_L"] { background-color: rgb(60, 255, 0); }
.color-button[data-color="verde_P"] { background-color: rgb(57, 148, 77); }
.color-button[data-color="beige"] { background-color: rgb(185, 185, 185); }
.color-button[data-color="lila"] { background-color: rgb(199, 106, 106); }
.color-button[data-color="azul_oscuro"] { background-color: rgb(11, 0, 59); }


/* Tooltip (si decides añadir el HTML para ellos) */
.tooltip {
    visibility: hidden; opacity: 0; position: absolute;
    bottom: 130%; left: 50%; transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8); color: #fff; padding: 4px 8px;
    border-radius: 4px; font-size: 12px; white-space: nowrap;
    transition: opacity 0.3s, visibility 0.3s; z-index: 20;
}
.tooltip::after {
    content: ""; position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%); border-width: 4px; border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}
.color-button:hover .tooltip { visibility: visible; opacity: 1; }


/* ==========================================================================
   Mensajes de Feedback
   ========================================================================== */
.feedback-message {
    position: fixed; bottom: 20px; left: 50%;
    transform: translateX(-50%); padding: 12px 20px; border-radius: 6px;
    color: white; font-weight: bold; display: block; opacity: 0;
    visibility: hidden; transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    z-index: 1050; min-width: 200px; text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.feedback-message.success { background-color: #4CAF50; }
.feedback-message.warning { background-color: #ff9800; }
.feedback-message.info { background-color: #2196F3; }
.feedback-message.error { background-color: #f44336; }

/* ==========================================================================
   Botones de Acción (Guardar/Enviar)
   ========================================================================== */
.action-buttons {
    display: flex;
    justify-content: center; /* Centrar los botones */
    gap: 20px; /* Más espacio entre ellos */
    margin: 30px auto 20px auto; /* Margen arriba/abajo, centrado horizontal */
    max-width: 600px; /* Limitar ancho */
    padding: 0 20px; /* Padding por si se reduce la pantalla */
}
.action-buttons button {
    flex: 1; /* Ocupar espacio igual */
    padding: 12px 20px;
    font-size: 16px;
    /* Hereda estilos base de .controls button */
}
#save-draft { background-color: #ffc107; color: #333; }
#save-draft:hover { background-color: #ffca2c; }
#send-design { background-color: #4CAF50; color: white; }
#send-design:hover { background-color: #45a049; }

/* ==========================================================================
   Diseño Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .main-container { flex-direction: column; gap: 30px; }
    .controls { max-width: none; order: 2; flex-basis: auto; }
    .preview-container { order: 1; padding: 10px; flex-basis: auto; }
    .product-preview { height: 50vh; min-height: 350px; }
    .action-buttons { /* Ajustar si antes eran fixed */
        max-width: none;
        margin-top: 10px;
        gap: 10px; /* Menos gap */
    }
}

@media (max-width: 480px) {
    body { font-size: 14px; } /* Tamaño base móvil */
    header h3 { font-size: 1.1em; }
    .controls { padding: 15px; gap: 10px; }
    .preview-container { padding: 5px; }
    .product-preview { min-height: 300px; height: 45vh; }
    #zIndexControls { gap: 5px; justify-content: center;} /* Centrar botones zIndex */
    #zIndexControls button { flex-grow: 0; padding: 6px 10px; font-size: 11px; } /* Hacerlos más pequeños */
    .controls button, .controls .style-btn, .action-buttons button { font-size: 13px; padding: 8px 10px; }
    .ndx-Welcome_Lg-buttonImage { font-size: 14px; padding: 8px 10px; gap: 5px; }
    .ndx-Welcome_Lg-buttonImage img.upload-icon { width: 20px; height: 20px; }
    .upload-button { font-size: 13px; padding: 10px 12px; gap: 8px; }
    .view-thumbnail { width: 40px; height: 40px; }
    .color-picker-unified .color-button { width: 24px; height: 24px; margin: 3px; }
    #desplegable input[type="text"], #desplegable select { padding: 8px; }
    .feedback-message { width: calc(100% - 20px); bottom: 10px; font-size: 13px; padding: 10px 15px; }
    .action-buttons button { font-size: 14px; padding: 10px 15px;}
}


/* ==========================================================================
   Fuentes personalizadas (CORREGIDO)
   ========================================================================== */
@font-face { font-family: 'Gumela'; src: url('../fonts/Gumela.ttf') format('truetype'); }
@font-face { font-family: 'Jane'; src: url('../fonts/Janefrediction.ttf') format('truetype'); }
@font-face { font-family: 'AABSOLUTEEMPIRE'; src: url('../fonts/AABSOLUTEEMPIRE.TTF') format('truetype'); }
@font-face { font-family: 'AOOX FONT'; src: url('../fonts/AOOX FONT.TTF') format('truetype'); }
@font-face { font-family: 'AGAINST REGULAR'; src: url('../fonts/AGAINST REGULAR.OTF') format('opentype'); }
@font-face { font-family: 'AKIRA EXPANDED'; src: url('../fonts/AKIRA EXPANDED DEMO.OTF') format('opentype'); }
@font-face { font-family: 'ARIAL ROUNDED'; src: url('../fonts/ARIALROUNDEDMTBOLD.TTF') format('truetype'); }
@font-face { font-family: 'AVIGEA'; src: url('../fonts/AVIGEA.TTF') format('truetype'); }
@font-face { font-family: 'BABY GIRLY'; src: url('../fonts/BABY GIRLY.OTF') format('opentype'); }
@font-face { font-family: 'CENTSCHBKCYRILL'; src: url('../fonts/CENTSCHBKCYRILL BT ROMAN.TTF') format('truetype'); }
@font-face { font-family: 'AW CHUBBY'; src: url('../fonts/AW CHUBBY.OTF') format('opentype'); }
@font-face { font-family: 'BOLDENA'; src: url('../fonts/BOLDENABOLDPERSONALUSE.TTF') format('truetype'); }
@font-face { font-family: 'COLLEGIA'; src: url('../fonts/COLLEGIATEINSIDEFLF.TTF') format('truetype'); }
@font-face { font-family: 'COLLEGIATE LINE'; src: url('../fonts/COLLEGIATEOUTLINEFLF.TTF') format('truetype'); }
@font-face { font-family: 'Comic Sans'; src: url('../fonts/COMIC.TTF') format('truetype'); }
@font-face { font-family: 'Controller w01'; src: url('../fonts/CONTROLLER EXT W01 FOUR.TTF') format('truetype'); }
@font-face { font-family: 'Dades'; src: url('../fonts/DADES.TTF') format('truetype'); }
@font-face { font-family: 'DONGRAFFITI'; src: url('../fonts/DONGRAFFITI.OTF') format('opentype'); }
@font-face { font-family: 'EVERGREEN'; src: url('../fonts/EVERGREEN.OTF') format('opentype'); }
@font-face { font-family: 'HEMOSAOPTI'; src: url('../fonts/HERMOSAOPTI.OTF') format('opentype'); }
@font-face { font-family: 'HESS-GOTHIC'; src: url('../fonts/HESS-GOTHIC-ROUND-NF-W01-BOLD.TTF') format('truetype'); }
@font-face { font-family: 'Hobo'; src: url('../fonts/Hobo BT.ttf') format('truetype'); }
@font-face { font-family: 'ITCKRIST'; src: url('../fonts/ITCKRIST.TTF') format('truetype'); }
@font-ce { font-family: 'LAUGHING'; src: url('../fonts/LAUGHING AND SMILING.TTF') format('truetype'); }
@font-face { font-family: 'LINTSEC'; src: url('../fonts/LINTSEC.TTF') format('truetype'); }
@font-face { font-family: 'Melted'; src: url('../fonts/MELTED MONSTER.TTF') format('truetype'); }
@font-face { font-family: 'MESSAGES'; src: url('../fonts/MESSAGES.TTF') format('truetype'); }
@font-face { font-family: 'Miss Scarlett Plain'; src: url('../fonts/Miss Scarlett Plain Regular.ttf') format('truetype'); }
@font-face { font-family: 'MIAMIFC'; src: url('../fonts/MIAMIFC.TTF') format('truetype'); }
@font-face { font-family: 'PAPERNOTES'; src: url('../fonts/PAPERNOTES.TTF') format('truetype'); }
@font-face { font-family: 'POPPINS'; src: url('../fonts/POPPINS-REGULAR.TTF') format('truetype'); }
/*
 * SOLUCIÓN DEFINITIVA PARA CONFLICTO DE ARRASTRE/SCROLL EN MÓVILES
 * Esta regla le dice al navegador que no intente hacer scroll cuando 
 * un gesto táctil se origina dentro de este contenedor, dando 
 * prioridad a nuestro JavaScript para manejar el arrastre.
 */
/* ==========================================================================
   SOLUCIÓN AGRESIVA PARA COMPATIBILIDAD TÁCTIL EN TEMAS CONFLICTIVOS
   ========================================================================== */

/* 
/* ==========================================================================
   SOLUCIÓN DEFINITIVA Y ANTI-BLOQUEO PARA TEMAS WORDPRESS
   ========================================================================== */

/* 
 * PASO 1: Prevenimos cualquier scroll horizontal oculto que pueda venir del tema.
 * Esto asegura una base limpia para trabajar.
 */
html, body {
    overflow-x: hidden !important;
}

/* 
 * PASO 2: Identificamos y neutralizamos los contenedores del tema.
 * Forzamos que el contenedor del contenido (.entry-content) y sus padres
 * permitan el scroll por defecto, para no romper la navegación del resto de la página.
 */
main.wp-block-group,
div.entry-content {
    touch-action: auto !important;
}

/* 
 * PASO 3: Esta es la regla "bala de plata".
 * Blindamos el área de diseño MÁS INTERNA para que NINGÚN gesto
 * de scroll o zoom pueda iniciarse aquí. Esto da prioridad absoluta
 * a nuestro JavaScript para el arrastre de elementos.
 */
.product-preview {
    touch-action: none !important;
    -ms-touch-action: none !important; /* Compatibilidad con navegadores de Microsoft */
}