/* ============================================================
 * Tibor3 — Configurador de camisetas
 * Layout 3 columnas estilo Spreadshirt: tools · stage · producto
 * ============================================================ */

.tibor3-cfg {
    display: grid;
    /* 3 columnas abiertas estilo Spreadshirt: herramientas · visor · panel producto */
    grid-template-columns: 96px 1fr 400px;
    gap: 8px;
    background: #ffffff;       /* los huecos entre columnas se ven blancos */
    padding: 0;
    min-height: 0;
    height: min(calc(100vh - 120px), 760px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a2e;
    box-sizing: border-box;
    /* Full-width: el wrapper del tema se neutraliza con :has() (abajo), así que el
       configurador ocupa todo el ancho sin el truco translateX. */
    width: 100%;
    position: relative;
}
.tibor3-cfg *, .tibor3-cfg *::before, .tibor3-cfg *::after { box-sizing: border-box; }

/* ---------- Full-bleed (escritorio + móvil): quitar título de página y caja del
   tema SOLO en la página del configurador → interfaz abierta y limpia ----------- */
.container:has(.tibor3-cfg) {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}
.container:has(.tibor3-cfg) > div {       /* tarjeta blanca contenedora del tema */
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
}
.container:has(.tibor3-cfg) > div > h1 {  /* título de la página */
    display: none !important;
}
.container:has(.tibor3-cfg) .entry-content { margin: 0 !important; }

/* Página del configurador: ocultar el SEGUNDO carrito del navbar (redundante con el
   del header principal). Aplica en escritorio y móvil. */
body:has(.tibor3-cfg) .tibor-nav-right a.js-tibor-cart-toggle { display: none !important; }

/* ---------- Columna izquierda: herramientas (panel gris plano) ---------- */
.tibor3-tools {
    background: #f4f4f4;
    border-radius: 0;
    padding: 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
    box-shadow: none;
}
.tibor3-tool {
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 12px 4px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #1a1a2e;
    transition: background .15s ease;
}
.tibor3-tool:hover { background: #ffffff; }
.tibor3-tool.is-active { background: #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.tibor3-tool-ico {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
    color: #1a1a2e;
}
.tibor3-tool-lbl { font-size: 11px; font-weight: 500; }

/* ---------- Columna central: visor (abierto, sin tarjeta) ---------- */
.tibor3-stage-wrap {
    background: #ffffff;
    border-radius: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 0;
    height: 100%;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}
.tibor3-stage {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    overflow: hidden;
}
.tibor3-stage canvas { max-width: 100%; height: auto; display: block; }

.tibor3-views {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.tibor3-view-thumb {
    width: 72px; height: 72px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s ease;
    overflow: hidden;
    flex-shrink: 0;
}
.tibor3-view-thumb img {
    width: 100%; height: 100%;
    object-fit: contain;
    pointer-events: none;
}
.tibor3-view-thumb:hover { border-color: #d1d5db; }
.tibor3-view-thumb.is-active { border-color: #1a1a2e; }

.tibor3-view-label {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

/* ---------- Columna derecha: producto ---------- */
.tibor3-product {
    background: #f4f4f4;
    border-radius: 0;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: none;
    overflow-y: auto;
    height: 100%;
}
.tibor3-product-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}
.tibor3-product-details {
    font-size: 11px;
    color: #1a1a2e;
    text-decoration: underline;
    margin-top: -8px;
}

/* --- Paso 1b: cabecera con compartir, colapsables, dropdown tallas, pago y servicios --- */
.tibor3-product-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.tibor3-share-btn {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d6d6de;
    background: #ffffff;
    color: #1a1a2e;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.tibor3-share-btn:hover { background: #1a1a2e; color: #ffffff; border-color: #1a1a2e; transform: translateY(-1px); }
.tibor3-share-btn:active { transform: translateY(0); }

/* colapsables (Personalización) y dropdown (tallas) comparten reset de marcador */
.tibor3-collapse summary,
.tibor3-sizes-dd summary { list-style: none; cursor: pointer; }
.tibor3-collapse summary::-webkit-details-marker,
.tibor3-sizes-dd summary::-webkit-details-marker { display: none; }
.tibor3-caret { transition: transform .15s ease; color: #88889c; font-size: 11px; }
details[open] > summary .tibor3-caret { transform: rotate(180deg); }

.tibor3-collapse { display: flex; flex-direction: column; gap: 6px; }
.tibor3-collapse-sum {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 4px 0;
}
.tibor3-collapse-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 6px;
}

/* dropdown de tallas: el summary parece un selector */
.tibor3-sizes-dd-sum {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid #d6d6de;
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
}
.tibor3-sizes-dd-sum:hover { border-color: #1a1a2e; }
.tibor3-sizes-dd[open] .tibor3-sizes-dd-sum { border-color: #1a1a2e; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.tibor3-sizes-dd[open] .tibor3-sizes {
    border: 1px solid #1a1a2e;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    padding: 12px;
    margin-top: 0;
}

.tibor3-price-details {
    font-size: 11px;
    color: #6b7280;
    text-decoration: underline;
    margin-top: 6px;
    display: inline-block;
}

/* badges de pago (texto, sin imágenes → sin 404) */
.tibor3-pay {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: -4px;
}
.tibor3-pay-ico {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #6b7280;
    background: #ffffff;
    border: 1px solid #e0e0e6;
    border-radius: 4px;
    padding: 3px 7px;
}

/* bloque servicios (envío + devoluciones) */
.tibor3-service {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}
.tibor3-service-row { display: flex; align-items: flex-start; gap: 10px; }
.tibor3-service-ico { font-size: 16px; line-height: 1.2; flex: 0 0 auto; }
.tibor3-service-txt { display: flex; flex-direction: column; gap: 1px; }
.tibor3-service-txt strong { font-size: 12px; color: #1a1a2e; }
.tibor3-service-txt span { font-size: 11px; color: #88889c; line-height: 1.45; }

/* Hoja "Más acciones" (móvil): envío/devoluciones + compartir */
.tibor3-m-more { display: flex; flex-direction: column; gap: 14px; }
.tibor3-more-share {
    margin-top: 4px;
    padding: 12px;
    border: 1px solid #d6d6de;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.tibor3-more-share:active { background: #f5f5f7; }
.tibor3-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tibor3-section-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.tibor3-section-label strong { color: #1a1a2e; font-weight: 600; }

/* swatches color */
.tibor3-colors {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}
.tibor3-swatch {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 1.5px solid #e5e7eb;
    cursor: pointer;
    padding: 0;
    background-clip: content-box;
    transition: transform .12s ease, border-color .12s ease;
    position: relative;
}
.tibor3-swatch:hover { transform: scale(1.08); }
.tibor3-swatch.is-active {
    border-color: #1a1a2e;
    border-width: 2px;
}
.tibor3-swatch.is-active::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid #1a1a2e;
}

/* nota: el precio sale de las caras editadas (sin selector de zona manual) */
.tibor3-zone-hint {
    margin: 0;
    padding: 9px 11px;
    font-size: 12.5px;
    line-height: 1.45;
    color: #4b5563;
    background: #f3f6fb;
    border: 1px solid #e3e9f2;
    border-radius: 8px;
}

/* zonas (radio buttons como tarjetitas) */
.tibor3-zones { display: flex; flex-direction: column; gap: 6px; }
.tibor3-zone, .tibor3-sleeve {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1.5px solid #e5e7eb;
    cursor: pointer;
    font-size: 12px;
    transition: border-color .15s ease, background .15s ease;
    user-select: none;
}
.tibor3-zone:hover, .tibor3-sleeve:hover {
    border-color: #c9cdda;
    background: #fafbfc;
}
.tibor3-zone.is-selected,
.tibor3-sleeve.is-selected {
    border-color: #1a1a2e;
    background: #f5f5f7;
    font-weight: 600;
}
.tibor3-zone input, .tibor3-sleeve input {
    accent-color: #0b3989;
    margin: 0;
}
.tibor3-sleeves {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.tibor3-sleeves .tibor3-sleeve {
    justify-content: center;
    text-align: center;
}
/* Modificador: ancho completo (1 columna) cuando solo hay un elemento (ej. cuello) */
.tibor3-sleeves--single {
    grid-template-columns: 1fr;
}
.tibor3-sleeves--single .tibor3-sleeve {
    justify-content: flex-start;
    text-align: left;
}

/* tallas */
.tibor3-sizes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}
.tibor3-size {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 5px 7px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size: 11px;
    user-select: none;
    transition: border-color .15s ease, background .15s ease;
    background: #ffffff;
}
.tibor3-size-ctrls {
    display: flex;
    align-items: center;
    gap: 2px;
}
.tibor3-size-btn {
    width: 20px; height: 20px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1;
    color: #1a1a2e;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .12s ease, border-color .12s ease;
}
.tibor3-size-btn:hover:not(:disabled) { background: #f5f5f7; border-color: #c9cdda; }
.tibor3-size-btn:active:not(:disabled) { background: #e5e7eb; }
.tibor3-size-btn:disabled { color: #d1d5db; cursor: not-allowed; }
.tibor3-size-plus { background: #1a1a2e; color: #ffffff; border-color: #1a1a2e; }
.tibor3-size-plus:hover:not(:disabled) { background: #2a2a4e; border-color: #2a2a4e; }
.tibor3-size:hover { border-color: #c9cdda; }
.tibor3-size.has-qty { border-color: #1a1a2e; background: #fafbfc; }
.tibor3-size-lbl { font-weight: 600; }
.tibor3-size-qty {
    color: #1a1a2e;
    font-weight: 700;
    min-width: 16px;
    text-align: right;
}
.tibor3-size-qty.is-zero { color: #c9cdda; font-weight: 400; }

/* precio */
.tibor3-price-section {
    padding-top: 6px;
    border-top: 1px solid #e5e7eb;
}
.tibor3-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.tibor3-price-label { font-size: 13px; color: #6b7280; }
.tibor3-price {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.tibor3-price-old {
    font-size: 14px;
    font-weight: 500;
    color: #88889c;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: #c8102e;
}
.tibor3-price-now { color: #1a1a2e; }
.tibor3-price-unit {
    font-size: 13px;
    font-weight: 500;
    color: #88889c;
}
.tibor3-price-hint {
    font-size: 11px;
    color: #88889c;
    margin-top: 6px;
    line-height: 1.6;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.tibor3-price-current {
    font-weight: 700;
    color: #1a1a2e;
    font-size: 12px;
}
.tibor3-price-save {
    display: inline-flex;
    align-items: center;
    background: #16a34a;
    color: #ffffff;
    padding: 3px 9px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 3px rgba(22,163,74,.25);
}
.tibor3-price-next {
    display: inline-flex;
    align-items: center;
    background: #fff3eb;
    color: #b53f0a;
    border: 1px solid #fbcdb1;
    padding: 3px 9px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.02em;
}

/* botón añadir */
.tibor3-cart-btn {
    background: #1a1a2e;
    color: #ffffff;
    border: 0;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease, transform .12s ease;
}
.tibor3-cart-btn:hover:not(:disabled) { background: #2a2a4e; }
.tibor3-cart-btn:active:not(:disabled) { transform: translateY(1px); }
.tibor3-cart-btn:disabled {
    background: #c9cdda;
    cursor: not-allowed;
    color: #ffffff;
}

/* ===================================================================
 * MOBILE UI — visible solo cuando data-mode="mobile" (lo setea el JS)
 * Por defecto en escritorio quedan ocultos todos los elementos .tibor3-m-*
 * ================================================================== */
.tibor3-m-breadcrumb,
.tibor3-m-topbar,
.tibor3-m-views,
.tibor3-m-tabbar,
.tibor3-m-done,
.tibor3-m-design-toolbar,
.tibor3-m-backdrop,
.tibor3-m-sheet { display: none; }

/* ---------- Responsive escritorio compactado ---------- */
@media (max-width: 1100px) {
    .tibor3-cfg {
        grid-template-columns: 90px 1fr 320px;
    }
    .tibor3-tool-lbl { font-size: 10px; }
}

/* ===================================================================
 * MOBILE: layout vertical full-screen estilo Spreadshirt
 * ================================================================== */
@media (max-width: 760px) {
    /* App estática a pantalla completa: el configurador ocupa todo el viewport,
       sin scroll. Columna flex: barra superior · visor (crece) · carrusel ·
       (tab bar fija abajo). Cubre la cabecera del tema con z-index alto. */
    .tibor3-cfg {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        min-height: 0;
        /* Pantalla completa; dvh maneja la barra del navegador móvil */
        position: fixed;
        /* Anclado DEBAJO de la cabecera del tema (menú principal fijo y visible).
           --t3-header-h lo mide el JS (alto real de topbar+header+navbar). Si el JS
           no corre, cae a 0px → comportamiento anterior (pantalla completa). */
        top: var(--t3-header-h, 0px);
        right: 0;
        bottom: 0;
        left: auto;
        height: 100vh;
        height: calc(100dvh - var(--t3-header-h, 0px));
        transform: none;
        width: 100%;
        overflow: hidden;
        z-index: 9000;
        /* Reservar espacio para la tab bar fija inferior + etiqueta del carrusel */
        padding: 0 0 calc(90px + env(safe-area-inset-bottom)) 0;
    }

    /* ---- Full-bleed: anular título de página + wrappers del tema ----
       SOLO en la página del configurador (scope con :has para no afectar
       otras páginas). El tema envuelve el shortcode en:
         .container (padding 40px)
           └ div tarjeta blanca (max-width:900px, fondo, borde, padding 40px)
               ├ h1 título de la página
               └ .entry-content → .tibor3-cfg                              */
    .container:has(.tibor3-cfg) {
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .container:has(.tibor3-cfg) > div {        /* tarjeta blanca contenedora */
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
    }
    .container:has(.tibor3-cfg) > div > h1 {   /* título "configurador-camiseta" */
        display: none !important;
    }
    .container:has(.tibor3-cfg) .entry-content {
        margin: 0 !important;
    }

    /* ---- Móvil: dejar visible la cabecera SOLO hasta la franja naranja ----
       Ocultar la calculadora "Cotizador" del navbar, el footer completo, y matar el
       scroll trasero (body sin overflow) que se movía detrás del visor. */
    body:has(.tibor3-cfg) .tibor-nav-right a:has(.fa-calculator) { display: none !important; }
    body:has(.tibor3-cfg) .tibor-footer-usp,
    body:has(.tibor3-cfg) .tibor-footer-main { display: none !important; }
    body:has(.tibor3-cfg) { overflow: hidden !important; }
    /* Botón naranja flotante del tema (menú móvil): sobra aquí y se solapaba con la
       barra inferior. La navegación ya está en la cabecera visible. */
    body:has(.tibor3-cfg) .mobile-menu-toggle { display: none !important; }
    /* Chip "EDITANDO · X": en móvil el carrusel ya indica la vista → más limpio sin él */
    .tibor3-current-view-chip { display: none; }

    /* ---- Ocultar UI escritorio en mobile ---- */
    .tibor3-tools,
    .tibor3-product { display: none; }

    /* ---- Visor: ocupa todo el espacio vertical disponible (borde a borde) ---- */
    .tibor3-stage-wrap {
        background: #e6e7ea;   /* gris visible (estilo Spreadshirt) para que la prenda resalte */
        border-radius: 0;
        padding: 0;
        min-height: 0;
        /* Crece para llenar la pantalla entre la barra superior y el carrusel */
        flex: 1;
        height: auto;
        overflow: hidden;
        box-shadow: none;
    }
    .tibor3-stage {
        flex: 1;
        height: auto;
        min-height: 0;
        overflow: hidden;
        /* La prenda se alinea abajo → pegada al carrusel, sin hueco intermedio. */
        align-items: flex-end;
    }
    /* El lienzo Konva se amplía más allá del ancho de pantalla (zoom de la prenda)
       y se centra; overflow:hidden del contenedor recorta los márgenes vacíos.
       flex-shrink:0 evita que flex lo encoja de vuelta al ancho del contenedor. */
    .tibor3-stage canvas { max-width: none; }
    .tibor3-stage .konvajs-content { flex-shrink: 0; }
    /* Reset overflow del .tibor3-product (no aplica en sheets) */
    .tibor3-product {
        height: auto;
        overflow-y: visible;
    }
    /* Tallas: 3 columnas en mobile (4 se salían del sheet y cortaban el botón "+") */
    .tibor3-sizes {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .tibor3-size {
        padding: 8px 10px;
        font-size: 13px;
        min-width: 0;          /* permite que la celda encoja y no desborde el sheet */
    }
    /* Zonas: en mobile, padding y font más legibles que el desktop comprimido */
    .tibor3-zone, .tibor3-sleeve {
        padding: 12px 14px;
        font-size: 14px;
    }
    /* Ocultar tabs viejos y label viejo en mobile (los reemplaza .tibor3-m-views) */
    .tibor3-views,
    .tibor3-view-label { display: none; }

    /* ---- Mostrar UI mobile ---- */
    .tibor3-m-topbar { display: flex; }
    .tibor3-m-views { display: flex; }
    .tibor3-m-tabbar { display: flex; }

    /* ---- Controles FLOTANTES sobre el visor (estilo Spreadshirt) ----
       undo/redo (pill izq) · Color ▾ (centro) · ··· (dcha). La barra es transparente
       y deja pasar el toque al visor en los huecos. */
    .tibor3-m-topbar {
        position: absolute;
        top: 10px;
        left: 0; right: 0;
        z-index: 6;
        flex: none;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 0 12px;
        background: transparent;
        border: 0;
        pointer-events: none;
    }
    .tibor3-m-topbar > * { pointer-events: auto; }
    .tibor3-m-undoredo {
        display: inline-flex;
        background: #ffffff;
        border-radius: 999px;
        box-shadow: 0 1px 5px rgba(0,0,0,.14);
        overflow: hidden;
    }
    .tibor3-m-topbtn {
        width: 44px; height: 38px;
        border: 0;
        background: transparent;
        color: #6b7280;
        font-size: 16px;
        line-height: 1;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }
    .tibor3-m-topbtn:active { background: #eef0f3; }
    .tibor3-m-colorbtn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: #ffffff;
        border: 0;
        border-radius: 999px;
        padding: 8px 14px;
        box-shadow: 0 1px 5px rgba(0,0,0,.14);
        font-size: 13px;
        font-weight: 600;
        color: #1a1a2e;
        cursor: pointer;
    }
    .tibor3-m-colorbtn-dot {
        width: 18px; height: 18px;
        border-radius: 50%;
        background: #ffffff;
        border: 1px solid #c8c9d0;
        flex: 0 0 auto;
    }
    .tibor3-m-morebtn {
        width: 42px; height: 42px;
        border: 0;
        border-radius: 50%;
        background: #ffffff;
        box-shadow: 0 1px 5px rgba(0,0,0,.14);
        color: #1a1a2e;
        font-size: 20px;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Toolbar flotante (duplicar/voltear/borrar) retirado del mobile a petición.
       El JS lo sigue gestionando, pero queda oculto por display:none aunque
       quite el atributo [hidden]. */
    .tibor3-m-design-toolbar { display: none !important; }
    .tibor3-m-backdrop { display: block; }
    .tibor3-m-sheet { display: block; }

    /* ---- Carrusel de vistas ---- */
    .tibor3-m-views {
        align-items: center;
        justify-content: center;
        gap: 14px;
        padding: 2px 12px 8px;     /* menos espacio entre la prenda y los bullets */
        position: relative;
        flex-wrap: wrap;            /* permite que la etiqueta caiga a su propia línea */
    }
    .tibor3-m-arrow {
        background: transparent;
        border: 0;
        font-size: 28px;
        line-height: 1;
        color: #1a1a2e;
        cursor: pointer;
        padding: 4px 10px;
        border-radius: 6px;
    }
    .tibor3-m-arrow:active { background: #f5f5f7; }
    .tibor3-m-arrow:disabled { color: #c9cdda; cursor: default; }
    .tibor3-m-dots {
        display: flex;
        gap: 6px;
        align-items: center;
    }
    .tibor3-m-dot {
        width: 6px; height: 6px;
        border-radius: 50%;
        background: #c9cdda;
        transition: background .12s ease, transform .12s ease;
        border: 0;
        padding: 0;
        cursor: pointer;
    }
    .tibor3-m-dot.is-active {
        background: #1a1a2e;
        transform: scale(1.4);
    }
    .tibor3-m-view-label {
        /* En flujo, en su propia línea bajo los dots (antes era absolute bottom:-18px,
           lo que la dejaba pisada por la barra de acciones fija). */
        position: static;
        flex-basis: 100%;          /* en su propia línea, centrada debajo (como estaba) */
        order: 3;
        margin-top: 0;
        text-align: center;
        font-size: 12px;
        color: #6b7280;
    }

    /* ---- Tab bar inferior fija ---- */
    .tibor3-m-tabbar {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        gap: 6px;
        z-index: 50;
        box-shadow: 0 -2px 12px rgba(0,0,0,.06);
    }
    .tibor3-m-tab {
        flex: 1;
        background: #ffffff;
        border: 1.5px solid #e5e7eb;
        border-radius: 10px;
        padding: 10px 4px 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        color: #1a1a2e;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        transition: border-color .12s ease, background .12s ease;
    }
    .tibor3-m-tab:active { background: #f5f5f7; }
    .tibor3-m-tab.is-open { border-color: #1a1a2e; }
    .tibor3-m-tab-ico { font-size: 18px; line-height: 1; }
    .tibor3-m-tab-add { border-color: transparent; }
    .tibor3-m-tab-add-ico {
        width: 30px; height: 30px;
        border-radius: 50%;
        background: #1a1a2e;
        color: #ffffff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        font-weight: 400;
    }
    .tibor3-m-tab-cart {
        background: #1a1a2e;
        color: #ffffff;
        border-color: #1a1a2e;
    }
    .tibor3-m-tab-cart:active { background: #2a2a4e; }
    .tibor3-m-tab-cart .tibor3-m-tab-lbl { font-size: 10.5px; line-height: 1.15; }

    /* ---- Botón "Hecho" (sustituye tab bar al editar diseño) ---- */
    .tibor3-m-done {
        position: fixed;
        left: 50%;
        bottom: calc(16px + env(safe-area-inset-bottom));
        transform: translateX(-50%);
        background: #1a1a2e;
        color: #ffffff;
        border: 0;
        padding: 14px 44px;
        border-radius: 999px;
        font-size: 15px;
        font-weight: 700;
        z-index: 60;
        box-shadow: 0 4px 16px rgba(0,0,0,.18);
        cursor: pointer;
    }

    /* ---- Toolbar flotante sobre diseño ---- */
    .tibor3-m-design-toolbar {
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 6px;
        background: #ffffff;
        border-radius: 999px;
        padding: 6px;
        box-shadow: 0 4px 14px rgba(0,0,0,.12);
        z-index: 40;
    }
    .tibor3-m-tool-btn {
        width: 40px; height: 40px;
        border-radius: 50%;
        border: 0;
        background: #f5f5f7;
        color: #1a1a2e;
        font-size: 18px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .tibor3-m-tool-btn:active { background: #e5e7eb; }
    .tibor3-m-tool-del { background: #fee2e2; color: #c8102e; }

    /* ---- Backdrop + Sheet ---- */
    .tibor3-m-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 70;
        opacity: 0;
        pointer-events: none;
        transition: opacity .24s ease;
    }
    .tibor3-m-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }
    .tibor3-m-sheet {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        background: #ffffff;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 28px rgba(0,0,0,.14);
        z-index: 80;
        max-height: 80vh;
        transform: translateY(100%);
        transition: transform .28s cubic-bezier(.2,.7,.2,1);
        display: flex;
        flex-direction: column;
    }
    .tibor3-m-sheet.is-open { transform: translateY(0); }
    .tibor3-m-sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px 8px;
        border-bottom: 1px solid #f0f1f4;
    }
    .tibor3-m-sheet-title {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
        color: #1a1a2e;
    }
    .tibor3-m-sheet-close {
        background: transparent;
        border: 0;
        font-size: 26px;
        line-height: 1;
        color: #6b7280;
        padding: 4px 10px;
        cursor: pointer;
        border-radius: 6px;
    }
    .tibor3-m-sheet-close:active { background: #f5f5f7; }
    .tibor3-m-sheet-body {
        padding: 14px 16px 24px;
        overflow-y: auto;
        flex: 1;
    }

    /* Estado: hay diseño seleccionado → ocultar tab bar, mostrar Hecho y toolbar */
    .tibor3-cfg[data-design-selected="true"] .tibor3-m-tabbar { display: none; }
    .tibor3-cfg[data-design-selected="true"] .tibor3-m-done { display: inline-flex; }

    /* ---- Sheet "Añadir": botones grandes ---- */
    .tibor3-m-addgrid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    .tibor3-m-addbtn {
        background: #f5f5f7;
        border: 1.5px solid transparent;
        border-radius: 12px;
        padding: 16px 8px;
        font-size: 12px;
        font-weight: 600;
        color: #1a1a2e;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        cursor: pointer;
    }
    .tibor3-m-addbtn:active { background: #e5e7eb; }
    .tibor3-m-addbtn-ico {
        width: 44px; height: 44px;
        border-radius: 50%;
        background: #ffffff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        font-weight: 700;
        box-shadow: 0 1px 3px rgba(0,0,0,.08);
    }

    /* En sheet, las secciones movidas deben verse limpias sin doble padding */
    .tibor3-m-sheet-body .tibor3-section {
        margin-bottom: 14px;
    }
    .tibor3-m-sheet-body .tibor3-cart-btn {
        margin-top: 10px;
        width: 100%;
    }
    /* En el sheet de cesta, la matriz de tallas se muestra siempre abierta
       (el dropdown es solo un patrón de escritorio para ahorrar espacio). */
    .tibor3-m-sheet-body .tibor3-sizes-dd-sum { display: none; }
    .tibor3-m-sheet-body .tibor3-sizes-dd > .tibor3-sizes {
        display: grid !important;
        border: 0;
        padding: 0;
    }
}

/* ===================================================================
 * GALERÍA "Mis subidas" — Modal compartido escritorio + mobile
 * ================================================================== */
.tibor3-gallery-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tibor3-gallery-overlay[hidden] { display: none; }
.tibor3-gallery-modal {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 36px rgba(0,0,0,.2);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.tibor3-gallery-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f1f4;
}
.tibor3-gallery-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}
.tibor3-gallery-close {
    background: transparent;
    border: 0;
    font-size: 26px;
    line-height: 1;
    color: #6b7280;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.tibor3-gallery-close:hover { background: #f5f5f7; }
.tibor3-gallery-grid {
    padding: 14px 18px;
    overflow-y: auto;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 10px;
    align-content: start;
}
.tibor3-gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #88889c;
    padding: 28px 12px;
    font-size: 13px;
}
.tibor3-gallery-item {
    position: relative;
    background: #f5f5f7;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 4px;
    transition: border-color .12s ease, background .12s ease;
    /* Altura fija para que TODAS las miniaturas se vean iguales aunque las
       imágenes originales tengan ratios o tamaños distintos */
    min-height: 0;
}
.tibor3-gallery-item:hover { border-color: #1a1a2e; }
.tibor3-gallery-item img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: repeating-conic-gradient(#f7f7f9 0% 25%, #ffffff 0% 50%) 50% / 12px 12px;
    border-radius: 4px;
    display: block;
}
.tibor3-gallery-item-name {
    width: 100%;
    font-size: 11px;
    color: #44444a;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.tibor3-gallery-item-del {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fee2e2;
    color: #c8102e;
    border: 1.5px solid #ffffff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tibor3-gallery-item-del:hover { background: #c8102e; color: #ffffff; }
.tibor3-gallery-foot {
    padding: 12px 18px 18px;
    border-top: 1px solid #f0f1f4;
}
.tibor3-gallery-upload-btn {
    width: 100%;
    background: #1a1a2e;
    color: #ffffff;
    border: 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.tibor3-gallery-upload-btn:hover { background: #2a2a4e; }

@media (max-width: 760px) {
    .tibor3-gallery-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .tibor3-gallery-modal {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
    }
    .tibor3-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================================================
 * UX: BADGE en thumbs · CHIP vista actual · TOAST · CONTADOR botón
 * ================================================================== */

/* A. Badge en thumbs (escritorio): puntito naranja arriba-derecha */
.tibor3-view-thumb { position: relative; }
.tibor3-view-thumb.has-design::after {
    content: "";
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    background: #0b3989;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

/* Mobile dots: en lugar de badge, cambiar color al azul de marca */
@media (max-width: 760px) {
    .tibor3-m-dot.has-design { background: #0b3989; }
    .tibor3-m-dot.has-design.is-active {
        background: #1a1a2e;
        box-shadow: 0 0 0 3px rgba(11,57,137,.35);
    }
}

/* B. Chip "EDITANDO · FRENTE" sticky arriba del visor */
.tibor3-lowres-warn {
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 7;
    display: flex;
    align-items: center;
    gap: 7px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    max-width: 88%;
    text-align: center;
}
.tibor3-lowres-warn[hidden] { display: none; }

/* Aviso de tamaño: mismo formato que el de resolución, pero debajo para que conviva con él.
   En azul cuando solo informa de que el diseño se pasa de la zona y lleva recargo, y en rojo
   cuando supera el máximo admitido, que ya no es un aviso sino un tope. */
.tibor3-size-warn {
    top: 96px;
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #3b82f6;
}
.tibor3-size-warn.is-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

/* Avisos discretos (22-10-2026): ya no tapan la prenda. Van en la esquina superior izquierda
   del visor, más pequeños y sobre fondo blanco; el color lo pone la franja izquierda y el icono.
   El rojo (supera el máximo y no se puede comprar) se mantiene bien visible. */
.tibor3-lowres-warn {
    top: 58px;
    left: 16px;
    transform: none;
    max-width: min(340px, calc(100% - 32px));
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid #fde68a;
    border-left: 3px solid #f59e0b;
    background: rgba(255,255,255,.94);
    color: #78350f;
    font-size: 11px;
    font-weight: 500;
    text-align: left;
    box-shadow: 0 1px 4px rgba(15,23,42,.08);
}
.tibor3-lowres-warn i { color: #d97706; font-size: 12px; flex: 0 0 auto; }
.tibor3-size-warn {
    top: 108px;
    border-color: #bfdbfe;
    border-left-color: #3b82f6;
    background: rgba(255,255,255,.94);
    color: #1e3a8a;
}
.tibor3-size-warn i { color: #2563eb; }
.tibor3-lowres-warn[hidden] + .tibor3-size-warn { top: 58px; }
.tibor3-size-warn.is-error {
    border-color: #fca5a5;
    border-left: 3px solid #dc2626;
    background: #fff5f5;
    color: #991b1b;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(220,38,38,.18);
}
.tibor3-size-warn.is-error i { color: #dc2626; }
/* Total en la barra inferior del móvil, bajo «Añadir a la cesta» (22-10-2026). */
.tibor3-m-tab-price { display: block; font-size: 11px; font-weight: 700; line-height: 1.1; margin-top: 1px; font-variant-numeric: tabular-nums; }
.tibor3-m-tab-price[hidden] { display: none; }
@media (max-width: 768px) {
    .tibor3-lowres-warn {
        left: 8px;
        right: 8px;
        max-width: none;
        top: 50px;
        padding: 5px 8px;
        font-size: 10.5px;
    }
    .tibor3-size-warn { top: 92px; }
    .tibor3-lowres-warn[hidden] + .tibor3-size-warn { top: 50px; }
}

.tibor3-current-view-chip {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26,26,46,0.92);
    color: #ffffff;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    z-index: 5;
    pointer-events: none;
    white-space: nowrap;
}

/* C. Toast (mensaje breve al cambiar vista, etc.) */
.tibor3-toast {
    position: fixed;
    bottom: 86px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #ffffff;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    z-index: 300;
    opacity: 0;
    transition: opacity .28s ease, transform .28s ease;
    pointer-events: none;
    max-width: calc(100vw - 32px);
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.tibor3-toast[hidden] { display: block; visibility: hidden; }
.tibor3-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* D. Contador "N caras personalizadas" en botón añadir al carrito */
.tibor3-cart-btn .tibor3-cart-count {
    display: block;
    font-size: 11px;
    font-weight: 500;
    margin-top: 3px;
    opacity: 0.85;
}

/* ===================================================================
 * GUÍA DE TALLAS
 * ================================================================== */
.tibor3-sizes-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.tibor3-size-guide-link {
    background: transparent;
    border: 0;
    color: #1a1a2e;
    font-size: 11px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}
.tibor3-size-guide-link:hover { color: #0b3989; }

.tibor3-sizeguide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tibor3-sizeguide-overlay[hidden] { display: none; }
.tibor3-sizeguide-modal {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 36px rgba(0,0,0,.2);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.tibor3-sizeguide-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f1f4;
}
.tibor3-sizeguide-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}
.tibor3-sizeguide-close {
    background: transparent;
    border: 0;
    font-size: 26px;
    line-height: 1;
    color: #6b7280;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.tibor3-sizeguide-close:hover { background: #f5f5f7; }
.tibor3-sizeguide-body {
    padding: 16px 18px 18px;
    overflow-y: auto;
    flex: 1;
}
.tibor3-sizeguide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tibor3-sizeguide-table th,
.tibor3-sizeguide-table td {
    padding: 9px 8px;
    text-align: center;
    border-bottom: 1px solid #f0f1f4;
}
.tibor3-sizeguide-table th {
    background: #f5f5f7;
    color: #44444a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
}
.tibor3-sizeguide-table tbody tr:hover { background: #fafbfc; }
.tibor3-sizeguide-note {
    font-size: 11px;
    color: #88889c;
    margin: 12px 0 0;
    text-align: center;
}

@media (max-width: 760px) {
    .tibor3-sizeguide-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .tibor3-sizeguide-modal {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }
}

/* ===================================================================
 * MODAL "PRODUCTOS" — catálogo con categorías + buscador (Etapa 2)
 * ================================================================== */
.tibor3-products-overlay {
    position: fixed;
    /* Se abre ~100px por DEBAJO del menú fijo (no lo tapa). --t3-header-h lo calcula el JS. */
    top: calc(var(--t3-header-h, 64px) + 100px);
    left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.45);
    z-index: 260;
    display: flex;
    align-items: flex-end;     /* el modal llena el hueco y sale desde abajo */
    justify-content: center;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.tibor3-products-overlay[hidden] { display: none; }
.tibor3-products-modal {
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 100%;           /* a todo el ancho de la pantalla */
    /* Llena el hueco del overlay (desde ~100px bajo el menú hasta abajo). */
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 36px rgba(0,0,0,.2);
    overflow: hidden;
    /* Desliza desde abajo, como los sheets de móvil. */
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.tibor3-products-overlay.is-open .tibor3-products-modal { transform: translateY(0); }

/* ===== Editor de texto (bottom-sheet, escritorio + móvil) ===== */
.tibor3-text-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 280;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.tibor3-text-overlay[hidden] { display: none; }
.tibor3-text-modal {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 36px rgba(0,0,0,.2);
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.2,.7,.2,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tibor3-text-overlay.is-open .tibor3-text-modal { transform: translateY(0); }
.tibor3-text-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid #f0f1f4;
}
.tibor3-text-title { margin: 0; font-size: 16px; font-weight: 800; color: #1a1a2e; }
.tibor3-text-close {
    background: transparent; border: 0; font-size: 26px; line-height: 1;
    color: #6b7280; cursor: pointer; padding: 2px 8px; border-radius: 6px;
}
.tibor3-text-close:hover { background: #f5f5f7; }
.tibor3-text-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.tibor3-text-input {
    width: 100%; border: 1px solid #d6d6de; border-radius: 8px; padding: 10px 12px;
    font-size: 15px; resize: vertical; min-height: 48px; font-family: inherit;
}
.tibor3-text-input:focus { outline: none; border-color: #1a1a2e; }
.tibor3-text-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tibor3-text-label {
    font-size: 12px; font-weight: 600; color: #6b7280;
    text-transform: uppercase; letter-spacing: .04em;
}
.tibor3-text-font {
    flex: 1; max-width: 72%; border: 1px solid #d6d6de; border-radius: 8px;
    padding: 9px 10px; font-size: 14px; background: #ffffff; cursor: pointer;
}
.tibor3-text-color {
    width: 48px; height: 36px; border: 1px solid #d6d6de; border-radius: 8px;
    padding: 2px; cursor: pointer; background: #ffffff;
}
.tibor3-text-foot {
    padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid #f0f1f4;
}
.tibor3-text-apply {
    width: 100%; background: #1a1a2e; color: #ffffff; border: 0; border-radius: 8px;
    padding: 13px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.tibor3-text-apply:hover { background: #2a2a4e; }

/* ===== Editor de texto (escritorio): barra flotante + popovers + inline ===== */
.tibor3-text-tb {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border-radius: 999px;
    box-shadow: 0 4px 18px rgba(0,0,0,.16);
    padding: 6px 10px;
    max-width: 96%;
    overflow-x: auto;
}
.tibor3-text-tb[hidden] { display: none; }
.t3tb-btn {
    border: 0; background: transparent; cursor: pointer;
    min-width: 32px; height: 32px; padding: 0 8px;
    border-radius: 8px; font-size: 14px; color: #1a1a2e;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    white-space: nowrap; flex: 0 0 auto;
}
.t3tb-btn:hover { background: #f2f3f5; }
.t3tb-btn.is-on { background: #1a1a2e; color: #ffffff; }
.t3tb-fontbtn { font-weight: 600; }
.t3tb-caret { font-size: 10px; color: #88889c; }
.t3tb-del { color: #c8102e; }
.t3tb-sep { width: 1px; height: 22px; background: #e5e7eb; margin: 0 2px; flex: 0 0 auto; }
.t3tb-size { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.t3tb-size-lbl { font-size: 11px; color: #6b7280; }
#t3tb-size { width: 110px; accent-color: #1a1a2e; }
.t3tb-colorbtn { font-weight: 600; }
.t3tb-color-dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid #d6d6de; background: #FFFFFF; flex: 0 0 auto; }

.tibor3-text-pop {
    position: absolute;
    top: 54px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
    padding: 14px;
    width: min(360px, 92%);
    max-height: 64%;
    overflow-y: auto;
}
.tibor3-text-pop[hidden] { display: none; }
.tibor3-pop-title { font-size: 14px; font-weight: 800; color: #1a1a2e; margin-bottom: 10px; }
.tibor3-font-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tibor3-font-cell {
    border: 1px solid #e5e7eb; border-radius: 10px; background: #fafafb;
    padding: 16px 8px; font-size: 20px; color: #1a1a2e; cursor: pointer;
    text-align: center; line-height: 1.1; overflow: hidden;
}
.tibor3-font-cell:hover { border-color: #1a1a2e; background: #ffffff; }
.tibor3-color-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tibor3-color-cell { width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; border: 0; cursor: pointer; transition: transform .1s ease; }
.tibor3-color-cell:hover { transform: scale(1.12); }

.tibor3-text-edit {
    position: absolute;
    z-index: 10;
    border: 1px dashed #1a1a2e;
    background: rgba(255,255,255,.55);
    outline: none;
    resize: none;
    overflow: hidden;
    line-height: 1;
    transform-origin: top left;
    padding: 0;
    white-space: pre;
    min-width: 60px;
}
.tibor3-text-edit[hidden] { display: none; }

/* ===== Editor de texto MÓVIL: barra superior + hoja "Estilo de texto" ===== */
.tibor3-cfg[data-mtext="open"] .tibor3-m-done { display: none !important; }

@media (max-width: 760px) {
    .tibor3-mtext-top {
        position: absolute;
        top: 10px; left: 0; right: 0;
        z-index: 8;
        display: flex; gap: 6px; padding: 0 12px;
        overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .tibor3-mtext-top::-webkit-scrollbar { display: none; }
    .tibor3-mtext-top[hidden] { display: none; }
    .tibor3-mtext-pill {
        flex: 0 0 auto; border: 0; background: #ffffff;
        box-shadow: 0 1px 5px rgba(0,0,0,.14);
        border-radius: 999px; padding: 9px 14px;
        font-size: 13px; font-weight: 600; color: #1a1a2e;
        display: inline-flex; align-items: center; gap: 6px;
        cursor: pointer; white-space: nowrap;
    }

    .tibor3-mtext-backdrop {
        position: fixed; inset: 0; background: rgba(0,0,0,.35);
        z-index: 300; opacity: 0; transition: opacity .24s ease;
    }
    .tibor3-mtext-backdrop[hidden] { display: none; }
    .tibor3-mtext-backdrop.is-open { opacity: 1; }
    .tibor3-mtext-sheet {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 310;
        background: #ffffff; border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 28px rgba(0,0,0,.18);
        transform: translateY(100%);
        transition: transform .28s cubic-bezier(.2,.7,.2,1);
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        max-height: 72vh; display: flex; flex-direction: column;
    }
    .tibor3-mtext-sheet[hidden] { display: none; }
    .tibor3-mtext-sheet.is-open { transform: translateY(0); }
    .tibor3-mtext-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
    .tibor3-mtext-title { font-size: 17px; font-weight: 800; color: #1a1a2e; flex: 1; }
    .tibor3-mtext-icon {
        border: 0; background: #f5f5f7; cursor: pointer;
        width: 38px; height: 38px; border-radius: 10px; font-size: 16px; color: #1a1a2e;
        display: inline-flex; align-items: center; justify-content: center;
    }
    .tibor3-mtext-del { color: #c8102e; }
    .tibor3-mtext-check { border: 0; background: transparent; cursor: pointer; width: 38px; height: 38px; font-size: 20px; color: #1a1a2e; }
    .tibor3-mtext-tabs {
        display: flex; gap: 6px; padding: 4px 12px 10px;
        overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid #f0f1f4;
    }
    .tibor3-mtext-tabs::-webkit-scrollbar { display: none; }
    .tibor3-mtext-tab {
        flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
        padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
        color: #6b7280; white-space: nowrap;
    }
    .tibor3-mtext-tab.is-active { background: #eef0f3; color: #1a1a2e; }
    .tibor3-mtext-body { padding: 14px 16px; overflow-y: auto; }
    .tibor3-mtext-input {
        width: 100%; border: 1px solid #d6d6de; border-radius: 10px; padding: 12px;
        font-size: 16px; resize: vertical; min-height: 56px; font-family: inherit;
    }
    .tibor3-mtext-input:focus { outline: none; border-color: #1a1a2e; }
    .tibor3-mtext-size { text-align: center; padding: 8px 0; }
    .tibor3-mtext-size-val { font-size: 28px; font-weight: 800; color: #1a1a2e; margin-bottom: 12px; }
    .tibor3-mtext-size-row { display: flex; align-items: center; gap: 10px; }
    .tibor3-mtext-size-row span { font-size: 12px; color: #6b7280; }
    #tibor3-mtext-size { flex: 1; accent-color: #1a1a2e; }
    .tibor3-mtext-format { display: flex; flex-direction: column; gap: 12px; }
    .tibor3-mtext-fmtrow { display: flex; gap: 8px; }
    .tibor3-mtext-fbtn {
        flex: 1; border: 1px solid #e5e7eb; background: #ffffff; cursor: pointer;
        border-radius: 10px; padding: 12px 8px; font-size: 15px; color: #1a1a2e;
        display: inline-flex; align-items: center; justify-content: center;
    }
    .tibor3-mtext-fbtn.is-on { background: #1a1a2e; color: #ffffff; border-color: #1a1a2e; }
    .tibor3-mtext-align .tibor3-mtext-fbtn { font-size: 13px; font-weight: 600; }
}
.tibor3-products-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f1f4;
}
.tibor3-products-title { margin: 0; font-size: 16px; font-weight: 800; color: #1a1a2e; }
.tibor3-products-close {
    background: transparent; border: 0; font-size: 26px; line-height: 1;
    color: #6b7280; padding: 4px 10px; border-radius: 6px; cursor: pointer;
}
.tibor3-products-close:hover { background: #f5f5f7; }
.tibor3-products-toolsbar {
    padding: 12px 18px 6px;
    border-bottom: 1px solid #f0f1f4;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tibor3-products-search {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}
.tibor3-products-search:focus { outline: none; border-color: #1a1a2e; }
.tibor3-products-cats {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}
.tibor3-products-cat {
    flex: 0 0 auto;
    background: #f5f5f7;
    border: 1.5px solid transparent;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #44444a;
    cursor: pointer;
    white-space: nowrap;
}
.tibor3-products-cat.is-active { background: #1a1a2e; color: #ffffff; }
.tibor3-products-grid {
    padding: 18px 22px 26px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;            /* clave: permite que el grid scrollee dentro del flex column */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
    align-content: start;
}
.tibor3-products-empty {
    grid-column: 1 / -1; text-align: center; color: #88889c; padding: 28px 12px; font-size: 13px;
}
.tibor3-products-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: #1a1a2e;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tibor3-products-card:hover {
    border-color: #1a1a2e;
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
    transform: translateY(-3px);
}
.tibor3-products-card-thumb {
    display: block;            /* el <span> es flex-item pero forzamos block para el aspect-ratio */
    width: 100%;
    aspect-ratio: 4 / 5;       /* imagen grande con prioridad, estilo Spreadshirt (img 2) */
    background: #f5f5f7;
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
}
.tibor3-products-card-thumb img {
    width: 100%; height: 100%; object-fit: contain; display: block;
    transition: transform .25s ease;
}
.tibor3-products-card:hover .tibor3-products-card-thumb img { transform: scale(1.05); }
.tibor3-products-card-body { display: flex; flex-direction: column; padding: 10px 12px 12px; }
.tibor3-products-card-price { font-size: 15px; font-weight: 800; color: #1a1a2e; }
.tibor3-products-card-name {
    margin-top: 2px; font-size: 13px; font-weight: 600; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tibor3-products-card-short {
    margin-top: 3px; font-size: 12px; color: #88889c; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tibor3-products-card-colors { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tibor3-products-swatch {
    width: 14px; height: 14px; border-radius: 50%;
    border: 1px solid rgba(0,0,0,.15); display: inline-block;
}
.tibor3-products-more { font-size: 11px; color: #88889c; font-weight: 600; }

/* Botón "Productos" en la barra superior móvil (pill a la derecha). */
.tibor3-m-topbtn-products {
    margin-left: auto;
    padding: 0 14px;
    height: 36px;
    border-radius: 999px;
    border: 0;
    background: #1a1a2e;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.tibor3-m-topbtn-products:active { background: #2a2a4e; }

@media (max-width: 760px) {
    /* En móvil sigue como bottom-sheet a pantalla completa (sin el offset de escritorio). */
    .tibor3-products-overlay { top: 0; }
    .tibor3-products-modal { height: 88vh; max-height: 88vh; }
    .tibor3-products-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   ICONOS — picker (modal), celdas, barra de icono, undo/redo
   ============================================================ */
.tibor3-icons-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 260;
    display: flex; align-items: flex-end; justify-content: center; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.tibor3-icons-overlay[hidden] { display: none; }
.tibor3-icons-modal {
    background: #ffffff; border-radius: 16px 16px 0 0;
    width: 100%; max-width: 100%;
    height: calc(80vh - 100px); max-height: calc(80vh - 100px);
    display: flex; flex-direction: column;
    box-shadow: 0 -8px 36px rgba(0,0,0,.2); overflow: hidden;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.tibor3-icons-overlay.is-open .tibor3-icons-modal { transform: translateY(0); }
.tibor3-icons-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid #f0f1f4;
}
.tibor3-icons-title { margin: 0; font-size: 16px; font-weight: 700; color: #1a1a2e; }
.tibor3-icons-close {
    background: transparent; border: 0; font-size: 26px; line-height: 1;
    color: #6b7280; padding: 4px 10px; border-radius: 6px; cursor: pointer;
}
.tibor3-icons-close:hover { background: #f5f5f7; }
.tibor3-icons-grid {
    padding: 14px 18px; overflow-y: auto; flex: 1;
    display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; align-content: start;
}
.tibor3-icon-cell {
    aspect-ratio: 1 / 1; background: #f5f5f7; border: 1.5px solid #e5e7eb;
    border-radius: 10px; padding: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .12s ease, background .12s ease;
}
.tibor3-icon-cell:hover { border-color: #1a1a2e; background: #ffffff; }
.tibor3-icon-cell img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Barra de icono escritorio: hereda .tibor3-text-tb; sin overrides necesarios. */
.tibor3-icon-tb[hidden] { display: none; }

/* Botones Deshacer/Rehacer deshabilitados (sin historial disponible) */
[data-tool="undo"].is-disabled,
[data-tool="redo"].is-disabled { opacity: .35; cursor: default; }

/* Pill "Borrar" (barra de elemento móvil) en rojo */
.tibor3-mtext-pill--del { color: #c8102e; }

/* Botones flotantes sobre el elemento seleccionado (papelera arriba, girar abajo) */
.tibor3-el-handle {
    position: absolute; z-index: 12;
    width: 38px; height: 38px; border-radius: 50%;
    border: 2px solid #ffffff; background: #ffffff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; cursor: pointer; padding: 0;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 10px rgba(0,0,0,.22);
    touch-action: none;
}
.tibor3-el-handle[hidden] { display: none; }
.tibor3-el-del { color: #c8102e; border-color: #f3b4bd; }
.tibor3-el-del:hover { background: #fff5f6; }
.tibor3-el-rot { color: #2E6FE0; border-color: #b9cff4; cursor: grab; }
.tibor3-el-rot:active { cursor: grabbing; }

@media (max-width: 760px) {
    /* Modal de iconos: ancho del overlay (= pantalla, como el modal de productos)
       y 150px más abajo. minmax(0,1fr) garantiza que las 4 columnas encajen. */
    .tibor3-icons-overlay { align-items: flex-start; }
    .tibor3-icons-modal {
        width: 100%; max-width: 100%;
        margin-top: 150px;
        height: calc(100vh - 150px); max-height: calc(100vh - 150px);
    }
    .tibor3-icons-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tibor3-el-handle { width: 42px; height: 42px; font-size: 16px; }
}

/* ===================================================================
 * MODAL "PRODUCTOS" - vista catalogo tipo Spreadshirt.
 * Override final para evitar que estilos del tema compriman las tarjetas.
 * ================================================================== */
.tibor3-products-overlay .tibor3-products-modal {
    border-radius: 16px 16px 0 0;
    background: #fff;
}

.tibor3-products-overlay .tibor3-products-head {
    padding: 26px 50px 12px;
    border-bottom: 0;
}

.tibor3-products-overlay .tibor3-products-title {
    font-size: 23px;
    line-height: 1.2;
    font-weight: 800;
    color: #17171d;
}

.tibor3-products-overlay .tibor3-products-close {
    position: absolute;
    top: 36px;
    right: 48px;
    z-index: 2;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    color: #111;
    font-size: 36px;
    font-weight: 300;
    background: transparent;
}

.tibor3-products-overlay .tibor3-products-toolsbar {
    display: grid;
    grid-template-columns: minmax(280px, 302px) 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px 50px 26px;
    border-bottom: 0;
}

.tibor3-products-overlay .tibor3-products-search {
    height: 50px;
    border: 1px solid #777;
    border-radius: 0;
    padding: 0 16px 0 54px;
    color: #202026;
    font-size: 20px;
    background: #fff;
    box-shadow: none;
}

.tibor3-products-overlay .tibor3-products-search::placeholder {
    color: #73777d;
}

.tibor3-products-overlay .tibor3-products-toolsbar::before {
    content: "\1F50D";
    position: absolute;
    margin-left: 18px;
    margin-top: 1px;
    font-size: 24px;
    line-height: 1;
    color: #6d7178;
    z-index: 1;
    pointer-events: none;
}

.tibor3-products-overlay .tibor3-products-cats {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0;
    scrollbar-width: thin;
}

.tibor3-products-overlay .tibor3-products-cat {
    min-height: 50px;
    border: 2px solid #111;
    border-radius: 0;
    padding: 0 18px;
    background: #fff;
    color: #111;
    font-size: 18px;
    font-weight: 700;
}

.tibor3-products-overlay .tibor3-products-cat.is-active {
    background: #111;
    color: #fff;
}

.tibor3-products-overlay .tibor3-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 34px 10px;
    padding: 2px 50px 42px;
    overflow-y: auto;
    align-content: start;
    background: #fff;
}

.tibor3-products-overlay .tibor3-products-card {
    display: flex !important;
    flex-direction: column;
    min-width: 0;
    height: auto;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent;
    color: #17171d;
    box-shadow: none !important;
    overflow: visible;
    text-decoration: none;
    transform: none !important;
}

.tibor3-products-overlay .tibor3-products-card:hover .tibor3-products-card-name {
    text-decoration: underline;
}

.tibor3-products-overlay .tibor3-products-card-thumb {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 2 / 3;
    min-height: 420px;
    padding: 26px 20px 54px;
    background: #f7f7f8;
    box-sizing: border-box;
    overflow: hidden;
}

.tibor3-products-overlay .tibor3-products-card-thumb img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
    transform: none !important;
}

.tibor3-products-overlay .tibor3-products-card-badge {
    position: absolute;
    left: 20px;
    bottom: 20px;
    max-width: calc(100% - 40px);
    padding: 7px 10px;
    border-radius: 4px;
    background: rgba(255,255,255,.92);
    color: #111;
    font-size: 18px;
    line-height: 1;
}

.tibor3-products-overlay .tibor3-products-card-body {
    display: flex;
    flex-direction: column;
    padding: 10px 0 0;
    min-width: 0;
}

.tibor3-products-overlay .tibor3-products-card-price {
    order: 1;
    color: #17171d;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
}

.tibor3-products-overlay .tibor3-products-card-name {
    order: 2;
    margin-top: 4px;
    color: #17171d;
    font-size: 19px;
    line-height: 1.35;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tibor3-products-overlay .tibor3-products-card-short {
    display: none;
}

.tibor3-products-overlay .tibor3-products-card-colors {
    order: 3;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    margin-top: 12px;
    overflow: hidden;
}

.tibor3-products-overlay .tibor3-products-swatch {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.14);
    flex: 0 0 auto;
}

.tibor3-products-overlay .tibor3-products-more {
    color: #17171d;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
}

@media (max-width: 1180px) {
    .tibor3-products-overlay .tibor3-products-grid {
        grid-template-columns: repeat(3, minmax(210px, 1fr));
    }
    .tibor3-products-overlay .tibor3-products-card-thumb {
        min-height: 360px;
    }
}

@media (max-width: 900px) {
    .tibor3-products-overlay .tibor3-products-head {
        padding: 22px 22px 10px;
    }
    .tibor3-products-overlay .tibor3-products-close {
        top: 22px;
        right: 20px;
    }
    .tibor3-products-overlay .tibor3-products-toolsbar {
        grid-template-columns: 1fr;
        padding: 8px 22px 20px;
    }
    .tibor3-products-overlay .tibor3-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 26px 12px;
        padding: 0 22px 34px;
    }
    .tibor3-products-overlay .tibor3-products-card-thumb {
        min-height: 260px;
    }
}

@media (max-width: 560px) {
    .tibor3-products-overlay .tibor3-products-title {
        font-size: 20px;
        padding-right: 40px;
    }
    .tibor3-products-overlay .tibor3-products-search {
        height: 46px;
        font-size: 16px;
    }
    .tibor3-products-overlay .tibor3-products-cat {
        min-height: 42px;
        font-size: 14px;
        padding: 0 12px;
    }
    .tibor3-products-overlay .tibor3-products-card-thumb {
        min-height: 210px;
        padding: 18px 12px 42px;
    }
    .tibor3-products-overlay .tibor3-products-card-badge {
        left: 12px;
        bottom: 12px;
        font-size: 13px;
    }
    .tibor3-products-overlay .tibor3-products-card-price,
    .tibor3-products-overlay .tibor3-products-card-name {
        font-size: 14px;
    }
}

/* ===================================================================
 * MOBILE REFRESH TIBOR
 * Capa visual aislada: conserva el DOM y todos los eventos aprobados.
 * ================================================================== */
@media (max-width: 760px) {
    .tibor3-cfg[data-mode="mobile"] {
        --t3-mobile-blue: #0b3f91;
        --t3-mobile-blue-dark: #082f70;
        --t3-mobile-ink: #13233b;
        --t3-mobile-muted: #66778c;
        --t3-mobile-line: #d6e2ef;
        --t3-mobile-surface: rgba(255, 255, 255, .96);
        --t3-mobile-canvas: #eaf1f9;
        background: var(--t3-mobile-canvas);
        padding-bottom: calc(88px + env(safe-area-inset-bottom));
    }

    /* En esta app móvil se conserva la fila principal de navegación, pero se retiran
       promo, menú secundario y footer para dedicar el viewport al personalizador. */
    body:has(.tibor3-cfg) .t26-chrome:not(.t26-footer) > .promo,
    body:has(.tibor3-cfg) .t26-chrome:not(.t26-footer) > .mainnav,
    body:has(.tibor3-cfg) .t26-chrome.t26-footer,
    body:has(.tibor3-cfg) footer.t26-footer,
    body:has(.tibor3-cfg) .tibor-footer-usp,
    body:has(.tibor3-cfg) .tibor-footer-main {
        display: none !important;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-breadcrumb {
        position: relative;
        z-index: 8;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 7px;
        min-height: 46px;
        width: 100%;
        padding: 10px 16px;
        overflow: hidden;
        border-bottom: 1px solid rgba(207, 220, 235, .82);
        background: rgba(248, 251, 255, .94);
        color: #66778c;
        font-size: 13px;
        line-height: 1.25;
        white-space: nowrap;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-breadcrumb a {
        flex: 0 0 auto;
        color: var(--t3-mobile-blue);
        font-weight: 700;
        text-decoration: none;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-breadcrumb-current {
        min-width: 0;
        overflow: hidden;
        color: #75859a;
        text-overflow: ellipsis;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-stage-wrap {
        background:
            radial-gradient(circle at 50% 38%, rgba(255,255,255,.96) 0, rgba(245,249,253,.78) 29%, rgba(225,235,247,.56) 58%, rgba(215,227,240,.82) 100%);
        border-bottom: 1px solid rgba(196, 212, 230, .72);
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-topbar {
        top: 60px;
        padding: 0 14px;
        gap: 10px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-undoredo,
    .tibor3-cfg[data-mode="mobile"] .tibor3-m-colorbtn,
    .tibor3-cfg[data-mode="mobile"] .tibor3-m-morebtn {
        background: var(--t3-mobile-surface);
        border: 1px solid rgba(207, 220, 235, .94);
        box-shadow: 0 8px 24px rgba(23, 57, 97, .11), 0 1px 2px rgba(23, 57, 97, .08);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-undoredo {
        min-height: 50px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-topbtn {
        width: 48px;
        height: 50px;
        color: var(--t3-mobile-blue);
        font-size: 17px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-topbtn + .tibor3-m-topbtn {
        border-left: 1px solid #e5edf6;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-topbtn:disabled {
        color: #aebdcd;
        background: transparent;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-colorbtn {
        min-height: 50px;
        padding: 8px 16px;
        color: var(--t3-mobile-ink);
        font-size: 14px;
        font-weight: 700;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-colorbtn-dot {
        width: 22px;
        height: 22px;
        border: 2px solid #fff;
        box-shadow: 0 0 0 1px #9eb0c4;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-morebtn {
        width: 50px;
        height: 50px;
        color: var(--t3-mobile-blue);
        font-size: 18px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-topbtn:active,
    .tibor3-cfg[data-mode="mobile"] .tibor3-m-colorbtn:active,
    .tibor3-cfg[data-mode="mobile"] .tibor3-m-morebtn:active {
        background: #edf4fc;
    }

    .tibor3-cfg[data-mode="mobile"] :is(.tibor3-m-colorbtn, .tibor3-m-morebtn).is-open {
        border-color: #8eb1dd;
        background: #eaf2fc;
        box-shadow: 0 0 0 2px rgba(31, 115, 220, .12), 0 8px 24px rgba(23, 57, 97, .11);
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-views {
        align-self: center;
        display: grid;
        grid-template-columns: 46px minmax(92px, auto) 46px;
        grid-template-rows: 32px 20px;
        align-items: center;
        justify-items: center;
        column-gap: 4px;
        row-gap: 0;
        width: auto;
        min-width: 208px;
        margin: 8px auto 6px;
        padding: 5px 8px 7px;
        border: 1px solid rgba(207, 220, 235, .94);
        border-radius: 18px;
        background: rgba(255, 255, 255, .9);
        box-shadow: 0 8px 24px rgba(23, 57, 97, .08);
        flex-wrap: nowrap;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-arrow {
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        color: var(--t3-mobile-blue);
        font-size: 17px;
        border-radius: 12px;
        grid-row: 1 / span 2;
    }

    .tibor3-cfg[data-mode="mobile"] #tibor3-m-prev { grid-column: 1; }
    .tibor3-cfg[data-mode="mobile"] #tibor3-m-next { grid-column: 3; }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-arrow:active {
        background: #eaf2fb;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-arrow:disabled {
        color: #afbdcc;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-dots {
        grid-column: 2;
        grid-row: 1;
        gap: 0;
        justify-content: center;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-dot {
        position: relative;
        width: 22px;
        height: 32px;
        background: transparent;
        transform: none;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-dot::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 6px;
        height: 6px;
        border-radius: 999px;
        background: #aebdce;
        transform: translate(-50%, -50%);
        transition: width .18s ease, background .18s ease;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-dot.is-active::after {
        width: 18px;
        background: var(--t3-mobile-blue);
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-view-label {
        grid-column: 2;
        grid-row: 2;
        order: initial;
        margin: 0;
        color: var(--t3-mobile-ink);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .01em;
        line-height: 1.2;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tabbar {
        left: max(8px, env(safe-area-inset-left));
        right: max(8px, env(safe-area-inset-right));
        bottom: max(8px, env(safe-area-inset-bottom));
        min-height: 72px;
        padding: 6px;
        gap: 6px;
        border: 1px solid rgba(207, 220, 235, .96);
        border-radius: 19px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 12px 34px rgba(11, 47, 99, .2);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tab {
        min-height: 58px;
        padding: 7px 5px 6px;
        gap: 4px;
        border: 1px solid transparent;
        border-radius: 14px;
        color: var(--t3-mobile-ink);
        background: transparent;
        font-size: 11px;
        font-weight: 700;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tab-ico {
        min-height: 23px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--t3-mobile-blue);
        font-size: 19px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tab-add {
        background: #f3f7fc;
        border-color: #dde8f3;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tab-add-ico {
        width: auto;
        height: 23px;
        min-height: 23px;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        color: var(--t3-mobile-blue);
        font-size: 20px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tab-cart {
        flex: 1.18;
        background: var(--t3-mobile-blue);
        border-color: var(--t3-mobile-blue);
        color: #fff;
        box-shadow: 0 7px 18px rgba(11, 63, 145, .22);
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tab-cart .tibor3-m-tab-ico {
        color: #fff;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tab-cart:active {
        background: var(--t3-mobile-blue-dark);
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tab.is-open:not(.tibor3-m-tab-cart) {
        border-color: #8eb1dd;
        background: #eaf2fc;
        color: var(--t3-mobile-blue-dark);
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-done {
        min-width: 154px;
        min-height: 50px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        background: var(--t3-mobile-blue);
        box-shadow: 0 10px 28px rgba(11, 63, 145, .28);
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-backdrop {
        background: rgba(8, 34, 73, .48);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-sheet {
        left: 8px;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
        max-height: min(82dvh, 700px);
        border: 1px solid rgba(207, 220, 235, .98);
        border-radius: 22px;
        box-shadow: 0 -4px 40px rgba(8, 34, 73, .24);
        overflow: hidden;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-sheet::before {
        content: "";
        flex: 0 0 auto;
        width: 42px;
        height: 4px;
        margin: 9px auto 0;
        border-radius: 99px;
        background: #c7d4e2;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-sheet-head {
        min-height: 58px;
        padding: 7px 12px 9px 18px;
        border-bottom-color: #e2eaf3;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-sheet-title {
        color: var(--t3-mobile-ink);
        font-size: 18px;
        font-weight: 800;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-sheet-close {
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 1px solid #dce6f0;
        border-radius: 13px;
        background: #f5f8fc;
        color: var(--t3-mobile-blue);
        font-size: 25px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-sheet-body {
        padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
        color: var(--t3-mobile-ink);
        overscroll-behavior: contain;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-addgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-addbtn {
        min-height: 106px;
        padding: 15px 10px;
        border-color: #dbe6f1;
        border-radius: 16px;
        background: #f5f8fc;
        color: var(--t3-mobile-ink);
        font-size: 13px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-addbtn-ico {
        width: 48px;
        height: 48px;
        color: var(--t3-mobile-blue);
        box-shadow: 0 5px 14px rgba(23, 57, 97, .1);
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-addbtn:active {
        border-color: #8eb1dd;
        background: #eaf2fc;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-sheet-body .tibor3-cart-btn {
        min-height: 52px;
        border-radius: 14px;
        background: var(--t3-mobile-blue);
        box-shadow: 0 8px 20px rgba(11, 63, 145, .2);
    }

    .tibor3-cfg[data-mode="mobile"] :is(
        .tibor3-m-topbtn,
        .tibor3-m-colorbtn,
        .tibor3-m-morebtn,
        .tibor3-m-arrow,
        .tibor3-m-dot,
        .tibor3-m-tab,
        .tibor3-m-done,
        .tibor3-m-sheet-close,
        .tibor3-m-addbtn
    ):focus-visible {
        outline: 3px solid rgba(31, 115, 220, .34);
        outline-offset: 2px;
    }
}

@media (max-width: 380px) {
    .tibor3-cfg[data-mode="mobile"] .tibor3-m-topbar {
        padding: 0 9px;
        gap: 6px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-topbtn {
        width: 42px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-colorbtn {
        padding-inline: 12px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tabbar {
        gap: 4px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tab {
        padding-inline: 2px;
        font-size: 10.5px;
    }
}

@media (max-width: 760px) and (max-height: 620px) {
    .tibor3-cfg[data-mode="mobile"] {
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-views {
        margin-block: 4px;
        padding-block: 2px 4px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tabbar {
        min-height: 66px;
    }

    .tibor3-cfg[data-mode="mobile"] .tibor3-m-tab {
        min-height: 52px;
        padding-block: 5px;
    }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
    .tibor3-cfg[data-mode="mobile"] .tibor3-m-dot::after,
    .tibor3-cfg[data-mode="mobile"] .tibor3-m-sheet,
    .tibor3-cfg[data-mode="mobile"] .tibor3-m-backdrop {
        transition: none;
    }
}
