/* ==========================================================================================
   VARIABLES BASE Y RESET
========================================================================================== */

:root {
    --ifp-gray-light: #f6f6f6;
    --ifp-gray: #e3e3e3;
    --ifp-gray-dark: #cccccc;
    --ifp-border: #dadada;
    --ifp-text: #2d2d2d;
    --ifp-muted: #818181;
    --ifp-accent: #00A3FF;
    --ifp-white: #ffffff;
    --ifp-radius: 6px;
    --ifp-shadow-soft: 0 1px 4px rgba(0,0,0,0.06);
    --ifp-font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

.ifp-editor-printful, 
.ifp-editor-printful *, 
.ifp-editor-printful *::before, 
.ifp-editor-printful *::after {
    box-sizing: border-box;
}

.ifp-editor-printful {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.ifp-editor-printful * {
    font-family: var(--ifp-font);
}

/* ==========================================================================================
   CONTENEDOR PRINCIPAL
========================================================================================== */

.ifp-editor-printful {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    background: var(--ifp-white);
    display: flex;
    flex-direction: column;
    color: var(--ifp-text);
    font-size: 14px;
    overflow: hidden; /* Forzamos cero scroll global */
}

/* ==========================================================================================
   TOPBAR
========================================================================================== */

.ifp-topbar {
    height: 52px;
    background: var(--ifp-white);
    border-bottom: 1px solid var(--ifp-border);
    box-shadow: var(--ifp-shadow-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    font-size: 13px;
    z-index: 20;
}

/* 1️⃣ Ocultar nombre del producto que no aporta nada */
.ifp-topbar-product-name {
    display: none !important;
}

/* 2️⃣ Contenedor derecho: flechas / diseño / maquetas a la derecha */
.ifp-topbar-right {
    margin-left: auto !important;      /* empuja todo a la derecha */
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;  /* se pegan a la derecha del todo */
    gap: 6px !important;
}

.ifp-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ifp-topbar-product-name {
    font-weight: 600;
}

.ifp-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ifp-link-button {
    background: none;
    border: none;
    color: var(--ifp-accent);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

/* Icon buttons (undo / redo, etc.) */
.ifp-icon-button {
    background: var(--ifp-gray-light);
    border: 1px solid var(--ifp-border);
    padding: 6px 8px;
    border-radius: var(--ifp-radius);
    font-size: 12px;
    cursor: pointer;
}

/* Toggle Diseño / Maquetas */
.ifp-topbar-toggle {
    padding: 6px 10px;
    background: var(--ifp-gray-light);
    border-radius: var(--ifp-radius);
    cursor: pointer;
    border: 1px solid var(--ifp-border);
    font-size: 12px;
}

/* ========================================================
   FORZAR FONT AWESOME PARA TODOS LOS ICONOS
   ======================================================== */
/* Los iconos .fas y .far deben usar Font Awesome, no Inter */
i.fas,
i.far,
i.fab,
i.fal,
i.fad,
.fa,
[class*="fa-"] {
    font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands" !important;
    font-weight: 900 !important;
    font-style: normal !important;
}

.ifp-topbar-toggle-active {
    background: var(--ifp-accent);
    color: var(--ifp-white);
    border-color: var(--ifp-accent);
}

/* ==========================================================================================
   CUERPO EN GRID: ICONOS / OPCIONES / CANVAS / CAPAS
========================================================================================== */

.ifp-body {
    flex: 1; /* Ocupa todo el espacio entre header y footer */
    display: grid;
    grid-template-columns: 72px 280px minmax(520px, 1fr) 260px;
    width: 100%;
    overflow: hidden; /* Cero scroll aquí también */
    min-height: 0;   /* Fix para flexbox */
}

/* =========================================================
   MODO UBICACIONES — estilo Printful (correcto)
========================================================= */

/* Ocultamos SOLO el canvas */
.ifp-layout-locations .ifp-panel-canvas {
    display: none !important;
}

/* El panel derecho ocupa el espacio del canvas + panel derecho */
.ifp-layout-locations .ifp-panel-right {
    grid-column: 3 / 5; /* desde la columna del canvas hasta el final */
    width: 100%;
    max-width: none;
}

/* Ajuste interno */
.ifp-layout-locations .ifp-panel-right-inner {
    padding: 24px;
}


/* ------------------------------------------------------------------
   PANEL ICONOS LATERAL IZQUIERDO (PRODUCTO / SUBIDAS / TEXTO)
------------------------------------------------------------------ */

.ifp-panel-icons {
    background: var(--ifp-white);
    border-right: 1px solid var(--ifp-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
    gap: 4px;
}

/* Botones verticales */
.ifp-icon-nav-btn {
    width: 100%;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--ifp-text);
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--ifp-radius);
}

.ifp-icon-nav-btn i {
    font-size: 16px;
}

.ifp-icon-nav-btn span {
    display: block;
}

.ifp-icon-nav-btn-active {
    background: #e5f6ff;
    color: var(--ifp-accent);
    border-left: 3px solid var(--ifp-accent);
}

/* ------------------------------------------------------------------
   PANEL OPCIONES IZQUIERDO (contenido segun pestaña)
------------------------------------------------------------------ */

.ifp-panel-options {
    background: var(--ifp-white);
    border-right: 1px solid var(--ifp-border);
    padding: 18px;
    overflow-y: auto;
}

.ifp-panel-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 16px;
}

.ifp-options-panel {
    display: none;
}

.ifp-options-panel-active {
    display: block;
}

/* Asegurar que el panel activo sea visible */
.ifp-options-panel-active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Panel de opciones específico para imágenes */
.ifp-options-panel[data-panel="imagen"] {
    display: none;
}

.ifp-options-panel[data-panel="imagen"].ifp-options-panel-active {
    display: block;
}

.ifp-options-block {
    margin-bottom: 16px;
}

.ifp-tag {
    font-size: 11px;
    color: var(--ifp-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Pills técnica */
.ifp-pill-group {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.ifp-pill {
    padding: 6px 10px;
    border-radius: var(--ifp-radius);
    background: var(--ifp-gray-light);
    border: 1px solid var(--ifp-border);
    cursor: pointer;
    font-size: 11px;
}

.ifp-pill-active {
    background: var(--ifp-accent);
    color: var(--ifp-white);
    border-color: var(--ifp-accent);
}

/* 🔒 Ocultar BORDADO (data-tech="embroidery") sin eliminarlo */
.ifp-pill[data-tech="embroidery"]{
    display: none !important;
}

/* =========================================================
   OCULTAR BORDADO (solo UI, sin eliminar lógica)
   ========================================================= */
.ifp-pill[data-tech="bordado"],
.ifp-pill[data-value="bordado"],
.ifp-pill[data-type="bordado"] {
    display: none !important;
}

/* Colores producto */
.ifp-color-swatches {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.ifp-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 0;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0 !important;
    margin: 0 !important;
}

/* Forzar que se muestre el color inline del HTML usando regla posterior */
.ifp-editor-printful .ifp-color-swatch {
    background: none !important;
    background-color: var(--swatch-color, #f6f6f6) !important;
}

/* Mantener color en hover para swatches no seleccionados */
.ifp-editor-printful .ifp-color-swatch:hover:not(.ifp-color-swatch-active) {
    background-color: var(--swatch-color, #f6f6f6) !important;
    transform: scale(1.08);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Mantener color en focus para swatches no seleccionados */
.ifp-editor-printful .ifp-color-swatch:focus:not(.ifp-color-swatch-active) {
    background-color: var(--swatch-color, #f6f6f6) !important;
    border-color: rgba(0, 163, 255, 0.3) !important;
}

/* Mantener color en active para swatches no seleccionados */
.ifp-editor-printful .ifp-color-swatch:active:not(.ifp-color-swatch-active) {
    background-color: var(--swatch-color, #f6f6f6) !important;
}

.ifp-color-swatch-active {
    border-color: var(--ifp-accent) !important;
    border-width: 3px !important;
    box-shadow: 0 0 0 3px rgba(0, 163, 255, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.3) !important;
    background-color: var(--swatch-color, #f6f6f6) !important;
}

/* Forzar color en todos los estados para swatches activos */
.ifp-color-swatch-active:hover,
.ifp-color-swatch-active:focus,
.ifp-color-swatch-active:active {
    background-color: var(--swatch-color, #f6f6f6) !important;
    border-color: var(--ifp-accent) !important;
    border-width: 3px !important;
    box-shadow: 0 0 0 3px rgba(0, 163, 255, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.3) !important;
}

/* Tallas */
.ifp-size-row {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.ifp-size-btn {
    padding: 6px 10px;
    border-radius: var(--ifp-radius);
    border: 1px solid var(--ifp-border);
    background: var(--ifp-gray-light);
    font-size: 11px;
    cursor: pointer;
}

.ifp-size-btn-active {
    background: var(--ifp-accent);
    color: var(--ifp-white);
    border-color: var(--ifp-accent);
}

/* Inputs y botones de Texto/Subidas */
.ifp-input {
    width: 100%;
    border-radius: var(--ifp-radius);
    border: 1px solid var(--ifp-border);
    padding: 7px 9px;
    font-size: 13px;
}

/* ==========================================================================================
   PANEL CENTRAL (CANVAS + MOCKUP)
========================================================================================== */

.ifp-panel-canvas {
    display: flex;
    flex-direction: column;
    background: var(--ifp-white);
    min-width: 0;
}

/* Tabs de ubicación (Impresión frontal, trasera...) */
.ifp-location-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--ifp-border);
}

/* Anti-FOUC tabs: ocultar SOLO cuando JS lo indique */
.ifp-location-tabs[data-ifp-hide="1"] {
  visibility: hidden;
}

.ifp-location-tab {
    padding: 6px 10px;
    background: var(--ifp-gray-light);
    border-radius: var(--ifp-radius);
    border: 1px solid var(--ifp-border);
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.ifp-location-tab-active {
    background: var(--ifp-accent);
    color: var(--ifp-white);
    border-color: var(--ifp-accent);
}

/* ============================================
   PANEL 2 — Herramientas de imagen (debajo de la barra)
   ============================================ */

#ifp-panel-2 {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 20px 0;
    background: var(--ifp-white);
    border-bottom: 1px solid var(--ifp-border);
    display: none;              /* oculto por defecto */
}

/* Clase para mostrar el panel 2 */
#ifp-panel-2.ifp-panel-2-active {
    display: flex;              /* se muestra como flex cuando está activo */
    flex-direction: column;
    gap: 12px;
}

/* Bloques internos de herramientas de imagen */
#ifp-panel-2 .ifp-image-tool-block {
    background: #ffffff;
    border: 1px solid var(--ifp-border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

/* Etiquetas dentro del panel 2 */
#ifp-panel-2 .ifp-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

/* === FIX ANCHURA / ALTURA — Printful-like === */
#ifp-panel-2 input[type="number"] {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    padding: 6px 8px !important;
    border-radius: 6px !important;
    border: 1px solid var(--ifp-border) !important;
    font-size: 13px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

#ifp-panel-2 .ifp-label {
    font-size: 12px !important;
    font-weight: 600 !important;
    opacity: 0.85 !important;
}

/* Fila de botones “voltear” en transformar imagen */
#ifp-panel-2 .ifp-transform-flip-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* === FIX ESTÉTICO VOLTEAR — estilo Printful === */
#ifp-panel-2 .ifp-btn-flip {
    flex: 1;
    padding: 6px 0 !important;
    font-size: 12px !important;
    background: var(--ifp-gray-light) !important;
    border: 1px solid var(--ifp-border) !important;
    border-radius: 6px !important;
    cursor: pointer;
    text-align: center;
    transition: background .15s, border-color .15s;
}

#ifp-panel-2 .ifp-btn-flip:hover {
    background: #efefef !important;
    border-color: #c7c7c7 !important;
}

#ifp-panel-2 .ifp-btn-flip:active {
    background: #e5e5e5 !important;
}

/* Botones secundarios dentro del panel 2 */
#ifp-panel-2 .ifp-btn-secondary {
    flex: 1;
    text-align: center;
}

/* =========================================================
   GRUPOS DE ACCIONES CONTEXTUALES (default / text)
   ========================================================= */
.ifp-design-actions-group{
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap; /* por si en pantallas pequeñas no caben */
}

.ifp-action-btn {
    padding: 6px 10px;
    border-radius: var(--ifp-radius);
    background: var(--ifp-white);
    border: 1px solid var(--ifp-border);
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
}

/* =========================================================
   ICONOS EN ACCIONES (estilo Printful-like)
   ========================================================= */
/* Alias para iconos en grupo default */
.ifp-action-btn.ifp-action-btn--with-icon{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

/* Icono hereda el color del texto del botón */
.ifp-action-ico{
    font-size: 12px;
    color: currentColor;
    opacity: 0.9;
}

/* Para evitar que el <span> genere saltos raros */
.ifp-action-btn.ifp-action-btn--text span{
    display: inline-block;
}

.ifp-action-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

/* =========================================================
   ESTILOS PARA EL PANEL DE DISEÑO (PATRONES)
   ========================================================= */
.ifp-pattern-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.ifp-pattern-btn {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ifp-gray-light);
    border: 1px solid var(--ifp-border);
    border-radius: var(--ifp-radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    padding: 0;
}

.ifp-pattern-btn:hover {
    background: #efefef;
    border-color: #c7c7c7;
}

.ifp-pattern-btn.active {
    background: var(--ifp-accent) !important;
    color: var(--ifp-white) !important;
    border-color: var(--ifp-accent) !important;
}

/* Iconos estilo Printful para los botones de "Diseño" */
.ifp-pattern-btn {
    position: relative;
    overflow: hidden;
}

/* Ocultamos el SVG original que viene desde el PHP */
.ifp-pattern-btn svg,
.ifp-pattern-btn i {
    display: none;
}

/* Base de todos los iconos (texto) */
.ifp-pattern-btn::before {
    content: "";
    display: block;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.1;
    white-space: pre; /* para que funcione \A como salto de línea */
}

/* ✕  – modo "ninguno" */
.ifp-pattern-btn[data-pattern="none"]::before {
    content: "✕";
    font-size: 16px;
}

/* Bloque (P P / P P) */
.ifp-pattern-btn[data-pattern="grid"]::before {
    content: "P P\A P P";
}

/* Desplazamiento medio (fila inferior corrida) */
.ifp-pattern-btn[data-pattern="half-drop"]::before {
    content: "P P\A\00A0P P";
}

/* Ladrillo (dos filas largas) */
.ifp-pattern-btn[data-pattern="brick"]::before {
    content: "P P P\A P P P";
}

/* Espejo horizontal (P q / b d) */
.ifp-pattern-btn[data-pattern="mirror-h"]::before {
    content: "P q\A b d";
}

/* Espejo vertical (PPF) */
.ifp-pattern-btn[data-pattern="mirror-v"]::before {
    content: "P P F";
}

/* Reflejado / diagonal */
.ifp-pattern-btn[data-pattern="mirror-diag"]::before {
    content: "P F\A F P";
}

/* =======================
   ICONOS PANEL "DISEÑO" — estilo tipo Printful
   ======================= */
.ifp-pattern-grid .ifp-pattern-btn {
    position: relative;
    font-size: 0;              /* Oculta el texto P / PPF del botón */
}

/* Marco base del icono */
.ifp-pattern-grid .ifp-pattern-btn::before {
    content: "";
    display: block;
    width: 26px;
    height: 26px;
    margin: 0 auto;
    border-radius: 4px;
    border: 1px solid currentColor;
    box-sizing: border-box;
}

/* Capa interna donde dibujamos el patrón */
.ifp-pattern-grid .ifp-pattern-btn::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
}

/* 1) Botón "sin diseño" — cuadro con X */
.ifp-pattern-grid .ifp-pattern-btn:nth-child(1)::after {
    background:
        linear-gradient(45deg, transparent 46%, currentColor 48%, currentColor 52%, transparent 54%),
        linear-gradient(-45deg, transparent 46%, currentColor 48%, currentColor 52%, transparent 54%);
}

/* 2) Patrón compacto (tipo mosaico completo) */
.ifp-pattern-grid .ifp-pattern-btn:nth-child(2)::after {
    background:
        linear-gradient(currentColor 0 0) 0   0  / 6px 6px no-repeat,
        linear-gradient(currentColor 0 0) 12px 0  / 6px 6px no-repeat,
        linear-gradient(currentColor 0 0) 0   12px / 6px 6px no-repeat,
        linear-gradient(currentColor 0 0) 12px 12px / 6px 6px no-repeat;
}

/* 3) Patrón desplazado (tipo ladrillo) */
.ifp-pattern-grid .ifp-pattern-btn:nth-child(3)::after {
    background:
        linear-gradient(currentColor 0 0) 1px  2px / 6px 6px no-repeat,
        linear-gradient(currentColor 0 0) 11px 2px / 6px 6px no-repeat,
        linear-gradient(currentColor 0 0) 6px  10px / 6px 6px no-repeat,
        linear-gradient(currentColor 0 0) 16px 10px / 6px 6px no-repeat;
}

/* 4) Patrón 3×3 (all-over más denso) */
.ifp-pattern-grid .ifp-pattern-btn:nth-child(4)::after {
    background:
        linear-gradient(currentColor 0 0) 0   0  / 4px 4px no-repeat,
        linear-gradient(currentColor 0 0) 7px 0  / 4px 4px no-repeat,
        linear-gradient(currentColor 0 0) 14px 0 / 4px 4px no-repeat,
        linear-gradient(currentColor 0 0) 0   7px / 4px 4px no-repeat,
        linear-gradient(currentColor 0 0) 7px 7px / 4px 4px no-repeat,
        linear-gradient(currentColor 0 0) 14px 7px / 4px 4px no-repeat,
        linear-gradient(currentColor 0 0) 7px 14px / 4px 4px no-repeat;
}

/* 5) Patrón columnas verticales */
.ifp-pattern-grid .ifp-pattern-btn:nth-child(5)::after {
    background:
        linear-gradient(currentColor 0 0) 3px  2px / 4px 14px no-repeat,
        linear-gradient(currentColor 0 0) 11px 2px / 4px 14px no-repeat,
        linear-gradient(currentColor 0 0) 19px 2px / 4px 14px no-repeat;
}

/* 6) Patrón filas horizontales */
.ifp-pattern-grid .ifp-pattern-btn:nth-child(6)::after {
    background:
        linear-gradient(currentColor 0 0) 2px 3px  / 14px 4px no-repeat,
        linear-gradient(currentColor 0 0) 2px 11px / 14px 4px no-repeat,
        linear-gradient(currentColor 0 0) 2px 19px / 14px 4px no-repeat;
}

/* 7) Patrón "marco" (borde exterior) */
.ifp-pattern-grid .ifp-pattern-btn:nth-child(7)::after {
    border: 2px solid currentColor;
    background: transparent;
}

/* Zona del mockup */
.ifp-mockup-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    overflow: auto;
}

.ifp-mockup-inner {
    position: relative;
    transform-origin: center top;
}

/* Mockup grande: ajustado para no forzar scroll */
.ifp-mockup-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 300px); /* Más conservador para evitar scroll */
    user-select: none;
    margin: 0 auto;
}

/* Guía de impresión Printful-style (marco + cruz) */
#ifp-guide-area {
    position: absolute;
    z-index: 25;
    pointer-events: none;
    border: 2px dashed rgba(0, 128, 255, 0.6);
    display: none;
    background: transparent !important;
    border-radius: 4px;
}

/* Cruz completa centrada, siempre dentro del área */
#ifp-guide-area::before,
#ifp-guide-area::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

/* Línea vertical */
#ifp-guide-area::before {
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 2px dashed rgba(0,128,255,0.6);
}

/* Línea horizontal */
#ifp-guide-area::after {
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    border-top: 2px dashed rgba(0,128,255,0.6);
}

/* Estado “centrado” (marco y cruz en verde) */
#ifp-guide-area.ifp-guide-snapped {
    border-color: rgba(34,197,94,0.9);
}
#ifp-guide-area.ifp-guide-snapped::before {
    border-left-color: rgba(34,197,94,0.9);
}
#ifp-guide-area.ifp-guide-snapped::after {
    border-top-color: rgba(34,197,94,0.9);
}

/* Texto estilo Printful debajo del área */
#ifp-print-area-label {
    position: absolute;
    background: var(--ifp-accent);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    left: 50%;
    bottom: -18px;                /* 🔽 lo baja más */
    transform: translate(-50%, 10px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    z-index: 30;
}



/* Footer del canvas: zoom + colores */
.ifp-canvas-footer {
    display: flex;
    justify-content: center; /* Centrar barra de zoom */
    align-items: center;
    padding: 8px 20px;
    border-top: 1px solid var(--ifp-border);
    background: var(--ifp-gray-light);
}

.ifp-zoom-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px; /* Aumentado para el botón reset */
    font-size: 12px;
}

#ifp-zoom-range {
    width: 180px;
}

.ifp-zoom-reset-btn {
    background: var(--ifp-gray-dark);
    border: 1px solid var(--ifp-border);
    color: var(--ifp-text);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 11px;
    padding: 0;
}

.ifp-zoom-reset-btn:hover {
    background: var(--ifp-white);
    border-color: var(--ifp-accent);
    color: var(--ifp-accent);
    transform: rotate(-30deg);
}

.ifp-mockup-colors {
    display: flex;
    gap: 6px;
}

.ifp-mockup-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.ifp-mockup-color-active {
    border-color: var(--ifp-accent);
}

/* ==========================================================================================
   PANEL DERECHO (CAPAS)
========================================================================================== */

.ifp-panel-right {
    background: var(--ifp-white);
    border-left: 1px solid var(--ifp-border);
    padding: 18px;
    overflow-y: auto;
}

.ifp-right-top-icons {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 10px;
}

/* Caja de capas */
.ifp-layers-panel {
    border-radius: var(--ifp-radius);
    border: 1px solid var(--ifp-border);
    background: var(--ifp-gray-light);
    padding: 8px;
    min-height: 120px;
}

.ifp-layers-header {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 6px;
}

.ifp-layer-btn {
    background: var(--ifp-white);
    border-radius: var(--ifp-radius);
    border: 1px solid var(--ifp-border);
    padding: 4px 6px;
    cursor: pointer;
}

/* Lista de capas */
.ifp-layers-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ifp-layer-item {
    background: var(--ifp-white);
    border: 1px solid var(--ifp-border);
    border-radius: var(--ifp-radius);
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.ifp-layer-name {
    font-size: 12px;
}

.ifp-layer-controls {
    display: flex;
    gap: 4px;
}

.ifp-layer-control-btn {
    background: var(--ifp-gray-light);
    border-radius: 4px;
    border: 1px solid var(--ifp-border);
    padding: 3px 5px;
    cursor: pointer;
}

/* ==========================================================================================
   FOOTER GENERAL (AÑADIR AL CARRITO)
========================================================================================== */

.ifp-editor-footer {
    background: var(--ifp-white);
    border-top: 1px solid var(--ifp-border);
    padding: 0 40px; /* Extremos absolutos */
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    min-height: 70px;
    z-index: 100;
    width: 100%;
}

.ifp-editor-footer-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ifp-footer-mockup-thumb img {
    width: 40px;    /* mini mockup fijo, no gigante */
    height: auto;
    display: block;
}

.ifp-footer-product-name {
    font-size: 13px;
    font-weight: 600;
}

.ifp-footer-product-price {
    font-size: 12px;
    color: var(--ifp-muted);
}

.ifp-editor-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ifp-btn-primary {
    padding: 8px 18px;
    background: var(--ifp-accent);
    color: var(--ifp-white);
    border-radius: var(--ifp-radius);
    border: none;
    cursor: pointer;
    font-size: 13px;
}

/* =========================================================
   FIX: forzar estilo en CTAs del panel izquierdo (Subidas)
   (Astra/Woo pueden sobreescribir .ifp-btn-primary)
   ========================================================= */
#ifp-upload-trigger.ifp-btn-primary,
#ifp-load-design-btn.ifp-btn-primary {
  background: var(--ifp-accent) !important;
  border-color: var(--ifp-accent) !important;
  color: var(--ifp-accent-contrast) !important;
}

/* Iconos dentro del botón: siempre visibles */
#ifp-upload-trigger.ifp-btn-primary i,
#ifp-load-design-btn.ifp-btn-primary i {
  color: currentColor !important;
}

/* Hover */
#ifp-upload-trigger.ifp-btn-primary:hover,
#ifp-load-design-btn.ifp-btn-primary:hover {
  filter: brightness(0.92);
}

/* Iconos en cualquier CTA primaria */
.ifp-btn-primary i,
.ifp-btn-primary svg {
  color: currentColor !important;
  fill: currentColor !important;
}

/* ==========================================================================================
   UTILIDADES
========================================================================================== */

.ifp-help-text {
    font-size: 12px;
    color: var(--ifp-muted);
    margin-bottom: 8px;
}

.ifp-label {
    font-size: 12px;
    margin-bottom: 4px;
    display: block;
}

/* ==========================================================================================
   RESPONSIVE
========================================================================================== */

@media (max-width: 1200px) {
    .ifp-body {
        /* también damos algo más al panel 2 en pantallas medias */
        grid-template-columns: 72px 260px minmax(480px, 1fr) 240px;
    }
}

@media (max-width: 992px) {
    .ifp-body {
        grid-template-columns: 72px 220px minmax(0,1fr);
    }
    .ifp-panel-right {
        display: none; /* ocultamos capas en pantallas más pequeñas */
    }
}

@media (max-width: 768px) {
    .ifp-body {
        grid-template-columns: 72px minmax(0,1fr);
    }
    .ifp-panel-options {
        border-right: none;
        border-top: 1px solid var(--ifp-border);
        grid-column: 1 / -1;
        order: 2;
    }
    .ifp-panel-canvas {
        grid-column: 2 / -1;
    }
}

/* ==========================================================================================
   === OVERRIDES SUAVES: TEXTO VISIBLE, HOVER NEUTRO, AZUL SUAVE ===
========================================================================================== */

/* 1) Botón genérico del editor (.ifp-btn) sin marrón */
.ifp-btn,
.ifp-btn:visited {
    color: var(--ifp-text);
    background: var(--ifp-gray-light);
    border: 1px solid var(--ifp-border);
}

.ifp-btn:hover,
.ifp-btn:focus {
    background: var(--ifp-gray-light);
    color: var(--ifp-text);
}

/* 2) Suavizar estados "activos" (azul casi transparente) y texto oscuro */
.ifp-topbar-toggle-active,
.ifp-location-tab-active,
.ifp-pill-active,
.ifp-size-btn-active {
    background: rgba(0, 163, 255, 0.10);          /* azul muy suave */
    color: var(--ifp-text);                       /* texto gris, no blanco */
    border-color: rgba(0, 163, 255, 0.45);        /* borde azul sutil */
}

/* 3) Asegurar color de texto en iconos/labels de navegación */
.ifp-icon-nav-btn,
.ifp-icon-nav-btn span,
.ifp-icon-nav-btn i,
.ifp-topbar-toggle,
.ifp-topbar-toggle-active {
    color: var(--ifp-text);
}

/* ===================================================================
   FIJAR COLOR DE TEXTO/ICONOS + HOVER NEUTRO (SIN MARRÓN)
   =================================================================== */

/* 1. Forzar textos e iconos oscuros en TODOS los botones del editor */
.ifp-editor-printful button,
.ifp-editor-printful button i,
.ifp-editor-printful .ifp-icon-nav-btn,
.ifp-editor-printful .ifp-icon-nav-btn span,
.ifp-editor-printful .ifp-icon-nav-btn i,
.ifp-editor-printful .ifp-action-btn,
.ifp-editor-printful .ifp-location-tab,
.ifp-editor-printful .ifp-topbar-toggle,
.ifp-editor-printful .ifp-layer-btn,
.ifp-editor-printful .ifp-layer-control-btn,
.ifp-editor-printful .ifp-icon-button {
    color: var(--ifp-text) !important;
}

/* 2. HOVER NEUTRO: el ratón NO cambia a marrón ni resalta en exceso */

/* Iconos verticales (Producto / Subidas / Texto) */
.ifp-icon-nav-btn:hover {
    background: transparent;
    color: var(--ifp-text) !important;
}

/* Tabs de ubicación, acciones, pills, tallas, capas, iconos topbar, etc. */
.ifp-location-tab:hover:not(.ifp-location-tab-active),
.ifp-action-btn:hover,
.ifp-pill:hover:not(.ifp-pill-active),
.ifp-size-btn:hover:not(.ifp-size-btn-active),
.ifp-layer-btn:hover,
.ifp-layer-control-btn:hover,
.ifp-topbar-toggle:hover:not(.ifp-topbar-toggle-active),
.ifp-icon-button:hover {
    background: var(--ifp-gray-light) !important;
    border-color: var(--ifp-border) !important;
    color: var(--ifp-text) !important;
}

/* 3. Reset fuerte para cualquier .ifp-btn o .button que herede marrón del tema */
.ifp-editor-printful .ifp-btn,
.ifp-editor-printful .ifp-btn:hover,
.ifp-editor-printful .ifp-btn:focus,
.ifp-editor-printful .button,
.ifp-editor-printful .button:hover,
.ifp-editor-printful .button:focus {
    background: var(--ifp-gray-light) !important;
    border-color: var(--ifp-border) !important;
    color: var(--ifp-text) !important;
}

/* 4. Excepción: botón principal azul (Añadir al carrito) */
.ifp-editor-printful .ifp-btn-primary,
.ifp-editor-printful .ifp-btn-primary:hover,
.ifp-editor-printful .ifp-btn-primary:focus,
.ifp-editor-printful .ifp-btn-primary:active {
    background: var(--ifp-accent) !important;
    border-color: var(--ifp-accent) !important;
    color: var(--ifp-white) !important;
}

/* ============================
   NEUTRALIZAR EL MARRÓN EN :active
   ============================ */

/* 1. Cualquier botón dentro del editor cuando se hace clic */
.ifp-editor-printful button:active:not(.ifp-color-swatch-active),
.ifp-editor-printful .ifp-icon-nav-btn:active,
.ifp-editor-printful .ifp-action-btn:active,
.ifp-editor-printful .ifp-location-tab:active,
.ifp-editor-printful .ifp-topbar-toggle:active,
.ifp-editor-printful .ifp-layer-btn:active,
.ifp-editor-printful .ifp-layer-control-btn:active,
.ifp-editor-printful .ifp-size-btn:active,
.ifp-editor-printful .ifp-pill:active {
    background: var(--ifp-gray-light) !important;
    border-color: var(--ifp-border) !important;
    color: var(--ifp-text) !important;
    box-shadow: none !important;
}

/* Estado active para color-swatch seleccionado (excepción) */
.ifp-editor-printful .ifp-color-swatch-active:active {
    background-color: var(--swatch-color, #f6f6f6) !important;
    border-color: var(--ifp-accent) !important;
    border-width: 3px !important;
    box-shadow: 0 0 0 3px rgba(0, 163, 255, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.3) !important;
}

/* 2. Mantener el azul suave en los que están “seleccionados”,
      incluso mientras haces clic */
.ifp-editor-printful .ifp-location-tab-active:active,
.ifp-editor-printful .ifp-pill-active:active,
.ifp-editor-printful .ifp-size-btn-active:active,
.ifp-editor-printful .ifp-topbar-toggle-active:active {
    background: rgba(0, 163, 255, 0.10) !important;
    border-color: rgba(0, 163, 255, 0.45) !important;
    color: var(--ifp-text) !important;
    box-shadow: none !important;
}

/* 3. Excepción: botón principal (PRIMARY) */
.ifp-editor-printful .ifp-btn-primary,
.ifp-editor-printful .ifp-btn-primary:visited {
    background: var(--ifp-accent) !important;
    border-color: var(--ifp-accent) !important;
    color: var(--ifp-white) !important;
    box-shadow: none !important;
}

.ifp-editor-printful .ifp-btn-primary:hover,
.ifp-editor-printful .ifp-btn-primary:focus {
    background: var(--ifp-accent) !important;
    border-color: var(--ifp-accent) !important;
    color: var(--ifp-white) !important;
    box-shadow: 0 0 0 3px rgba(0, 163, 255, 0.25) !important;
    outline: none !important;
}

.ifp-editor-printful .ifp-btn-primary:active {
    background: var(--ifp-accent) !important;
    border-color: var(--ifp-accent) !important;
    color: var(--ifp-white) !important;
    box-shadow: none !important;
}

/* ============================
   ANTI-MARRÓN GLOBAL (hover/focus/active)
   ============================ */

/* Estado base de cualquier botón dentro del editor */
.ifp-editor-printful button:not(.ifp-btn-primary):not(.ifp-color-swatch),
.ifp-editor-printful a.button:not(.ifp-btn-primary),
.ifp-editor-printful .wp-element-button:not(.ifp-btn-primary),
.ifp-editor-printful .wp-block-button__link:not(.ifp-btn-primary) {
    background: var(--ifp-gray-light) !important;
    color: var(--ifp-text) !important;
    border-color: var(--ifp-border) !important;
    box-shadow: none !important;
}

/* Hover neutral (sin marrón) */
.ifp-editor-printful button:not(.ifp-btn-primary):hover,
.ifp-editor-printful a.button:not(.ifp-btn-primary):hover,
.ifp-editor-printful .wp-element-button:not(.ifp-btn-primary):hover,
.ifp-editor-printful .wp-block-button__link:not(.ifp-btn-primary):hover {
    background: var(--ifp-gray-light) !important;
    color: var(--ifp-text) !important;
    border-color: var(--ifp-border) !important;
    box-shadow: none !important;
}

/* Focus neutral (cuando queda “marcado” tras el clic) */
.ifp-editor-printful button:not(.ifp-btn-primary):focus,
.ifp-editor-printful a.button:not(.ifp-btn-primary):focus,
.ifp-editor-printful .wp-element-button:not(.ifp-btn-primary):focus,
.ifp-editor-printful .wp-block-button__link:not(.ifp-btn-primary):focus {
    background: var(--ifp-gray-light) !important;
    color: var(--ifp-text) !important;
    border-color: var(--ifp-border) !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Por si el tema mete algo extra en :active genérico */
.ifp-editor-printful button:not(.ifp-btn-primary):active,
.ifp-editor-printful a.button:not(.ifp-btn-primary):active,
.ifp-editor-printful .wp-element-button:not(.ifp-btn-primary):active,
.ifp-editor-printful .wp-block-button__link:not(.ifp-btn-primary):active {
    background: var(--ifp-gray-light) !important;
    color: var(--ifp-text) !important;
    border-color: var(--ifp-border) !important;
    box-shadow: none !important;
}

/* ==========================================================
   REACTIVAR AZUL SUAVE SOLO EN SELECCIONADOS
   ========================================================== */

.ifp-editor-printful 
.ifp-location-tab.ifp-location-tab-active,
.ifp-editor-printful 
.ifp-pill.ifp-pill-active,
.ifp-editor-printful 
.ifp-size-btn.ifp-size-btn-active,
.ifp-editor-printful 
.ifp-topbar-toggle.ifp-topbar-toggle-active {
    background: rgba(0, 163, 255, 0.15) !important;
    border-color: rgba(0, 163, 255, 0.45) !important;
    color: var(--ifp-text) !important;
    box-shadow: none !important;
}

.ifp-editor-printful 
.ifp-icon-nav-btn.ifp-icon-nav-btn-active {
    background: rgba(0, 163, 255, 0.15) !important;
    color: var(--ifp-accent) !important;
    border-left: 3px solid var(--ifp-accent) !important;
}

/* ================================================
   ESTADO SELECCIONADO - AZUL CIELO GELATO SUPERFINO
   ================================================ */

.ifp-selected {
    background: rgba(178, 235, 255, 0.08) !important;    /* Gelato azul cielo casi transparente */
    border-color: rgba(135, 206, 235, 0.4) !important;   /* Azul cielo gelato con 40% opacidad */
    color: #0369a1 !important;                           /* Texto azul más oscuro */
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Check estilo gelato - superfino y elegante */
.ifp-selected::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    /* Azul cielo gelato superfino */
    color: rgba(173, 216, 230, 0.95) !important; /* LightBlue con 95% opacidad */
    
    /* Tipografía ultra fina gelato */
    font-size: 11px;
    font-weight: 100; /* Extra light - super fino */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    /* Efectos gelato */
    text-shadow: 
        0 0 1px rgba(255, 255, 255, 0.9),
        0 0 2px rgba(173, 216, 230, 0.3);
    
    width: auto;
    height: auto;
    background: transparent !important; /* Sin fondo circular */
    border-radius: 0;
    display: block;
    z-index: 100;
}

/* Para botones de color (swatches) - estilo gelato sutil */
.ifp-color-swatch.ifp-selected {
    border-color: rgba(173, 216, 230, 0.6) !important; /* LightBlue con 60% opacidad */
    border-width: 2px !important; /* Fino */
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.8),
        inset 0 0 0 1px rgba(173, 216, 230, 0.3) !important;
    transform: scale(0.98);
    transition: all 0.2s ease;
}

/* Para tabs de ubicación - gelato sutil */
.ifp-location-tab.ifp-selected {
    background: rgba(224, 247, 255, 0.1) !important; /* Gelato muy sutil */
    border-color: rgba(135, 206, 235, 0.5) !important; /* SkyBlue con 50% opacidad */
    color: #0284c7 !important; /* Azul un poco más claro */
    border-bottom-width: 2px !important;
}

/* Para botones de tamaño - gelato mini */
.ifp-size-btn.ifp-selected {
    background: rgba(240, 249, 255, 0.05) !important; /* Casi transparente */
    border-color: rgba(173, 216, 230, 0.4) !important; /* LightBlue 40% */
    color: #0369a1 !important;
    box-shadow: inset 0 0 0 1px rgba(173, 216, 230, 0.1) !important;
}

/* Para botones de la topbar - gelato floating */
.ifp-topbar-toggle.ifp-selected {
    background: rgba(224, 247, 255, 0.07) !important;
    border-color: rgba(135, 206, 235, 0.3) !important;
    color: #0ea5e9 !important; /* Azul cyan moderno */
}

/* Para botones de píldoras (pills) - gelato pastel */
.ifp-pill.ifp-selected {
    background: rgba(240, 249, 255, 0.12) !important;
    border-color: rgba(173, 216, 230, 0.45) !important;
    color: #0369a1 !important;
    backdrop-filter: blur(4px);
}

/* Para botones de navegación lateral - gelato edge */
.ifp-icon-nav-btn.ifp-selected {
    background: rgba(224, 247, 255, 0.06) !important;
    border-left-color: rgba(173, 216, 230, 0.5) !important;
    color: rgba(2, 132, 199, 0.9) !important; /* Azul con 90% opacidad */
    border-left-width: 3px !important;
}

/* ================================================
   EFECTOS HOVER GELATO (opcional pero elegante)
   ================================================ */

.ifp-selected:hover {
    background: rgba(178, 235, 255, 0.12) !important;
    border-color: rgba(135, 206, 235, 0.6) !important;
}

.ifp-selected:hover::after {
    color: rgba(173, 216, 230, 1) !important; /* Full opacidad al hover */
    text-shadow: 
        0 0 2px rgba(255, 255, 255, 1),
        0 0 4px rgba(173, 216, 230, 0.4);
}

/* ================================================
   VARIANTES DE COLOR AZUL CIELO GELATO (paleta)
   ================================================ */

/*
   Paleta Gelato Azul Cielo (de más claro a más definido):
   
   1. #F0F9FF - Blanco azulado muy claro (fondo)
   2. #E0F7FF - Gelato claro
   3. #B3E0F2 - Azul cielo pastel
   4. #8FD3F4 - Azul cielo medio (check principal)
   5. #7EC8E6 - SkyBlue suave
   6. #6BBFE0 - Azul definido
   7. #4CAFDB - Azul cyan moderno
   8. #0284C7 - Para texto
*/
/* ==========================================================================
   ICONOS VISIBLES PARA BOTONES DE CAPAS (Mostrar/Ocultar & Eliminar)
   ========================================================================== */

/* Estilo base — que se vean correctamente */
.ifp-layer-control-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    width: 22px !important;
    height: 22px !important;
    color: var(--ifp-text) !important;
    background: var(--ifp-gray-light) !important;
    border: 1px solid var(--ifp-border) !important;
    border-radius: 4px !important;
}

/* =========================================================
   FIX ESTRUCTURAL: mismo sistema de coordenadas para guía y canvas
   - Sin offsets a ojo
   - Sin translate()
   - Sin flex
   ========================================================= */

/* 1) El contenedor que define el “cuadrado” 924×924 debe ser referencia */
.ifp-mockup-inner{
  position: relative !important;
  /* Si hubiera padding/border, rompería el origen (0,0) */
  padding: 0 !important;
  border: 0 !important;
}

/* 2) El overlay debe ocupar exactamente el área del mockup-inner
      y ser el offsetParent de guía y canvas */
.ifp-design-overlay{
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;

  width: 100% !important;
  height: 100% !important;

  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;

  /* Evita que transform cree un containing block raro */
  transform: none !important;
}

/* 3) El guide debe posicionarse respecto al overlay (misma referencia) */
#ifp-guide-area{
  position: absolute !important;
  /* left/top los seguirá mandando el JS inline; aquí NO los tocamos */
  margin: 0 !important;
  padding: 0 !important;

  /* Asegura que la guía se mide y pinta en el mismo plano */
  transform: none !important;
  box-sizing: border-box !important;
}

/* 5) Evitar que algún “centrado” automático de imágenes/elementos meta ruido */
.ifp-design-overlay,
#ifp-guide-area,
.ifp-design-overlay .canvas-container,
.ifp-design-overlay .upper-canvas,
.ifp-design-overlay .lower-canvas{
  max-width: none !important;
  max-height: none !important;
}

/* Mini comportamiento Printful — tabs */
.ifp-location-tabs {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.ifp-tabs-visible {
    opacity: 1;
    transform: translateY(0);
}


/* ======== MODO PANTALLA COMPLETA ======== */
.ifp-fullscreen-mode .ifp-panel-icons,
.ifp-fullscreen-mode .ifp-panel-right {
    display: none !important;
}

.ifp-fullscreen-mode .ifp-panel-canvas {
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 auto;
}

/* Botón activo */
#ifp-fullscreen.ifp-icon-button-active {
    background: rgba(255,255,255,0.8);
    color: #111;
}


/* ============================================
   Fix real de fullscreen (recoloca layout)
============================================ */

.ifp-fullscreen-mode .ifp-body {
    grid-template-columns: 1fr !important;
}

.ifp-fullscreen-mode .ifp-panel-options {
    display: none !important;
}

.ifp-fullscreen-mode .ifp-panel-canvas {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
}

/* Centrar el mockup con margen visual */
.ifp-fullscreen-mode .ifp-mockup-area {
    padding: 40px 0 !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Mostrar botón fullscreen y mantenerlo accesible */
.ifp-fullscreen-mode #ifp-fullscreen {
    position: fixed !important;
    right: 20px !important;
    top: 70px !important;
    z-index: 9999 !important;
}

/* ============================================================
   BOTÓN SALIR DE FULLSCREEN (versión final correcta)
============================================================ */

/* Ubicar botón salir fullscreen dentro del mockup */
.ifp-panel-canvas {
    position: relative; /* referencia del botón */
}

/* Botón salir fullscreen - OCULTO por defecto */
#ifp-exit-fullscreen {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5000;
    background: rgba(0,0,0,0.75);
    color: white;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: none !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    transition: background 0.2s ease;
}

/* Mostrar SOLO cuando está activo el fullscreen */
.ifp-fullscreen-mode #ifp-exit-fullscreen {
    display: flex !important;
}

/* Hover effect */
#ifp-exit-fullscreen:hover {
    background: rgba(0,0,0,1);
}

/* Icono dentro del botón exit fullscreen */
#ifp-exit-fullscreen i {
    font-size: 16px;
    display: inline-block;
    line-height: 1;
}

/* ==========================================================================
   ICONOS VISIBLES PARA BOTONES DE CAPAS (Mostrar/Ocultar & Eliminar)
   ========================================================================== */

/* Estilo base — que se vean correctamente */
.ifp-layer-control-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    width: 22px !important;
    height: 22px !important;
    color: var(--ifp-text) !important;
    background: var(--ifp-gray-light) !important;
    border: 1px solid var(--ifp-border) !important;
    border-radius: 4px !important;
}

/* Mostrar iconos mediante pseudo-elementos */
.ifp-layer-control-btn.toggle::before {
    content: "👁"; /* icono ojo visible */
    font-size: 15px;
    opacity: 0.85;
}

.ifp-layer-control-btn.delete::before {
    content: "✖"; /* icono eliminar */
    font-size: 14px;
    opacity: 0.85;
}

/* Hover — mantener neutral */
.ifp-layer-control-btn:hover {
    background: var(--ifp-gray-dark) !important;
    opacity: 1 !important;
}

/* Para objeto oculto, cambia icono */
.ifp-layer-item[data-hidden="true"] .ifp-layer-control-btn.toggle::before {
    content: "🚫";
}

.ifp-preview-strip {
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    border-right: 1px solid #e5e7eb;
    padding-right: 10px;
}

.ifp-preview-strip img {
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
}

.ifp-preview-strip img.active {
    border-color: var(--ifp-blue, #3498db);
}

.ifp-preview-large {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ifp-preview-large img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.ifp-preview-back-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* ==== Zona de maquetas visible ocupando área del canvas ==== */

.ifp-preview-room {
    display: none;              /* oculto por defecto */
    flex: 1;                    /* ocupa el hueco del canvas */
    min-height: 500px;          /* asegura altura visible */
    background: var(--ifp-white);
    padding: 30px;
    gap: 30px;
    align-items: flex-start;
    justify-content: flex-start;
}

/* Columna izquierda (miniaturas) */
.ifp-preview-strip {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Miniaturas */
.ifp-preview-thumb {
    width: 80px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
}

/* Miniatura activa */
.ifp-preview-thumb.active {
    border-color: var(--ifp-accent);
}

/* Vista grande de mockup (SIN límite fijo) */
.ifp-preview-large img {
    max-width: 100%;
    max-height: calc(100vh - 220px);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Botón volver */
.ifp-preview-back-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--ifp-dark);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
}

/* =====================================================================
   POPOVER COLOR TEXTO (acciones superiores)
===================================================================== */

.ifp-design-actions {
    position: relative; /* ancla el popover */
}

.ifp-text-color-popover {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 320px;
    background: #fff;
    border: 1px solid var(--ifp-border);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
    padding: 12px 12px 10px;
    z-index: 60;
    display: none;
}

.ifp-text-color-popover.is-open {
    display: block;
}

.ifp-text-color-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.ifp-text-color-row:last-child {
    border-bottom: none;
}

.ifp-text-color-label {
    font-size: 11.5px;
    opacity: .75;
}

.ifp-text-color-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

#ifp-text-color-input {
    width: 38px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--ifp-border);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

#ifp-text-color-hex {
    flex: 1;
    height: 32px;
    border: 1px solid var(--ifp-border);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 12px;
    background: #fff;
}

.ifp-text-color-alpha-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

#ifp-text-color-alpha {
    flex: 1;
}

#ifp-text-color-alpha-label {
    font-size: 11px;
    min-width: 42px;
    text-align: right;
    opacity: .75;
}

.ifp-text-color-swatches {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
}

.ifp-text-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform .08s ease, border-color .08s ease;
}

.ifp-text-color-swatch:hover {
    transform: translateY(-1px);
    border-color: rgba(0,0,0,0.16);
}

.ifp-text-color-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
}

/* Ajuste responsive suave */
@media (max-width: 768px) {
    .ifp-text-color-popover {
        width: 280px;
    }
    .ifp-text-color-swatches {
        grid-template-columns: repeat(8, 1fr);
    }
}

/* =====================================================================
   TEXTO — Panel Color dentro del Panel 2
   ===================================================================== */
.ifp-text-color-popover--panel {
    position: static !important;
    width: 100%;
    max-width: 100%;
    margin-top: 10px;

    box-shadow: none;
    border: 1px solid var(--ifp-border);
    border-radius: 10px;
    background: #fff;
}

/* =========================================================
   COLOR TEXTO dentro del Panel 2 (layout integrado)
   ========================================================= */

.ifp-text-color-popover--panel{
    position: static !important;
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    box-shadow: none;
}

.ifp-text-color-popover--panel .ifp-text-color-row{
    margin-bottom: 10px;
}

.ifp-text-color-popover--panel .ifp-text-color-inputs{
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.ifp-text-color-popover--panel #ifp-text-color-hex{
    width: 100%;
    min-width: 0;
}

.ifp-text-color-popover--panel .ifp-text-color-alpha-wrap{
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.ifp-text-color-popover--panel #ifp-text-color-alpha{
    flex: 1;
}

/* Swatches con rejilla estable y sin desbordes */
.ifp-text-color-popover--panel .ifp-text-color-swatches{
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
}

/* Botones de acción dentro del ancho del panel */
.ifp-text-color-popover--panel .ifp-text-color-actions{
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ifp-text-color-popover--panel .ifp-text-color-actions .ifp-btn,
.ifp-text-color-popover--panel .ifp-text-color-actions .ifp-btn-small{
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
}

/* Ajuste extra por si el panel es estrecho */
@media (max-width: 1280px){
    .ifp-text-color-popover--panel .ifp-text-color-swatches{
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* Ajuste micro: texto más compacto en Restablecer/Cerrar */
.ifp-text-color-popover--panel #ifp-text-color-reset,
.ifp-text-color-popover--panel #ifp-text-color-close{
    font-size: 11px;
    padding: 6px 10px;
    line-height: 1.1;
    letter-spacing: 0.2px;
}

/* ==========================================
   PANEL 2 — FUENTES (Printful-like)
========================================== */

.ifp-text-font-panel--panel{
    width: 100%;
}

.ifp-text-font-list-wrap{
    margin-top: 10px;
    border: 1px solid #e7e7e7;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.ifp-text-font-list{
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ifp-text-font-item{
    width: 100%;
    text-align: left;
    border: 1px solid #ededed;
    background: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    transition: border .15s ease, background .15s ease;
}

.ifp-text-font-item:hover{
    border-color: #dcdcdc;
    background: #fafafa;
}

.ifp-text-font-item.is-active{
    border-color: #cfcfcf;
    background: #f6f6f6;
}

.ifp-text-font-controls{
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.ifp-stepper{
    display: grid;
    grid-template-columns: 32px 70px 32px;
    gap: 6px;
    align-items: center;
}

.ifp-stepper-btn{
    height: 32px;
    border: 1px solid #e6e6e6;
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.ifp-stepper-input{
    height: 32px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 0 8px;
    font-size: 12px;
    width: 70px;
    max-width: 70px;
    text-align: center;
    box-sizing: border-box;
}

/* 🔥 Forzar ancho correcto del input numérico (tamaño de texto / espaciado) */
.ifp-font-size-value,
.ifp-letter-spacing-value,
.ifp-stepper-input,
.ifp-stepper input[type="number"] {
    width: 65px !important;
    min-width: 65px !important;
    max-width: 65px !important;

    padding: 4px !important;
    text-align: center !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
}

/* =============================== */
/* SLIDER TRANSFORMAR — PRINTFUL */
/* =============================== */

.ifp-slider {
    width: 100%;
    height: 4px;
    background: var(--ifp-gray);
    border-radius: 3px;
    appearance: none;
    cursor: pointer;
    margin-top: 6px;
}

.ifp-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    border: 1px solid #bfbfbf;
    cursor: pointer;
    transition: background .2s, border .2s;
}

.ifp-slider::-webkit-slider-thumb:hover {
    background: #f0f0f0;
    border-color: #9b9b9b;
}

.ifp-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    border: 1px solid #bfbfbf;
    cursor: pointer;
}

/* =============================== */
/* PANEL 2 — ARCO (curvatura texto) */
/* =============================== */

#ifp-arc-panel {
    display: none; /* ← OCULTO por defecto */
    margin-top: 12px;
    flex-direction: column;
    gap: 8px;
}

#ifp-arc-panel.ifp-arc-panel-active { /* ← CLASE para mostrar */
    display: flex;
}

#ifp-arc-value {
    font-size: 12px;
    margin-top: 6px;
    opacity: 0.7;
}

/* Estilo del slider para el arco (si usas uno) */
#ifp-arc-slider {
    width: 100%;
    margin-top: 8px;
}
/* ==========================================
   PANEL 2 — POSICIÓN (alinear estilo Printful)
========================================== */

#ifp-position-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.ifp-pos-row {
    display: flex;
    gap: 6px;
    width: 100%;
}

.ifp-pos-btn {
    flex: 1;
    padding: 10px 0;
    background: var(--ifp-gray-light);
    border: 1px solid var(--ifp-border);
    border-radius: var(--ifp-radius);
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    transition: background .15s, border-color .15s;
}

.ifp-pos-btn:hover {
    background: var(--ifp-gray);
    border-color: var(--ifp-border);
}

/* Iconos SVG dentro de los botones */
.ifp-pos-btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
    opacity: 0.85;
}

/* ============================================
   FIX ICONOS PANEL POSICIÓN — ALCANCE QUIRÚRGICO
   ============================================ */

#ifp-position-panel .ifp-position-btn svg {
    width: 18px;
    height: 18px;
    fill: #1f2937 !important;   /* Gris Printful */
    stroke: none !important;
    opacity: 1 !important;
    display: block !important;
}

#ifp-position-panel .ifp-position-btn {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ifp-position-panel .ifp-position-btn:hover {
    background: #f3f4f6;
}

/* ============================================
   POSICIÓN IMAGEN — 6 iconos en 2 filas (Printful-style)
   ============================================ */

#ifp-image-position-panel .ifp-position-row {
    display: flex;
    flex-wrap: wrap;          /* permite 2 filas */
    gap: 6px;
    width: 100%;
    margin-top: 8px;
}

#ifp-image-position-panel .ifp-position-btn {
    flex: 0 0 calc(33.333% - 4px);  /* 3 botones por fila */
    max-width: calc(33.333% - 4px);
    height: 32px;
    padding: 0;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-sizing: border-box;
}

#ifp-image-position-panel .ifp-position-btn:hover {
    background: #f3f4f6;
}

#ifp-image-position-panel .ifp-position-btn svg {
    width: 18px;
    height: 18px;
    fill: #1f2937 !important;
    opacity: 0.9;
    pointer-events: none;
}


/* =====================================================
   FIX PANEL ARCO — FORZAR VISIBILIDAD
   ===================================================== */

#ifp-arc-panel {
    display: none; /* oculto por defecto */
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-height: 120px;
}

#ifp-arc-panel.ifp-arc-panel-active {
    display: flex; /* visible cuando activo */
}

/* Asegurar que el label sea visible */
#ifp-arc-panel .ifp-label {
    display: block !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    color: #1f2937 !important;
}

/* Asegurar que el slider sea visible */
#ifp-arc-slider {
    width: 100% !important;
    display: block !important;
    margin-top: 8px !important;
}

/* Asegurar que el valor sea visible */
#ifp-arc-value {
    display: block !important;
    font-size: 12px !important;
    margin-top: 6px !important;
    opacity: 0.7 !important;
    text-align: center !important;
}

/* =====================================================================
   PANEL 2 — CONTORNO (STROKE) DE TEXTO  ✅ FIX
===================================================================== */

#ifp-outline-panel {
    display: none; /* ✅ sin !important */
    flex-direction: column !important;
    gap: 12px !important;
    margin-top: 14px !important;
    padding: 12px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
}

/* ✅ Visible si JS lo pone o si se activa la clase */
#ifp-outline-panel[style*="display: flex"],
#ifp-outline-panel.ifp-outline-panel-active{
    display: flex !important;
}

/* Fila de color */
.ifp-outline-color-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ifp-outline-color-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

#ifp-outline-color-input {
    width: 38px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--ifp-border);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

#ifp-outline-color-hex {
    flex: 1;
    height: 32px;
    border: 1px solid var(--ifp-border);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 12px;
    background: #fff;
}

/* Swatches de colores */
#ifp-outline-color-swatches {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    margin-top: 4px;
}

/* Reutilizar estilo de swatch existente */
#ifp-outline-color-swatches .ifp-text-color-swatch {
    width: 100%;
    aspect-ratio: 1;
    max-width: 28px;
}

/* Control de grosor (stepper) */
.ifp-outline-width-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ifp-outline-width-controls {
    display: grid;
    grid-template-columns: 32px 70px 32px;
    gap: 6px;
    align-items: center;
}

#ifp-outline-width-minus,
#ifp-outline-width-plus {
    height: 32px;
    border: 1px solid var(--ifp-border);
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ifp-outline-width-minus:hover,
#ifp-outline-width-plus:hover {
    background: var(--ifp-gray-light);
}

#ifp-outline-width-value {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    height: 32px;
    border: 1px solid var(--ifp-border);
    border-radius: 8px;
    padding: 0 8px;
    font-size: 12px;
    text-align: center;
    box-sizing: border-box;
}

/* Labels */
#ifp-outline-panel .ifp-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ifp-text);
    opacity: 0.75;
    margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 1280px) {
    #ifp-outline-color-swatches {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* =====================================================================
   PANEL 2 — SOMBREADO (SHADOW) DE TEXTO  ✅ FIX
===================================================================== */

#ifp-shadow-panel {
    display: none;                 /* ✅ sin !important */
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* ✅ Visible cuando JS lo pone en block o flex */
#ifp-shadow-panel[style*="display: block"],
#ifp-shadow-panel[style*="display:flex"],
#ifp-shadow-panel[style*="display: flex"] {
    display: flex;
}

/* Reutilizar estilos de inputs de color */
#ifp-shadow-color-input {
    width: 38px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--ifp-border);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

#ifp-shadow-color-hex {
    flex: 1;
    height: 32px;
    border: 1px solid var(--ifp-border);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 12px;
    background: #fff;
}

/* Swatches */
#ifp-shadow-color-swatches {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
}

#ifp-shadow-color-swatches .ifp-text-color-swatch {
    width: 100%;
    aspect-ratio: 1;
    max-width: 28px;
}

/* Labels de valores */
#ifp-shadow-distance-value,
#ifp-shadow-opacity-value {
    text-align: center;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1280px) {
    #ifp-shadow-color-swatches {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* =========================================================
   PANEL DE UBICACIONES (Printful-style, panel derecho)
   ========================================================= */

.ifp-locations-panel {
    margin-top: 12px;
    padding: 14px;
    background: #ffffff;
    border-radius: var(--ifp-radius);
    border: 1px solid var(--ifp-border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.ifp-locations-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: #111827;
    font-size: 13px;
    font-weight: 500;
    padding: 0;
    margin-bottom: 10px;
    cursor: pointer;
}

.ifp-locations-back-arrow {
    font-size: 14px;
}

.ifp-locations-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ifp-location-card {
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition:
        box-shadow 0.15s ease,
        transform 0.15s ease,
        border-color 0.15s ease;
}

.ifp-location-card:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
    border-color: #6366f1;
    transform: translateY(-1px);
}

.ifp-location-thumb {
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    margin-bottom: 8px;
}

.ifp-location-thumb img {
    width: 100%;
    display: block;
}

.ifp-location-label {
    font-size: 12px;
    font-weight: 500;
    color: #111827;
    text-align: center;
}

/* =========================================================
   OVERLAY DISEÑO EN UBICACIONES (Printful-style)
========================================================= */

.ifp-location-thumb {
    position: relative; /* CLAVE */
}

.ifp-location-canvas-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.ifp-transform-flip-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.ifp-slider-value {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

/* ===========================================================
   FIX FINAL — TRANSFORMAR IMAGEN (VOLTEAR + INPUTS)
   ESTILO PRINTFUL — BLOQUE QUIRÚRGICO
=========================================================== */

/* Ajuste de inputs numéricos (anchura/altura) */
#ifp-panel-2 .ifp-image-tool-block input[type="number"] {
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    padding: 6px 8px !important;
    font-size: 13px !important;
    text-align: center !important;
}

/* Fila de VOLTEAR */
#ifp-panel-2 .ifp-transform-flip-row {
    display: flex !important;
    gap: 8px !important;
    margin-top: 10px !important;
}

/* Botones VOLTEAR — tamaño y estilo Printful */
#ifp-panel-2 .ifp-btn-flip {
    flex: 1 !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 12px !important;
    background: #f6f6f6 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}

#ifp-panel-2 .ifp-btn-flip:hover {
    background: #eeeeee !important;
}

/* Botones de voltear imagen — estilo compacto, igual que botones de texto */
.ifp-image-flip-btn {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 6px;
    background: #f5f5f5;
    border: 1px solid var(--ifp-border);
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ifp-image-flip-btn:hover {
    background: #eee;
    border-color: #ccc;
}

/* Reducir tamaño del icono */
.ifp-image-flip-btn i {
    font-size: 14px;
}

/* =========================================================
   AJUSTES ESPECÍFICOS — PANEL 2 · TRANSFORMAR IMAGEN
   (Anchura/Altura a ancho completo + Voltear compacto)
========================================================= */

/* Que Anchura y Altura ocupen todo el ancho del panel */
#ifp-image-transform-panel input.ifp-input[type="number"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 6px 8px !important;
    font-size: 13px !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

/* Fila de botones VOLTEAR dentro del panel de transformar imagen */
#ifp-image-transform-panel .ifp-transform-flip-row {
    display: flex !important;
    gap: 8px !important;
    margin-top: 10px !important;
}

#ifp-image-transform-panel .ifp-transform-flip-row {
    display: flex !important;
    gap: 8px !important;
    margin-top: 10px !important;
    justify-content: flex-start !important;
}

/* Botones "Voltear horizontal / vertical" */
#ifp-image-transform-panel .ifp-btn-secondary {
    flex: 1 1 0 !important;        /* cada botón ocupa ~50% */
    max-width: 50% !important;
    min-height: 28px !important;
    padding: 4px 6px !important;    /* menos padding horizontal */
    font-size: 11px !important;     /* texto algo más pequeño */
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: normal !important; /* permite 2 líneas */
    background: var(--ifp-gray-light) !important;
    border: 1px solid var(--ifp-border) !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

/* =========================================================
   ICONOS ESTILO PRINTFUL — BOTONES "DISEÑO" (PATRÓN IMAGEN)
   ========================================================= */

/* Base de los botones de patrón */
.ifp-pattern-group .ifp-pattern-btn {
    width: 32px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    padding: 0;
    position: relative;
    font-size: 0;              /* Ocultamos cualquier texto o icono interno */
    --ifp-pattern-icon: #222;  /* Color base del dibujito del patrón */
}

/* Estado activo: igual estética que el resto del panel */
.ifp-pattern-group .ifp-pattern-btn.active {
    background: var(--ifp-accent, #0073aa);
    border-color: var(--ifp-accent, #0073aa);
    --ifp-pattern-icon: #ffffff;
}

/* Pseudoelementos que dibujan los iconos */
.ifp-pattern-group .ifp-pattern-btn::before,
.ifp-pattern-group .ifp-pattern-btn::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
}

/* -----------------------------------------
   1) Botón 1 — SIN PATRÓN (X grande)
   ----------------------------------------- */
.ifp-pattern-group .ifp-pattern-btn:nth-child(1)::before,
.ifp-pattern-group .ifp-pattern-btn:nth-child(1)::after {
    width: 16px;
    height: 2px;
    background: var(--ifp-pattern-icon);
    border-radius: 999px;
}

.ifp-pattern-group .ifp-pattern-btn:nth-child(1)::before {
    transform: rotate(45deg);
}

.ifp-pattern-group .ifp-pattern-btn:nth-child(1)::after {
    transform: rotate(-45deg);
}

/* -----------------------------------------
   2) Botón 2 — PATRÓN COMPLETO / MOSAICO
   (rejilla 3x3 estilo “todo lleno”)
   ----------------------------------------- */
.ifp-pattern-group .ifp-pattern-btn:nth-child(2)::before {
    width: 18px;
    height: 18px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    border: 1.5px solid var(--ifp-pattern-icon);
    background-image:
        linear-gradient(to right, var(--ifp-pattern-icon) 1.5px, transparent 1.5px),
        linear-gradient(to bottom, var(--ifp-pattern-icon) 1.5px, transparent 1.5px);
    background-size: 6px 100%, 100% 6px;
    background-position: 5px 0, 0 5px;
}

/* -----------------------------------------
   3) Botón 3 — COLUMNAS REPETIDAS
   ----------------------------------------- */
.ifp-pattern-group .ifp-pattern-btn:nth-child(3)::before {
    width: 18px;
    height: 18px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    border: 1.5px solid var(--ifp-pattern-icon);
    background-image: linear-gradient(
        to right,
        var(--ifp-pattern-icon) 2px,
        transparent 2px
    );
    background-size: 6px 100%;
}

/* -----------------------------------------
   4) Botón 4 — FILAS REPETIDAS
   ----------------------------------------- */
.ifp-pattern-group .ifp-pattern-btn:nth-child(4)::before {
    width: 18px;
    height: 18px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    border: 1.5px solid var(--ifp-pattern-icon);
    background-image: linear-gradient(
        to bottom,
        var(--ifp-pattern-icon) 2px,
        transparent 2px
    );
    background-size: 100% 6px;
}

/* -----------------------------------------
   5) Botón 5 — PATRÓN 2x2 (cuatro bloques)
   ----------------------------------------- */
.ifp-pattern-group .ifp-pattern-btn:nth-child(5)::before {
    width: 18px;
    height: 18px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    border: 1.5px solid var(--ifp-pattern-icon);
    background-image:
        linear-gradient(to right, var(--ifp-pattern-icon) 2px, transparent 2px),
        linear-gradient(to bottom, var(--ifp-pattern-icon) 2px, transparent 2px);
    background-size: 50% 100%, 100% 50%;
}

/* -----------------------------------------
   6) Botón 6 — BANDA HORIZONTAL CENTRAL
   ----------------------------------------- */
.ifp-pattern-group .ifp-pattern-btn:nth-child(6)::before {
    width: 18px;
    height: 18px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    border: 1.5px solid var(--ifp-pattern-icon);
    background:
        linear-gradient(
            to bottom,
            transparent 0,
            transparent 30%,
            var(--ifp-pattern-icon) 30%,
            var(--ifp-pattern-icon) 70%,
            transparent 70%,
            transparent 100%
        );
}

/* -----------------------------------------
   7) Botón 7 — BANDA VERTICAL CENTRAL
   ----------------------------------------- */
.ifp-pattern-group .ifp-pattern-btn:nth-child(7)::before {
    width: 18px;
    height: 18px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    border: 1.5px solid var(--ifp-pattern-icon);
    background:
        linear-gradient(
            to right,
            transparent 0,
            transparent 30%,
            var(--ifp-pattern-icon) 30%,
            var(--ifp-pattern-icon) 70%,
            transparent 70%,
            transparent 100%
        );
}

/* =====================================================
   SWATCHES DE COLOR — BORDE PARA QUE BLANCO SE VEA
   ===================================================== */
.ifp-color-swatch {
  border: 1px solid rgba(0,0,0,0.25);
  box-sizing: border-box;
}

.ifp-color-swatch:hover {
  border-color: rgba(0,0,0,0.55);
}

.ifp-color-swatch.ifp-color-swatch-active {
  border: 2px solid rgba(0,0,0,0.75);
}

.ifp-editor-printful .upper-canvas,
.ifp-editor-printful .canvas-container {
  touch-action: none !important;
}

.upper-canvas {
  pointer-events: auto !important;
  cursor: move !important;
}

/* ============================================================
   SISTEMA DE PERSISTENCIA DE SELECCIONES - AZUL CIELO VISIBLE
   ============================================================ */

/* Estado seleccionado principal */
.ifp-selected,
.ifp-pill-active,
.ifp-size-btn-active,
.ifp-location-tab-active,
.ifp-topbar-toggle-active,
.ifp-color-swatch-active {
    position: relative;
}

/* Indicador visual para selecciones persistentes */
.ifp-selected::after,
.ifp-pill-active::after,
.ifp-size-btn-active::after,
.ifp-location-tab-active::after,
.ifp-topbar-toggle-active::after {
    content: "✓";
    position: absolute;
    top: -6px;
    right: -6px;
    background: #4dabf7;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
}

/* Color swatches - indicador especial */
.ifp-color-swatch-active::after {
    content: "✓";
    position: absolute;
    top: -4px;
    right: -4px;
    background: #87CEEB;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
}

/* Colores específicos para cada tipo de selección */
.ifp-selected {
    background: rgba(77, 171, 247, 0.12) !important;
    border-color: #4dabf7 !important;
    color: #0369a1 !important;
    box-shadow: 0 0 0 2px rgba(77, 171, 247, 0.15) !important;
}

/* Botones de color (swatches) */
.ifp-color-swatch.ifp-color-swatch-active,
.ifp-color-swatch.ifp-selected {
    border-color: #4dabf7 !important;
    border-width: 3px !important;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.25) !important;
}

/* Tabs de ubicación */
.ifp-location-tab.ifp-location-tab-active,
.ifp-location-tab.ifp-selected {
    background: rgba(77, 171, 247, 0.12) !important;
    border-color: #4dabf7 !important;
    color: #0369a1 !important;
}

/* Botones de tamaño */
.ifp-size-btn.ifp-size-btn-active,
.ifp-size-btn.ifp-selected {
    background: rgba(77, 171, 247, 0.12) !important;
    border-color: #4dabf7 !important;
    color: #0369a1 !important;
}

/* Botones de la topbar */
.ifp-topbar-toggle.ifp-topbar-toggle-active,
.ifp-topbar-toggle.ifp-selected {
    background: rgba(77, 171, 247, 0.12) !important;
    border-color: #4dabf7 !important;
    color: #0369a1 !important;
}

/* Botones de píldoras (pills) */
.ifp-pill.ifp-pill-active,
.ifp-pill.ifp-selected {
    background: rgba(77, 171, 247, 0.12) !important;
    border-color: #4dabf7 !important;
    color: #0369a1 !important;
}

/* Botones de navegación lateral */
.ifp-icon-nav-btn.ifp-icon-nav-btn-active,
.ifp-icon-nav-btn.ifp-selected {
    background: rgba(77, 171, 247, 0.12) !important;
    border-left-color: #4dabf7 !important;
    color: #4dabf7 !important;
}

/* Para evitar duplicación de checkmarks */
.ifp-pill-active.ifp-selected::after,
.ifp-size-btn-active.ifp-selected::after,
.ifp-location-tab-active.ifp-selected::after,
.ifp-topbar-toggle-active.ifp-selected::after,
.ifp-icon-nav-btn-active.ifp-selected::after {
    display: none; /* Solo mostrar un checkmark */
}

/* ======================================================================
   FIX DEFINITIVO — SINCRONIZAR CANVAS Y ZONA DE IMPRESIÓN
   (NO TOCAR JS)
====================================================================== */

/* El contenedor del mockup define el sistema de coordenadas */
.ifp-mockup-inner {
    position: relative;
    display: inline-block; /* 🔴 CLAVE: ajusta al tamaño real de la imagen */
}

/* Imagen del mockup — solo visual */
.ifp-mockup-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    pointer-events: none;
}

/* Overlay = MISMO tamaño que la imagen */
.ifp-design-overlay {
    position: absolute;
    inset: 0;               /* top:0 right:0 bottom:0 left:0 */
    width: 100%;
    height: 100%;
    display: block;         /* 🔴 NUNCA flex */
    pointer-events: none;
    z-index: 50;
}

/* ✅ Fabric wrapper: el JS manda en tamaño y posición (NO bloquear left/top) */
.ifp-design-overlay .canvas-container{
  position: absolute !important;
  z-index: 60 !important;
  pointer-events: auto !important;
  touch-action: none;

  /* 🔴 CLAVE: NO fijar left/top/width/height aquí.
     Debe poder escribirlos el JS (inline) para alinearlo con la guía. */
  margin: 0 !important;
  transform: none !important;
}


/* El canvas real recibe eventos */
.ifp-design-overlay .canvas-container canvas,
.ifp-design-overlay .upper-canvas,
.ifp-design-overlay .lower-canvas {
    pointer-events: auto !important;
    touch-action: none;
}

/* Guía SIEMPRE en el mismo sistema de coordenadas */
#ifp-guide-area {
    position: absolute;
    z-index: 70;
    pointer-events: none;
}

#ifp-print-area-label {
    position: absolute;
    z-index: 75;
    pointer-events: none;
}

/* IFP: ocultar UI debug de fuentes al cliente */
.fuentes-contador,
#carga-fuentes-notif,
.notif-fuentes {
  display: none !important;
}

/* =========================================================
   RECOMMENDATIONS: thumb grande + textos debajo (FIX)
   ========================================================= */

.ifp-reco-list{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.ifp-reco-card{
  display: grid;
  grid-template-columns: 1fr;   /* thumb arriba, texto abajo */
  gap: 10px;
  align-items: start;
  cursor: pointer;
  user-select: none;
}

.ifp-reco-thumb{
  position: relative;
  width: 100%;
  max-width: 260px;            /* súbelo si quieres más grande */
  aspect-ratio: 1 / 1;         /* clave: evita recortes raros */
  margin: 0 auto;              /* centrado */
}

.ifp-reco-thumb .ifp-reco-base{
  width: 100%;
  height: 100%;
  object-fit: contain;         /* muestra la prenda completa */
  display: block;
}

.ifp-reco-thumb .ifp-reco-design{
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  display: none;               /* la encendemos por JS cuando haya preview */
}

.ifp-reco-meta{
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  text-align: center;
}

.ifp-reco-title{
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
}

.ifp-reco-cta{
  font-size: 12px;
  opacity: .9;
  text-decoration: underline;
}

/* 🔒 FIX FINAL: forzar visibilidad de talla seleccionada */
.ifp-size-btn.ifp-size-btn-active,
.ifp-size-btn.ifp-selected {
    background: rgba(0, 163, 255, 0.18) !important;
    border: 2px solid rgba(0, 163, 255, 0.9) !important;
    color: #002b45 !important;
    box-shadow: 0 0 0 2px rgba(0, 163, 255, 0.35) !important;
    font-weight: 700 !important;
}

/* =========================
   IFP: Botones (brand blue)
   ========================= */
:root{
  --ifp-primary: #1D4ED8;
  --ifp-primary-hover: #1E40AF;
  --ifp-primary-ring: rgba(29, 78, 216, .22);
}

.ifp-btn-primary,
button.ifp-btn-primary,
a.ifp-btn-primary{
  background: var(--ifp-primary) !important;
  border-color: var(--ifp-primary) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.ifp-btn-primary:hover,
button.ifp-btn-primary:hover,
a.ifp-btn-primary:hover{
  background: var(--ifp-primary-hover) !important;
  border-color: var(--ifp-primary-hover) !important;
}

.ifp-btn-primary:focus,
.ifp-btn-primary:focus-visible{
  outline: none !important;
  box-shadow: 0 0 0 4px var(--ifp-primary-ring) !important;
}

/* 3b. Asegurar PRIMARY en botones clave por ID (subidas / cargar diseño) */
#ifp-upload-trigger,
#ifp-load-design,
#ifp-load-design-btn {
    background: var(--ifp-accent) !important;
    border-color: var(--ifp-accent) !important;
    color: var(--ifp-white) !important;
}

/* =========================================================
   IFP — FORCE PRIMARY BUTTON COLOR (override tema/woo)
   ========================================================= */
#ifp-add-to-cart.ifp-btn-primary{
  background: #111827 !important;  /* cambia aquí el color */
  border-color: #111827 !important;
  color: #ffffff !important;
}

#ifp-add-to-cart.ifp-btn-primary:hover{
  background: #0b1220 !important;  /* hover */
  border-color: #0b1220 !important;
}

#ifp-add-to-cart.ifp-btn-primary:active{
  transform: translateY(1px);
}

/* =========================================================
   IFP — CTA PRIMARY NEGRO + ICONOS/TEXTO BLANCO (override final)
   ========================================================= */

/* Botón primary del editor: fondo negro + texto blanco */
.ifp-editor-printful .ifp-btn-primary,
.ifp-editor-printful .ifp-btn-primary:hover,
.ifp-editor-printful .ifp-btn-primary:focus,
.ifp-editor-printful .ifp-btn-primary:active{
  background: #111 !important;
  border-color: #111 !important;
  color: #fff !important;
}

/* CRÍTICO: cualquier hijo (iconos, svg, spans) también blanco,
   para derrotar el bloque que fuerza var(--ifp-text) */
.ifp-editor-printful .ifp-btn-primary *,
.ifp-editor-printful .ifp-btn-primary i,
.ifp-editor-printful .ifp-btn-primary svg{
  color: #fff !important;
  fill: #fff !important;
}

/* =========================================================
   IFP — CTAs SUBIDAS: ids SIEMPRE negros (sin depender de clase)
   ========================================================= */

.ifp-editor-printful #ifp-upload-trigger,
.ifp-editor-printful #ifp-load-design-btn{
  background: #111 !important;
  border-color: #111 !important;
  color: #fff !important;
}

.ifp-editor-printful #ifp-upload-trigger *,
.ifp-editor-printful #ifp-load-design-btn *{
  color: #fff !important;
  fill: #fff !important;
}

/* =========================================================
   IFP RECOMMENDATIONS (También queda bien en)
   - Horizontal cards
   - Small black Edit button
   ========================================================= */

#ifp-reco-wrap,
.ifp-reco-wrap {
  width: 100%;
}

/* Grid horizontal (wrap en desktop, scroll en móvil) */
#ifp-reco-wrap .ifp-reco-grid,
.ifp-reco-wrap .ifp-reco-grid,
#ifp-reco-wrap .ifp-reco-list,
.ifp-reco-wrap .ifp-reco-list {
  display: flex !important;
  flex-direction: row !important;
  gap: 14px !important;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;             /* desktop: varias columnas */
}

/* Cards: ancho consistente */
#ifp-reco-wrap .ifp-reco-card,
.ifp-reco-wrap .ifp-reco-card {
  width: 260px;
  max-width: 260px;
  flex: 0 0 260px;
}

/* Si tu card usa grid interno, mantenlo compacto */
#ifp-reco-wrap .ifp-reco-card,
.ifp-reco-wrap .ifp-reco-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Thumb (mockup) bien centrado */
#ifp-reco-wrap .ifp-reco-thumb,
.ifp-reco-wrap .ifp-reco-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
}

/* Imagen mockup dentro */
#ifp-reco-wrap .ifp-reco-thumb img,
.ifp-reco-wrap .ifp-reco-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Acciones: no botón ancho, centrado */
#ifp-reco-wrap .ifp-reco-actions,
.ifp-reco-wrap .ifp-reco-actions {
  display: flex;
  justify-content: center;
}

/* Botón Editar (pequeño, negro, texto blanco) */
#ifp-reco-wrap .ifp-reco-actions .ifp-btn,
#ifp-reco-wrap .ifp-reco-actions .ifp-btn-primary,
#ifp-reco-wrap .ifp-reco-actions button,
.ifp-reco-wrap .ifp-reco-actions .ifp-btn,
.ifp-reco-wrap .ifp-reco-actions .ifp-btn-primary,
.ifp-reco-wrap .ifp-reco-actions button {
  width: auto !important;
  min-width: 0 !important;
  padding: 8px 12px !important;
  border-radius: 10px !important;
  background: #111 !important;
  color: #fff !important;
  border: 1px solid #111 !important;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
}

/* Hover */
#ifp-reco-wrap .ifp-reco-actions .ifp-btn:hover,
#ifp-reco-wrap .ifp-reco-actions .ifp-btn-primary:hover,
#ifp-reco-wrap .ifp-reco-actions button:hover,
.ifp-reco-wrap .ifp-reco-actions .ifp-btn:hover,
.ifp-reco-wrap .ifp-reco-actions .ifp-btn-primary:hover,
.ifp-reco-wrap .ifp-reco-actions button:hover {
  background: #000 !important;
  border-color: #000 !important;
}

/* Mobile: en vez de wrap, carrusel horizontal con scroll */
@media (max-width: 900px) {
  #ifp-reco-wrap .ifp-reco-grid,
  .ifp-reco-wrap .ifp-reco-grid,
  #ifp-reco-wrap .ifp-reco-list,
  .ifp-reco-wrap .ifp-reco-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }

  #ifp-reco-wrap .ifp-reco-card,
  .ifp-reco-wrap .ifp-reco-card {
    scroll-snap-align: start;
  }
}

/* =========================================================
   IFP RECO – RESET CONTUNDENTE (evita Astra/Woo)
   ========================================================= */

#ifp-reco-wrap .ifp-reco-card button,
#ifp-reco-wrap .ifp-reco-card a {
  all: unset;                 /* <- borra TODO el estilo heredado */
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  border: 1px solid #111;
  font: 600 13px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  text-decoration: none;
  width: fit-content;
  max-width: fit-content;
}

#ifp-reco-wrap .ifp-reco-card button:hover,
#ifp-reco-wrap .ifp-reco-card a:hover,
#ifp-reco-wrap .ifp-reco-card button:focus,
#ifp-reco-wrap .ifp-reco-card a:focus,
#ifp-reco-wrap .ifp-reco-card button:active,
#ifp-reco-wrap .ifp-reco-card a:active {
  background: #000;
  border-color: #000;
  color: #fff;
  outline: none;
}

/* =========================================================
   IFP RECO — FIX DEFINITIVO CTA (centrado + sin azul + sin hitbox raro)
   Aplica a: página de ubicaciones + sidebar del editor
   ========================================================= */

/* La grid puede ser flex (ya la tienes), pero evita overflow en sidebar */
#ifp-reco-wrap .ifp-reco-grid,
.ifp-reco-wrap .ifp-reco-grid{
  overflow-x: hidden !important;      /* corta scroll lateral inesperado */
}

/* Cards: permitir encoger en sidebar (evita width fijo que desborda) */
#ifp-reco-wrap .ifp-reco-card,
.ifp-reco-wrap .ifp-reco-card{
  width: auto !important;
  max-width: 260px !important;
  flex: 1 1 220px !important;        /* se adapta al contenedor */
  min-width: 0 !important;           /* CLAVE anti overflow */
  box-sizing: border-box !important;
}

/* Meta: centrar CTA debajo del mockup */
#ifp-reco-wrap .ifp-reco-meta,
.ifp-reco-wrap .ifp-reco-meta{
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
}

/* CTA real (es DIV): hacerlo “botón” pequeño, centrado y con tipografía más fina */
#ifp-reco-wrap .ifp-reco-cta,
.ifp-reco-wrap .ifp-reco-cta{
  display: inline-flex !important;
  width: auto !important;
  max-width: fit-content !important;
  padding: 8px 12px !important;
  border-radius: 10px !important;
  background: #111 !important;
  color: #fff !important;
  border: 1px solid #111 !important;

  font-weight: 300 !important;       /* más fino (antes 600/700) */
  font-size: 12px !important;
  line-height: 1 !important;

  white-space: nowrap !important;
  box-sizing: border-box !important;
  text-decoration: none !important;
  border-bottom: 0 !important;

}

/* Mata el hover AZUL que tienes definido como .ifp-reco-card:hover .ifp-reco-cta */
#ifp-reco-wrap .ifp-reco-card:hover .ifp-reco-cta,
.ifp-reco-wrap .ifp-reco-card:hover .ifp-reco-cta{
  background: #111 !important;
  border-color: #111 !important;
  color: #fff !important;
}

/* Hover propio (negro más profundo) */
#ifp-reco-wrap .ifp-reco-cta:hover,
.ifp-reco-wrap .ifp-reco-cta:hover{
  background: #000 !important;
  border-color: #000 !important;
  color: #fff !important;
}

/* =========================================================
   RECO CTA — “Editar” ultra fino (override final)
   ========================================================= */
.ifp-editor-printful .ifp-reco-cta,
.ifp-editor-printful .ifp-reco-cta * {
  font-weight: 100 !important;     /* prueba 200; si tu Inter lo soporta, 100 */
  letter-spacing: 0.2px !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

/* Si “Editar” viene como <a class="button"> o similar, lo neutralizamos */
.ifp-editor-printful a.ifp-reco-cta,
.ifp-editor-printful a.ifp-reco-cta:visited,
.ifp-editor-printful a.ifp-reco-cta:hover,
.ifp-editor-printful a.ifp-reco-cta:focus {
  font-weight: 200 !important;
}

/* =====================================================================
   MÓDULO: TAMBIÉN QUEDA BIEN EN. (Recomendaciones Premium) — CLEAN
   ===================================================================== */
.ifp-reco-wrap{
  margin-top: 30px !important;
  padding: 20px !important;
  border-top: 1px solid #eee !important;
}

.ifp-reco-label{ display:none; }

#ifp-reco-wrap .ifp-reco-grid,
.ifp-reco-wrap .ifp-reco-grid{
  overflow-x: hidden !important;
}

#ifp-reco-wrap .ifp-reco-card,
.ifp-reco-wrap .ifp-reco-card{
  width: auto !important;
  max-width: 260px !important;
  flex: 1 1 220px !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

#ifp-reco-wrap .ifp-reco-meta,
.ifp-reco-wrap .ifp-reco-meta{
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

/* CTA: “Editar” fino de verdad (sin depender de pesos que no existan) */
#ifp-reco-wrap .ifp-reco-cta,
.ifp-reco-wrap .ifp-reco-cta{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 8px 12px !important;
  border-radius: 10px !important;
  border: 1px solid #111 !important;
  background: #111 !important;
  color: #fff !important;

  /* CLAVE: apariencia “más fina” incluso si la fuente no soporta 200 */
  font-size: 10px !important;
  font-weight: 100 !important;
  letter-spacing: .6px !important;
  text-transform: uppercase !important;
  opacity: .92 !important;

  width: fit-content !important;
  max-width: fit-content !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

#ifp-reco-wrap .ifp-reco-cta:hover,
.ifp-reco-wrap .ifp-reco-cta:focus,
.ifp-reco-wrap .ifp-reco-cta:active{
  background: #000 !important;
  border-color: #000 !important;
  color: #fff !important;
  outline: none !important;
  box-shadow: none !important;
}

/* =========================================================
   TOPBAR — Botón salir (X) junto a "Maquetas"
   ========================================================= */

.ifp-topbar-right{
  display: flex;
  align-items: center;
  gap: 10px;
}

#ifp-exit-editor.ifp-topbar-exit{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 28px;
  height: 28px;

  text-decoration: none !important;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;

  background: transparent !important;
  color: rgba(0,0,0,0.55);

  font-size: 18px;
  line-height: 1;
  font-weight: 300;

  cursor: pointer;
  user-select: none;
}

#ifp-exit-editor.ifp-topbar-exit:hover,
#ifp-exit-editor.ifp-topbar-exit:focus,
#ifp-exit-editor.ifp-topbar-exit:active{
  background: transparent !important;   /* ✅ sin fondo negro */
  color: rgba(0,0,0,0.85);
  border-color: rgba(0,0,0,0.18);
  box-shadow: none !important;
  outline: none !important;
}

/* ==========================================================================
   REVIEW MODAL (PRE-ADD-TO-CART)
   ========================================================================== */

#ifp-review-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#ifp-review-modal.ifp-modal-open {
    opacity: 1;
    visibility: visible;
}

.ifp-review-container {
    background: #fff;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#ifp-review-modal.ifp-modal-open .ifp-review-container {
    transform: translateY(0) scale(1);
}

/* Header */
.ifp-review-header {
    padding: 20px 30px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
}

.ifp-review-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ifp-review-close {
    background: #eee;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: all 0.2s;
}

.ifp-review-close:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

/* Body */
.ifp-review-body {
    padding: 30px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .ifp-review-body {
        grid-template-columns: 1fr;
    }
}

/* Left side (Previews) */
.ifp-review-left {
    display: flex;
    flex-direction: column;
}

.ifp-review-main-preview {
    border: 2px solid #f0f0f0;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

#ifp-review-mockup-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Right side (Details) */
.ifp-review-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ifp-review-product-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#ifp-review-product-name {
    font-size: 22px;
    font-weight: 800;
    color: #000;
    line-height: 1.2;
}

.ifp-review-meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    background: #f8fbff;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #eef2f8;
}

.ifp-review-meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ifp-review-meta-label {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
}

.ifp-review-meta-value {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* Color swatch specific */
.ifp-review-meta-value-with-swatch {
    display: flex;
    align-items: center;
    gap: 10px;
}

#ifp-review-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ddd;
}

.ifp-review-price-wrap {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#ifp-review-price {
    font-size: 24px;
    font-weight: 800;
    color: #000;
}

/* Footer */
.ifp-review-footer {
    padding: 24px 30px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 15px;
    background: #fff;
}

.ifp-review-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#ifp-review-edit {
    background: #f0f0f0;
    color: #555;
}

#ifp-review-edit:hover {
    background: #e5e5e5;
    color: #222;
}

#ifp-review-confirm {
    background: #000;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#ifp-review-confirm:hover {
    background: #222;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Info Box */
.ifp-review-info-box {
    margin-top:auto; 
    background: #f9f9f9; 
    padding: 15px; 
    border-radius: 12px; 
    border: 1px solid #eee; 
    font-size: 13px; 
    color: #666; 
    display: flex; 
    gap: 10px;
    line-height: 1.4;
}

.ifp-review-info-box i {
    color: #888;
    font-size: 14px;
    margin-top: 2px;
}

/* Lock scroll on html/body */
.ifp-modal-lock {
    overflow: hidden !important;
    height: 100% !important;
}

