/* WRAPPER + HEADER IDIOMAS */
.iapc-designer-notice {
    margin: 1rem 0;
    padding: 12px 16px;
    border: 1px solid #f0c36d;
    border-radius: 8px;
    background: #fff8e5;
    color: #5c4a1f;
}

.iapc-designer-unavailable {
    max-width: 36rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    background: #fff;
    border: 1px solid #e8ebf0;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.05);
    text-align: left;
    box-sizing: border-box;
}

.iapc-designer-unavailable__title {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    line-height: 1.25;
    color: #111827;
}

.iapc-designer-unavailable__lead {
    margin: 0 0 1rem;
    font-size: 1rem;
    line-height: 1.45;
    color: #374151;
}

.iapc-designer-unavailable__setup {
    margin: 0;
    padding: 1rem;
    border-radius: 14px;
    background: #fff8e5;
    border: 1px solid #f0c36d;
}

.iapc-designer-unavailable__setup-title {
    margin: 0 0 0.5rem;
    color: #5c4a1f;
}

.iapc-designer-unavailable__list {
    margin: 0 0 0.75rem;
    padding-left: 1.2rem;
    color: #5c4a1f;
}

.iapc-designer-unavailable__list li + li {
    margin-top: 0.35rem;
}

.iapc-designer-unavailable__hint {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.4;
    color: #6b7280;
}

.iapc-designer-unavailable__setup .iapc-designer-unavailable__hint {
    color: #5c4a1f;
}

.iapc-designer-wrapper--unavailable {
    padding: 1rem 0.5rem !important;
}

@media (max-width: 700px) {
    .iapc-designer-unavailable {
        max-width: none;
        padding: 1.15rem 1rem;
        border-radius: 16px;
    }

    .iapc-designer-unavailable__title {
        font-size: 1.2rem;
    }
}

/**/
/* PANEL DERECHO */

.iapc-designer-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
}

/* TARJETAS */

.iapc-right-card {
    background: #fff;
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 0 !important;
    border: 1px solid #e8ebf0;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.05);
}

/* BOTONES */

.iapc-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/*Botones Side A y B*/
/* ==========================
   BOTONES SIDE A / SIDE B
========================== */

.iapc-sides {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: stretch;
    align-items: stretch;
    gap: 10px;
    margin-top: 0;
    width: 100%;
}

.iapc-sides.iapc-sides--row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
}

.iapc-designer-sides {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    margin-top: 0;
}

.iapc-sides .iapc-side-btn,
.iapc-designer-center .iapc-side-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    min-height: 48px !important;
}

.iapc-sides-main,
.iapc-sides-additional,
.iapc-additional-sides-toggle,
.iapc-designer-center #iapc_3d_view,
.iapc-designer-center .iapc-3d-btn {
    display: none !important;
}

/* Collapsible disclosure — not a side button */
.iapc-additional-sides-toggle,
.iapc-designer-wrapper .iapc-additional-sides-toggle,
.iapc-designer-wrapper .iapc-additional-sides-toggle:hover,
.iapc-designer-wrapper .iapc-additional-sides-toggle:focus,
.iapc-designer-wrapper .iapc-additional-sides-toggle:active,
.woocommerce .iapc-designer-wrapper .iapc-additional-sides-toggle,
.woocommerce .iapc-designer-wrapper .iapc-additional-sides-toggle:hover,
.woocommerce .iapc-designer-wrapper .iapc-additional-sides-toggle:focus,
.woocommerce .iapc-designer-wrapper .iapc-additional-sides-toggle:active {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 4px 0 0 !important;
    padding: 10px 4px !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-top: 1px solid #e8ebf0 !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #6b7280 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    text-align: left !important;
    text-transform: none !important;
    text-decoration: none !important;
    letter-spacing: 0.01em !important;
    box-shadow: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.iapc-additional-sides-toggle:hover,
.iapc-additional-sides-toggle:focus,
.iapc-designer-wrapper .iapc-additional-sides-toggle:hover,
.iapc-designer-wrapper .iapc-additional-sides-toggle:focus,
.woocommerce .iapc-designer-wrapper .iapc-additional-sides-toggle:hover,
.woocommerce .iapc-designer-wrapper .iapc-additional-sides-toggle:focus {
    background: transparent !important;
    background-color: transparent !important;
    color: #374151 !important;
    border-color: #e8ebf0 !important;
    box-shadow: none !important;
}

.iapc-additional-sides-toggle.iapc-active,
.iapc-designer-wrapper .iapc-additional-sides-toggle.iapc-active,
.woocommerce .iapc-designer-wrapper .iapc-additional-sides-toggle.iapc-active {
    background: transparent !important;
    background-color: transparent !important;
    color: #374151 !important;
    border-color: #e8ebf0 !important;
    box-shadow: none !important;
}

.iapc-additional-sides-toggle .iapc-additional-sides-label {
    flex: 1 1 auto;
    text-align: left;
}

.iapc-additional-sides-toggle .iapc-additional-sides-chevron {
    flex: 0 0 auto;
    width: 0.55em;
    height: 0.55em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
    opacity: 0.7;
}

.iapc-additional-sides-toggle.iapc-active .iapc-additional-sides-chevron,
.iapc-additional-sides-toggle[aria-expanded="true"] .iapc-additional-sides-chevron {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.iapc-sides-additional {
    margin-top: 2px;
    padding-top: 2px;
}

.iapc-product-description-panel {
    width: 100%;
    margin-top: 20px;
    border: 1px solid #e8ebf0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.05);
    overflow: hidden;
}

.iapc-product-description-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    cursor: default;
    list-style: none;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    pointer-events: none;
    border-bottom: 1px solid #e8ebf0;
}

.iapc-product-description-summary::-webkit-details-marker {
    display: none;
}

.iapc-product-description-title {
    flex: 1 1 auto;
}

.iapc-product-description-toggle {
    display: none !important;
}

.iapc-product-description-panel > .iapc-product-description {
    display: block !important;
}

.iapc-product-description-panel .iapc-product-description {
    padding: 16px 18px 18px;
    font-size: 14px;
    line-height: 1.65;
    color: #4b5563;
    text-align: left;
}

.iapc-product-description-panel .iapc-product-description p:last-child {
    margin-bottom: 0;
}

.iapc-side-btn {
    border: 1px solid #d1d5db !important;
    border-radius: var(--iapc-btn-radius, 16px) !important;
    background: #fff !important;
    color: #111 !important;
    padding: 12px 16px !important;
    min-height: 48px;
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    line-height: 1 !important;
    box-shadow: none !important;
    outline: none !important;
    text-align: center !important;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.iapc-side-btn:hover,
.iapc-side-btn:focus {
    background: #f3f4f6 !important;
    color: #111 !important;
    border-color: #9ca3af !important;
    box-shadow: none !important;
    outline: none !important;
}

.iapc-side-btn.iapc-active {
    background: #111 !important;
    color: #fff !important;
    border-color: #111 !important;
    box-shadow: none !important;
}

.iapc-side-btn.iapc-active:hover,
.iapc-side-btn.iapc-active:focus {
    background: #222 !important;
    color: #fff !important;
    border-color: #222 !important;
    box-shadow: none !important;
}

.iapc-designer-left.iapc-view-unavailable {
    opacity: 0.58;
}

.iapc-designer-left.iapc-view-unavailable .iapc-canva-menu button:disabled,
.iapc-designer-left.iapc-view-unavailable .iapc-canva-content :disabled,
.iapc-designer-right .iapc-actions .iapc-btn:disabled {
    cursor: not-allowed !important;
    opacity: 0.55 !important;
}

/* Add to cart usable aunque el lado actual no tenga imagen, si el producto sí es personalizable */
.iapc-price-card:not(.iapc-product-not-customizable),
.iapc-price-card:not(.iapc-product-not-customizable) .iapc-add-to-cart-inside,
.iapc-price-card:not(.iapc-product-not-customizable) .single_add_to_cart_button,
.iapc-price-card:not(.iapc-product-not-customizable) .quantity input,
.iapc-price-card:not(.iapc-product-not-customizable) .iapc-view-cart {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.iapc-price-card.iapc-product-not-customizable .single_add_to_cart_button:disabled,
.iapc-price-card.iapc-product-not-customizable .quantity input:disabled {
    opacity: 0.55 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    background: #9ca3af !important;
}

#iapc_mug_canvas.iapc-canvas-disabled {
    cursor: not-allowed;
}

/* PRECIO */

.iapc-product-price {
    background: #f6f7f9;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 18px;
    text-align: center;
}

.iapc-product-price,
.iapc-product-price .price,
.iapc-product-price .woocommerce-Price-amount {
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}

/* CANTIDAD */

.iapc-add-to-cart-inside .quantity {
    width: 100%;
    margin-bottom: 15px;
}

.iapc-add-to-cart-inside input.qty {
    width: 100%;
    border: 1px solid #dfe3ea;
    border-radius: 14px;
    padding: 12px;
    text-align: center;
}

/* BOTON */

.iapc-add-to-cart-inside .single_add_to_cart_button {
    width: 100%;
    background: #111;
    color: #fff;
    border-radius: 16px;
    padding: 14px;
}

/* VER CARRITO */

.iapc-view-cart {
    display: block;
    width: 100%;
    margin-top: 14px;
    text-align: center;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 14px;
    color: #111;
    text-decoration: none;
    font-weight: 700;
}

.iapc-view-cart:hover {
    background: #f3f4f6;
    color: #111;
    border-color: #9ca3af;
}


.iapc-designer-wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 !important;
    box-sizing: border-box;
    overflow-x: hidden;
    --iapc-brand-purple: #9333ea;
    --iapc-brand-purple-dark: #7c3aed;
    --iapc-brand-purple-light: #a855f7;
    --iapc-brand-purple-soft: #f3e8ff;
    --iapc-brand-purple-ring: rgba(168, 85, 247, 0.24);
    --iapc-btn-radius: 16px;
    accent-color: var(--iapc-brand-purple);
}

.iapc-lang-header {
    margin-bottom: 1.5%;
}

.iapc-lang-header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    background: #fff;
    border-radius: 18px;
    padding: 10px 14px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.07);
}

.iapc-lang-label {
    font-size: 13px;
    font-weight: 800;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.iapc-lang-switch {
    display: flex;
    gap: 8px;
}

.iapc-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 9px 14px;
    border-radius: 12px;
    background: #f1f3f5;
    color: #222;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.iapc-lang-btn:hover {
    background: #e5e7eb;
    color: #111;
}

.iapc-lang-btn.iapc-active {
    background: #111;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.iapc-designer-layout {
    display: grid;
    grid-template-columns: 30fr 52fr 18fr;
    gap: 20px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

/* COLUMNAS */
.iapc-designer-left,
.iapc-designer-center,
.iapc-designer-right {
    min-height: 100%;
}

.iapc-designer-left,
.iapc-designer-center {
    background: #fff;
    border-radius: 24px;
    padding: 14px;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    border: 1px solid #e8ebf0;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.05);
}

.iapc-designer-center {
    height: 100%;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center;
}

.iapc-designer-center .iapc-designer-title {
    flex: 0 0 auto;
}

.iapc-designer-center #iapc_canvas_wrap {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.iapc-designer-center .iapc-sides-card {
    width: 100%;
    max-width: 100%;
    margin-top: auto !important;
    margin-bottom: 0 !important;
    padding: 14px 0 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    flex: 0 0 auto;
}

.iapc-designer-left {
    align-self: stretch;
    height: 100%;
}

.iapc-designer-right {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 100%;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.iapc-designer-left {
    overflow: hidden !important;
}

.iapc-designer-right {
    overflow: hidden;
    min-height: 100%;
}

/* PANEL IZQUIERDO TIPO CANVA */
.iapc-designer-left {
    display: grid !important;
    grid-template-columns: 125px minmax(0, 1fr) !important;
    gap: 16px !important;
    align-items: stretch !important;
}

/* MENÚ LATERAL — tabs estirados a la altura de la columna */
.iapc-canva-menu {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    background: #f6f7f9;
    border-radius: 20px;
    padding: 10px 6px;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
    height: 100%;
    min-height: 100%;
    align-self: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #e8ebf0;
    box-shadow: 0 1px 6px rgba(17, 24, 39, 0.04);
}

.iapc-canva-menu .iapc-canva-tab,
.iapc-canva-menu .iapc-canva-tab-ai {
    flex: 1 1 0;
    min-height: 44px;
    height: auto;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.iapc-canva-content {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    max-width: 100%;
    width: 100%;
    height: auto;
    align-self: start;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    position: relative;
    z-index: 1;
}

.iapc-designer-wrapper .iapc-btn,
.iapc-designer-wrapper .iapc-canva-tab,
.iapc-designer-wrapper summary {
    color: #222 !important;
}

.iapc-designer-wrapper .iapc-side-btn:not(.iapc-active) {
    color: #111 !important;
}

.iapc-designer-wrapper .iapc-canva-tab-ai:not(.iapc-active) {
    color: #7c3aed !important;
}

.iapc-designer-wrapper .iapc-canva-tab.iapc-active,
.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active,
.iapc-designer-wrapper .iapc-side-btn.iapc-active,
.iapc-designer-wrapper #iapc_enable_paint.iapc-paint-tool-active,
.iapc-designer-wrapper #iapc_eraser_paint.iapc-paint-tool-active,
.iapc-designer-wrapper .iapc-preview-btn,
.iapc-designer-wrapper .iapc-ai-choice.iapc-active,
.iapc-designer-wrapper .single_add_to_cart_button {
    color: #fff !important;
}

.iapc-designer-wrapper .iapc-help-text,
.iapc-designer-wrapper .iapc-help-text a {
    color: #777 !important;
}

.iapc-designer-wrapper .iapc-danger {
    color: #d93025 !important;
}


.iapc-canva-tab {
    width: 100%;
    min-height: 0;
    border: 1px solid #dfe3ea !important;
    border-radius: 12px !important;
    background: #fff !important;
    padding: 7px 6px !important;
    font-weight: 800 !important;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    color: #222 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

.iapc-canva-tab-ai {
    width: 100%;
    min-height: 0;
    border: 1px solid #9333ea !important;
    border-radius: 14px !important;
    background: #fff !important;
    padding: 9px 6px !important;
    margin-bottom: 4px;
    font-weight: 800 !important;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    color: #7c3aed !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.iapc-canva-tab:hover {
    background: #f6f7f9 !important;
    border-color: #cfd6e0 !important;
}

.iapc-canva-tab-ai:hover {
    background: #f3e8ff !important;
    border-color: #9333ea !important;
    color: #6d28d9 !important;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.18) !important;
    transform: translateY(-1px);
}

.iapc-canva-tab.iapc-active {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
    color: #fff !important;
    border-color: #9333ea !important;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.38) !important;
}

.iapc-canva-tab-ai.iapc-active {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
    color: #fff !important;
    border-color: #9333ea !important;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.38) !important;
}

.iapc-canva-tab-ai.iapc-active:hover {
    background: linear-gradient(135deg, #b46cff 0%, #8b5cf6 100%) !important;
    color: #fff !important;
    border-color: #9333ea !important;
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.45) !important;
    transform: translateY(-1px);
}

.iapc-canva-tab-ai:disabled,
.iapc-canva-tab:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.iapc-canva-tab-ai:disabled:hover {
    background: #fff !important;
    border-color: #9333ea !important;
    color: #7c3aed !important;
    box-shadow: none !important;
    transform: none;
}

.iapc-canva-tab:disabled:hover {
    background: #fff !important;
    border-color: #dfe3ea !important;
}


/* CONTENIDO PANEL */
.iapc-canva-panel {
    display: none !important;
    background: #fff;
    border: 1px solid #edf0f4;
    border-radius: 22px;
    padding: 12px 14px 14px !important;
    min-height: 0;
    box-sizing: border-box;
    overflow: visible;
    width: 100%;
    max-width: 100%;
}

.iapc-canva-panel .iapc-card-header {
    display: none !important;
}

.iapc-canva-panel.iapc-active {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    border: 1px solid #e8ebf0;
    box-shadow: 0 1px 6px rgba(17, 24, 39, 0.04);
}

.iapc-canva-content .iapc-card.iapc-canva-panel.iapc-active {
    width: 100% !important;
    max-width: 100% !important;
}

/* Todos los paneles: altura del menú, controles compactos arriba */
.iapc-designer-left:has(.iapc-canva-panel.iapc-active) .iapc-canva-content {
    height: 100% !important;
    min-height: 100% !important;
    align-self: stretch !important;
}

.iapc-canva-content .iapc-card.iapc-canva-panel.iapc-active,
.iapc-card.iapc-canva-panel.iapc-active {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 100% !important;
    height: 100% !important;
    align-self: stretch !important;
}

.iapc-canva-panel.iapc-active .iapc-options {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    justify-content: flex-start !important;
    gap: 14px !important;
}

.iapc-canva-panel.iapc-active .iapc-options > * {
    flex: 0 0 auto !important;
}

.iapc-canva-panel.iapc-active .iapc-field {
    justify-content: flex-start !important;
}

.iapc-canva-panel.iapc-active .iapc-fields-2 {
    align-items: stretch !important;
}

.iapc-canva-panel.iapc-active .iapc-fields-2 > .iapc-field {
    justify-content: flex-start !important;
    height: auto !important;
}

.iapc-canva-panel.iapc-active .iapc-inline-checks {
    align-items: center !important;
}

/* Add… / paint actions siempre al fondo del panel */
.iapc-canva-panel.iapc-active .iapc-options > #iapc_add_text,
.iapc-canva-panel.iapc-active .iapc-options > #iapc_add_sticker,
.iapc-canva-panel.iapc-active .iapc-options > #iapc_add_graphic,
.iapc-canva-panel.iapc-active .iapc-options > #iapc_undo_paint {
    flex: 0 0 auto !important;
    margin-top: auto !important;
}

/* Uploaded file name under the native file input (ellipsis + floating tooltip) */
.iapc-file-name {
    display: block;
    margin: 6px 0 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    color: var(--iapc-text, #3f3f3f) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

.iapc-file-name[hidden] {
    display: none !important;
}

.iapc-file-name[data-tooltip] {
    cursor: default;
}

.iapc-tooltip-bubble {
    position: fixed;
    z-index: 100001;
    max-width: min(300px, calc(100vw - 24px));
    padding: 10px 12px;
    border-radius: 10px;
    background: #2b2f36;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-shadow: 0 10px 28px rgba(43, 47, 54, 0.28);
    pointer-events: none;
    animation: iapc-tooltip-in 0.14s ease;
}

@keyframes iapc-tooltip-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide truncated filename next to the native file button; show name only below */
.iapc-designer-wrapper #iapc_image {
    color: transparent !important;
}

.iapc-designer-wrapper #iapc_image::file-selector-button,
.iapc-designer-wrapper #iapc_image::-webkit-file-upload-button {
    color: #111 !important;
    cursor: pointer !important;
}

.iapc-canva-content .iapc-card.iapc-canva-panel {
    margin-bottom: 0 !important;
}

.iapc-canva-panel.iapc-active .iapc-hidden {
    display: none !important;
}

/* Panel padding must win over .iapc-card { padding: 0 } below */
.iapc-card.iapc-canva-panel,
.iapc-tool-card.iapc-canva-panel {
    padding: 12px 14px 14px !important;
    overflow: visible !important;
}

/* TARJETAS INTERNAS */
.iapc-card,
.iapc-tool-card {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin-bottom: 18px !important;
    box-shadow: none !important;
}

.iapc-card h3,
.iapc-tool-card h3 {
    font-size: 20px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    margin: 0 0 18px !important;
    padding-top: 2px !important;
    color: #111 !important;
    overflow: visible !important;
    text-transform: none !important;
}

/* CAMPOS */
.iapc-canva-panel.iapc-active .iapc-options {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 16px !important;
    overflow-y: visible;
}

.iapc-canva-panel.iapc-active .iapc-options>*,
.iapc-canva-panel.iapc-active>.iapc-btn-secondary,
.iapc-canva-panel.iapc-active>.iapc-btn-full {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.iapc-canva-panel.iapc-active .iapc-field,
.iapc-canva-panel.iapc-active .iapc-field-full,
.iapc-canva-panel.iapc-active .iapc-fields-2,
.iapc-canva-panel.iapc-active .iapc-inline-checks {
    width: 100% !important;
    max-width: 100% !important;
}

.iapc-field-full {
    width: 100% !important;
    max-width: 100% !important;
}

.iapc-canva-panel.iapc-active>.iapc-btn-full,
.iapc-canva-panel.iapc-active .iapc-options>.iapc-btn-full:last-child,
.iapc-canva-panel.iapc-active .iapc-options>.iapc-btn:last-child {
    flex-shrink: 0;
}

.iapc-canva-panel.iapc-active>.iapc-btn-secondary {
    flex-shrink: 0;
}

.iapc-options {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 16px !important;
}

.iapc-canva-panel .iapc-field,
.iapc-field {
    gap: 8px !important;
}

.iapc-field {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    min-width: 0;
    margin: .9em 0 !important;
    padding: 0 !important;
}

.iapc-field label,
.iapc-tool-card label {
    display: block !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #222 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
}

.iapc-tool-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
}

/* Textos de UI: no partir palabras ni letras sueltas */
.iapc-designer-wrapper label,
.iapc-designer-wrapper .iapc-canva-tab,
.iapc-designer-wrapper .iapc-canva-tab-ai,
.iapc-designer-wrapper .iapc-card h3,
.iapc-designer-wrapper .iapc-tool-card h3,
.iapc-designer-wrapper .iapc-ai-guided-modal__header h3,
.iapc-designer-wrapper .iapc-side-btn,
.iapc-designer-wrapper .iapc-lang-label {
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
}

.iapc-field input[type="text"],
.iapc-field select,
.iapc-field input[type="file"],
.iapc-tool-card select,
.iapc-tool-card input[type="text"],
.iapc-tool-card input[type="file"],
.iapc-canva-panel input[type="text"],
.iapc-canva-panel input[type="number"],
.iapc-canva-panel input[type="file"],
.iapc-canva-panel select,
.iapc-canva-panel textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    border: 1px solid #dfe3ea !important;
    border-radius: 14px !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    background: #fff !important;
    margin: 0 !important;
}

/* Color picker — show the swatch full-width (not crushed like a text input) */
.iapc-field input[type="color"],
.iapc-canva-panel input[type="color"],
#iapc_color,
#iapc_brush_color,
#iapc_paint_color {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 4px !important;
    box-sizing: border-box !important;
    border: 1px solid #dfe3ea !important;
    border-radius: 14px !important;
    background: #fff !important;
    cursor: pointer !important;
    margin: 0 !important;
}

.iapc-field input[type="color"]::-webkit-color-swatch-wrapper,
.iapc-canva-panel input[type="color"]::-webkit-color-swatch-wrapper,
#iapc_color::-webkit-color-swatch-wrapper,
#iapc_brush_color::-webkit-color-swatch-wrapper,
#iapc_paint_color::-webkit-color-swatch-wrapper {
    padding: 0 !important;
    border-radius: 10px !important;
}

.iapc-field input[type="color"]::-webkit-color-swatch,
.iapc-canva-panel input[type="color"]::-webkit-color-swatch,
#iapc_color::-webkit-color-swatch,
#iapc_brush_color::-webkit-color-swatch,
#iapc_paint_color::-webkit-color-swatch {
    border: none !important;
    border-radius: 10px !important;
}

.iapc-field input[type="color"]::-moz-color-swatch,
.iapc-canva-panel input[type="color"]::-moz-color-swatch,
#iapc_color::-moz-color-swatch,
#iapc_brush_color::-moz-color-swatch,
#iapc_paint_color::-moz-color-swatch {
    border: none !important;
    border-radius: 10px !important;
}

.iapc-field input[type="color"]:focus,
.iapc-canva-panel input[type="color"]:focus,
#iapc_color:focus,
#iapc_brush_color:focus,
#iapc_paint_color:focus {
    outline: none !important;
    border-color: #c4b5fd !important;
    box-shadow: 0 0 0 3px var(--iapc-brand-purple-ring, rgba(168, 85, 247, 0.24)) !important;
}

.iapc-field input[type="text"]:focus,
.iapc-field select:focus,
.iapc-field textarea:focus,
.iapc-tool-card input[type="text"]:focus,
.iapc-tool-card select:focus,
.iapc-tool-card textarea:focus,
.iapc-canva-panel input[type="text"]:focus,
.iapc-canva-panel input[type="number"]:focus,
.iapc-canva-panel select:focus,
.iapc-canva-panel textarea:focus {
    outline: none !important;
    outline-offset: 0 !important;
    border-width: 1px !important;
    border-color: #c4b5fd !important;
    box-shadow: 0 0 0 3px var(--iapc-brand-purple-ring, rgba(168, 85, 247, 0.24)) !important;
}

.iapc-field input[type="range"],
.iapc-tool-card input[type="range"],
.iapc-canva-panel input[type="range"],
.iapc-designer-wrapper input[type="range"] {
    --iapc-range-track-h: 6px;
    --iapc-range-thumb-size: 20px;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: calc((var(--iapc-range-thumb-size, 20px) - var(--iapc-range-track-h, 6px)) / 2) 0 !important;
    display: block !important;
    height: var(--iapc-range-track-h, 6px) !important;
    min-height: var(--iapc-range-track-h, 6px) !important;
    border: 0 !important;
    background: transparent !important;
    accent-color: var(--iapc-brand-purple, #9333ea) !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    --iapc-range-progress: 50%;
}

.iapc-designer-wrapper input[type="range"]::-webkit-slider-runnable-track {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    height: var(--iapc-range-track-h, 6px) !important;
    border: 0 !important;
    border-radius: 999px !important;
    background-color: #e5e7eb !important;
    background-image: linear-gradient(to right,
            #9333ea 0%,
            #9333ea var(--iapc-range-progress, 50%),
            #e5e7eb var(--iapc-range-progress, 50%),
            #e5e7eb 100%) !important;
}

.iapc-field input[type="range"]::-webkit-slider-runnable-track,
.iapc-tool-card input[type="range"]::-webkit-slider-runnable-track,
.iapc-canva-panel input[type="range"]::-webkit-slider-runnable-track,
.woocommerce .iapc-designer-wrapper input[type="range"]::-webkit-slider-runnable-track {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    height: var(--iapc-range-track-h, 6px) !important;
    border: 0 !important;
    border-radius: 999px !important;
    background-color: #e5e7eb !important;
}

.iapc-designer-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    width: var(--iapc-range-thumb-size, 20px) !important;
    height: var(--iapc-range-thumb-size, 20px) !important;
    /* Center thumb on 6px track inside padded control */
    margin-top: calc((var(--iapc-range-track-h, 6px) - var(--iapc-range-thumb-size, 20px)) / 2) !important;
    border-radius: 50% !important;
    background: var(--iapc-brand-purple, #9333ea) !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35) !important;
    cursor: pointer !important;
}

.iapc-designer-wrapper input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35), 0 0 0 3px var(--iapc-brand-purple-ring, rgba(168, 85, 247, 0.24)) !important;
}

.iapc-designer-wrapper input[type="range"]:hover::-webkit-slider-thumb {
    background: var(--iapc-brand-purple-light, #a855f7) !important;
}

.iapc-designer-wrapper input[type="range"]::-moz-range-track {
    width: 100% !important;
    height: var(--iapc-range-track-h, 6px) !important;
    border-radius: 999px !important;
    background: #e5e7eb !important;
    border: 0 !important;
}

.iapc-designer-wrapper input[type="range"]::-moz-range-progress {
    height: var(--iapc-range-track-h, 6px) !important;
    border-radius: 999px !important;
    background: var(--iapc-brand-purple, #9333ea) !important;
}

.iapc-designer-wrapper input[type="range"]::-moz-range-thumb {
    box-sizing: border-box !important;
    width: var(--iapc-range-thumb-size, 20px) !important;
    height: var(--iapc-range-thumb-size, 20px) !important;
    border: 2px solid #fff !important;
    border-radius: 50% !important;
    background: var(--iapc-brand-purple, #9333ea) !important;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35) !important;
    cursor: pointer !important;
}

.iapc-designer-wrapper input[type="range"]:hover::-moz-range-thumb {
    background: var(--iapc-brand-purple-light, #a855f7) !important;
}

.iapc-designer-wrapper input[type="checkbox"],
.iapc-designer-wrapper input[type="radio"] {
    accent-color: var(--iapc-brand-purple, #9333ea) !important;
}

/* DOS COLUMNAS */
.iapc-fields-2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    min-width: 0;
    margin: 0 !important;
    flex-shrink: 0;
    align-items: stretch;
}

.iapc-field,
.iapc-fields-2>.iapc-field {
    min-width: 0;
}

.iapc-fields-2>.iapc-field {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start;
    height: auto;
}

/* CHECKBOXES */
.iapc-switch,
.iapc-inline-checks label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.iapc-inline-checks {
    display: flex !important;
    gap: 16px !important;
    margin: 0 !important;
    flex-shrink: 0;
    width: 100% !important;
    max-width: 100% !important;
    justify-content: flex-start;
    align-items: center;
}

.iapc-canva-panel .iapc-fields-2 {
    gap: 10px !important;
}

.iapc-options>.iapc-btn,
.iapc-options>.iapc-btn-secondary,
.iapc-options>button,
.iapc-canva-panel.iapc-active>.iapc-btn-secondary,
.iapc-canva-panel.iapc-active>button {
    margin: 0 !important;
}

/* BOTONES */
.iapc-btn,
#iapc_enable_paint,
#iapc_eraser_paint,
#iapc_undo_paint,
#iapc_clear_paint,
#iapc_add_sticker {
    border: 0 !important;
    border-radius: var(--iapc-btn-radius, 16px) !important;
    background: #f1f3f5 !important;
    padding: 11px 14px !important;
    cursor: pointer !important;
    font-weight: 800 !important;
    color: #222 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    text-align: center !important;
}

.iapc-btn-full {
    width: 100% !important;
    display: block !important;
    flex-shrink: 0;
}

#iapc_enable_paint.iapc-paint-tool-active,
#iapc_eraser_paint.iapc-paint-tool-active,
.iapc-preview-btn {
    background: #111 !important;
    color: #fff !important;
}

#iapc_enable_paint:not(.iapc-paint-tool-active),
#iapc_eraser_paint:not(.iapc-paint-tool-active) {
    background: #f1f3f5 !important;
    color: #222 !important;
}

#iapc_clear_paint,
#iapc_undo_paint,
#iapc_add_sticker {
    width: 100% !important;
    margin-top: 10px !important;
}

.iapc-btn:hover,
#iapc_clear_paint:hover,
#iapc_undo_paint:hover,
#iapc_add_sticker:hover {
    color: #111 !important;
}

/*imagen destacada miniatura*/
.iapc-ai-thumb-active {
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35) !important;
}


/* Reset botones WooCommerce/tema — no aplica dentro del personalizador */
.woocommerce:not(.iapc-designer-wrapper) form.cart .button,
.woocommerce:not(.iapc-designer-wrapper) .single_add_to_cart_button {
    background-color: transparent;
    border: 1px solid transparent !important;
    border-radius: 3px;
    color: #c36;
    display: inline-block;
    font-size: 1rem;
    font-weight: 400;
    padding: .5rem 1rem;
    text-align: center;
    transition: all .3s;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    white-space: nowrap;
}

/*boton 3d*/
#iapc_3d_view:disabled,
.iapc-3d-btn--disabled {
    opacity: 0.45;
    cursor: not-allowed !important;
}

.iapc-ai-guided-modal {
    position: fixed;
    inset: 0;
    z-index: 100150;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.iapc-ai-guided-modal.is-open {
    display: flex;
}

.iapc-ai-guided-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    border: 0;
    cursor: pointer;
}

.iapc-ai-guided-modal__dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: min(85vh, 720px);
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.iapc-ai-guided-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #dfe3ea;
    background: transparent;
    flex-shrink: 0;
}

.iapc-ai-guided-modal__header h3 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    color: #111 !important;
}

.iapc-ai-guided-modal__header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.iapc-ai-guided-modal__clear-filters,
#iapc_ai_guided_modal .iapc-ai-guided-modal__clear-filters,
#iapc_ai_guided_modal #iapc_clear_guided,
body .iapc-ai-guided-modal .iapc-ai-guided-modal__clear-filters,
body .iapc-ai-guided-modal #iapc_clear_guided {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #000 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
}

.iapc-ai-guided-modal__clear-filters:hover,
.iapc-ai-guided-modal__clear-filters:focus,
.iapc-ai-guided-modal__clear-filters:active,
#iapc_ai_guided_modal .iapc-ai-guided-modal__clear-filters:hover,
#iapc_ai_guided_modal .iapc-ai-guided-modal__clear-filters:focus,
#iapc_ai_guided_modal .iapc-ai-guided-modal__clear-filters:active,
#iapc_ai_guided_modal #iapc_clear_guided:hover,
#iapc_ai_guided_modal #iapc_clear_guided:focus,
#iapc_ai_guided_modal #iapc_clear_guided:active,
body .iapc-ai-guided-modal .iapc-ai-guided-modal__clear-filters:hover,
body .iapc-ai-guided-modal .iapc-ai-guided-modal__clear-filters:focus,
body .iapc-ai-guided-modal .iapc-ai-guided-modal__clear-filters:active {
    color: #000 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.iapc-ai-guided-modal__close,
#iapc_ai_guided_modal .iapc-ai-guided-modal__close,
body .iapc-ai-guided-modal .iapc-ai-guided-modal__close {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #000 !important;
    font-size: 28px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    flex-shrink: 0;
}

.iapc-ai-guided-modal__close:hover,
.iapc-ai-guided-modal__close:focus,
.iapc-ai-guided-modal__close:active,
#iapc_ai_guided_modal .iapc-ai-guided-modal__close:hover,
#iapc_ai_guided_modal .iapc-ai-guided-modal__close:focus,
#iapc_ai_guided_modal .iapc-ai-guided-modal__close:active,
body .iapc-ai-guided-modal .iapc-ai-guided-modal__close:hover,
body .iapc-ai-guided-modal .iapc-ai-guided-modal__close:focus,
body .iapc-ai-guided-modal .iapc-ai-guided-modal__close:active {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #000 !important;
    opacity: 0.55 !important;
    outline: none !important;
}

.iapc-ai-guided-modal__body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.iapc-ai-guided-modal__body .iapc-field {
    gap: 10px !important;
    margin: 0 !important;
}

.iapc-ai-guided-modal__body .iapc-field label {
    font-weight: 400 !important;
    margin-bottom: 2px !important;
}

.iapc-ai-guided-modal__body .iapc-ai-guided-buttons {
    gap: 12px;
    margin: 0 !important;
}

.iapc-ai-guided-modal__body #iapc_design_for_me {
    margin-top: 4px;
    border: 0 !important;
    border-radius: var(--iapc-btn-radius, 16px) !important;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
    color: #fff !important;
    min-height: 52px !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.38) !important;
    transition: background 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.iapc-ai-guided-modal__body #iapc_design_for_me:hover,
.iapc-ai-guided-modal__body #iapc_design_for_me:focus {
    background: linear-gradient(135deg, #b46cff 0%, #8b5cf6 100%) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.45) !important;
}

.iapc-ai-guided-modal__body #iapc_design_for_me:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.iapc-ai-guided-modal__body .iapc-ai-actions {
    margin-top: 6px;
    gap: 12px;
}

body.iapc-guided-modal-open {
    overflow: hidden;
}

/* CENTRO */
.iapc-designer-title {
    text-align: center;
    font-size: 42px;
    font-weight: 900;
    margin: 0 0 4%;
    line-height: 1.15;
    word-break: break-word;
    color: #111;
}

#iapc_canvas_wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    perspective: 1400px;
    transform-style: preserve-3d;
}

#iapc_canvas_wrap.iapc-side-flip-forward,
#iapc_canvas_wrap.iapc-side-flip-back {
    animation-duration: 0.58s;
    animation-timing-function: cubic-bezier(0.33, 0.1, 0.25, 1);
    animation-fill-mode: both;
}

#iapc_canvas_wrap.iapc-side-flip-forward {
    animation-name: iapc-side-flip-forward;
}

#iapc_canvas_wrap.iapc-side-flip-back {
    animation-name: iapc-side-flip-back;
}

@keyframes iapc-side-flip-forward {
    0% {
        transform: rotateY(0deg) scale(1);
    }
    38% {
        transform: rotateY(-72deg) scale(0.985);
    }
    48% {
        transform: rotateY(-88deg) scale(0.975);
    }
    52% {
        transform: rotateY(88deg) scale(0.975);
    }
    68% {
        transform: rotateY(38deg) scale(0.99);
    }
    100% {
        transform: rotateY(0deg) scale(1);
    }
}

@keyframes iapc-side-flip-back {
    0% {
        transform: rotateY(0deg) scale(1);
    }
    38% {
        transform: rotateY(72deg) scale(0.985);
    }
    48% {
        transform: rotateY(88deg) scale(0.975);
    }
    52% {
        transform: rotateY(-88deg) scale(0.975);
    }
    68% {
        transform: rotateY(-38deg) scale(0.99);
    }
    100% {
        transform: rotateY(0deg) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    #iapc_canvas_wrap.iapc-side-flip-forward,
    #iapc_canvas_wrap.iapc-side-flip-back {
        animation: none !important;
    }
}

#iapc_mug_canvas {
    width: 100%;
    height: auto;
    display: block;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.iapc-canvas-fs-toggle,
.iapc-canvas-fs-exit {
    display: none !important;
}

.iapc-canvas-loading {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: none;
}

.iapc-canvas-loading.iapc-hidden {
    display: none !important;
}

.iapc-canvas-loading__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.12);
}

.iapc-canvas-loading__spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2.5px solid #e5e7eb;
    border-top-color: #111;
    animation: iapc-canvas-spin 0.75s linear infinite;
}

.iapc-canvas-loading__text {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    line-height: 1.3;
}

@keyframes iapc-canvas-spin {
    to {
        transform: rotate(360deg);
    }
}



/* PANEL DERECHO */
.iapc-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* TEXTOS AYUDA */
.iapc-panel-intro {
    font-size: 12px !important;
    font-style: italic !important;
    font-weight: 400 !important;
    color: #6b7280 !important;
    line-height: 1.4 !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
}

.iapc-canva-panel > .iapc-panel-intro {
    margin: 0 0 12px !important;
}

.iapc-help-text {
    font-size: 12px !important;
    font-style: italic !important;
    color: #777 !important;
    margin: 0 !important;
}

.iapc-canva-panel .iapc-help-text {
    margin-top: 6px !important;
}

.iapc-canva-panel .iapc-panel-divider {
    margin: 10px 0 !important;
}

.iapc-panel-divider {
    margin: 18px 0 !important;
    border: 0;
    border-top: 1px solid #eee;
}

.iapc-hidden {
    display: none !important;
}

/*carrito y precio*/
/* PANEL DERECHO */
.iapc-designer-right .iapc-buy-box {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    margin-top: 24px !important;
}

/* PRECIO */
.iapc-designer-right .iapc-product-price {
    background: #f2f2f2 !important;
    border-radius: 16px !important;
    text-align: center !important;
    margin-bottom: 0 !important;
}

.iapc-designer-right .iapc-product-price,
.iapc-designer-right .iapc-product-price .price,
.iapc-designer-right .iapc-product-price .woocommerce-Price-amount {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #111 !important;
    line-height: 1 !important;
}

/* FORMULARIO ADD TO CART */
.iapc-designer-right .iapc-add-to-cart-inside form.cart {
    margin: 0 !important;
}

.iapc-designer-right .iapc-add-to-cart-inside .quantity {
    width: 100% !important;
    margin: 0 !important;
}

.iapc-designer-right .iapc-add-to-cart-inside input.qty {
    width: 100% !important;
    max-width: 100% !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 16px !important;
    text-align: center !important;
    font-weight: 800 !important;
    font-size: 16px !important;
}

/* BOTÓN AÑADIR AL CARRITO */
.iapc-designer-right .iapc-add-to-cart-inside .single_add_to_cart_button {
    width: 100% !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: #111 !important;
    color: #fff !important;
    font-weight: 800 !important;
    font-size: 15px !important;
    text-transform: uppercase !important;
}

/* VER CARRITO */
.iapc-designer-right .iapc-view-cart {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    text-align: center !important;
    border-radius: 16px !important;
    background: #fff !important;
    border: 1px solid #d1d5db !important;
    color: #111 !important;
    text-decoration: none !important;
    font-weight: 800 !important;
    font-size: 15px !important;
    text-transform: uppercase !important;
}

.iapc-designer-right .iapc-view-cart:hover {
    background: #f3f4f6 !important;
    color: #111 !important;
    border-color: #9ca3af !important;
}


/* =========================
   IA + IA GUIADA
========================= */

.iapc-ai-history {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0 !important;
}

.iapc-ai-thumb {
    padding: 0;
    border: 1px solid #dfe3ea;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: all .18s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .04);
}

.iapc-ai-thumb:hover {
    border-color: #dfe3ea;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .08);
}

.iapc-ai-thumb img {
    width: 100%;
    height: 74px;
    object-fit: cover;
    display: block;
}

#iapc_generate_ai,
#iapc_regenerate_ai,
#iapc_clear_ai,
#iapc_remove_ai_image {
    margin: 0 !important;
}

/* Botones de opciones IA guiada */
.iapc-ai-guided-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 !important;
}

.iapc-ai-guided-modal__body .iapc-ai-guided-buttons {
    gap: 12px;
    margin: 0 !important;
}

.iapc-ai-choice {
    border: 1px solid #dfe3ea !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: #222 !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    text-align: center !important;
    transition: all .18s ease !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .04) !important;
}

.iapc-ai-choice:hover {
    border-color: #dfe3ea !important;
    transform: translateY(-1px);
}

.iapc-ai-choice.iapc-active {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
    color: #fff !important;
    border-color: #9333ea !important;
}

.iapc-ai-choice.iapc-active::after {
    content: " ✓";
    font-weight: 900;
}

/* Acciones inferiores IA guiada */
.iapc-ai-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.iapc-ai-actions button {
    flex: 1;
}

.iapc-ai-actions.iapc-hidden {
    display: none !important;
}

.iapc-btn-secondary {
    background: #fff !important;
    color: #222 !important;
    border: 1px solid #dfe3ea !important;
    border-radius: 14px !important;
    padding: 11px 14px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    transition: all .18s ease !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .04) !important;
}

.iapc-btn-secondary:hover {
    border-color: #dfe3ea !important;
    transform: translateY(-1px);
}

.iapc-panel-subtitle {
    margin: 0 0 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #222 !important;
}

.iapc-image-edit-options,
.iapc-ai-image-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.iapc-ai-adjust-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    transition: opacity 0.18s ease;
}

.iapc-ai-adjust-block.iapc-controls-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.iapc-ai-adjust-block.iapc-controls-disabled input,
.iapc-ai-adjust-block.iapc-controls-disabled select {
    cursor: not-allowed !important;
}

/* RESPONSIVE — apilar secciones y liberar alturas (mobile usable) */
@media (max-width: 1100px) {
    .iapc-designer-wrapper .iapc-designer-layout {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .iapc-designer-wrapper .iapc-designer-center {
        order: 1;
        height: auto !important;
        min-height: 0 !important;
    }

    .iapc-designer-wrapper .iapc-designer-left {
        order: 2;
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        gap: 12px !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .iapc-designer-wrapper .iapc-designer-right {
        order: 3;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .iapc-designer-wrapper .iapc-canva-menu {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        gap: 8px !important;
        padding: 10px !important;
    }

    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab,
    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab-ai {
        flex: 1 1 calc(33.333% - 8px) !important;
        min-width: 96px !important;
        min-height: 44px !important;
        height: auto !important;
    }

    .iapc-designer-wrapper .iapc-canva-content,
    .iapc-designer-wrapper .iapc-designer-left:has(.iapc-canva-panel.iapc-active) .iapc-canva-content,
    .iapc-designer-wrapper .iapc-canva-content .iapc-card.iapc-canva-panel.iapc-active,
    .iapc-designer-wrapper .iapc-card.iapc-canva-panel.iapc-active,
    .iapc-designer-wrapper .iapc-canva-panel.iapc-active,
    .iapc-designer-wrapper .iapc-canva-panel.iapc-active .iapc-options {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        flex: 0 0 auto !important;
        align-self: stretch !important;
    }

    .iapc-designer-wrapper .iapc-canva-panel.iapc-active .iapc-options > #iapc_add_text,
    .iapc-designer-wrapper .iapc-canva-panel.iapc-active .iapc-options > #iapc_add_sticker,
    .iapc-designer-wrapper .iapc-canva-panel.iapc-active .iapc-options > #iapc_add_graphic,
    .iapc-designer-wrapper .iapc-canva-panel.iapc-active .iapc-options > #iapc_undo_paint {
        margin-top: 8px !important;
    }

    .iapc-designer-wrapper .iapc-price-card {
        overflow: visible !important;
        margin-top: 0 !important;
    }

    .iapc-designer-wrapper .iapc-btn,
    .iapc-designer-wrapper .iapc-btn-full,
    .iapc-designer-wrapper #iapc_generate_ai,
    .iapc-designer-wrapper #iapc_open_guided_ai,
    .iapc-designer-wrapper .single_add_to_cart_button {
        display: block !important;
        visibility: visible !important;
        pointer-events: auto !important;
        min-height: 48px !important;
        height: auto !important;
        white-space: normal !important;
    }

    .iapc-designer-wrapper .iapc-fields-2 {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 700px) {
    .iapc-lang-header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .iapc-lang-switch {
        width: 100%;
    }

    .iapc-lang-btn {
        flex: 1;
    }

    .iapc-designer-wrapper {
        padding: 0;
    }

    .iapc-designer-wrapper .iapc-designer-left,
    .iapc-designer-wrapper .iapc-designer-center,
    .iapc-designer-wrapper .iapc-designer-right {
        margin-bottom: 0;
        padding: 0;
    }

    .iapc-designer-title {
        font-size: 28px;
    }

    .iapc-canva-panel {
        padding: 10px !important;
    }

    .iapc-card h3,
    .iapc-tool-card h3 {
        font-size: 18px !important;
    }

    .iapc-help-text {
        word-break: normal !important;
        overflow-wrap: break-word;
    }

    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab,
    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab-ai {
        flex: 1 1 calc(50% - 8px) !important;
        font-size: 13px !important;
    }
}

/* TOASTS / NOTIFICACIONES */
.iapc-toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.iapc-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e8ebf0;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14);
    box-sizing: border-box;
    pointer-events: auto;
    opacity: 0;
    transform: translate3d(18px, -6px, 0) scale(0.96);
    transition:
        opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.38s ease;
    will-change: opacity, transform;
}

.iapc-toast--visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
}

.iapc-toast--hide {
    opacity: 0;
    transform: translate3d(12px, -4px, 0) scale(0.98);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

@media (prefers-reduced-motion: reduce) {
    .iapc-toast {
        transform: none;
        transition: opacity 0.2s ease;
    }

    .iapc-toast--visible,
    .iapc-toast--hide {
        transform: none;
    }
}

.iapc-toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}

.iapc-toast--success .iapc-toast-icon {
    background: #e8f7ee;
    color: #137333;
}

.iapc-toast--error .iapc-toast-icon {
    background: #fdecea;
    color: #c5221f;
}

.iapc-toast--warning .iapc-toast-icon {
    background: #fff4e5;
    color: #b06000;
}

.iapc-toast--info .iapc-toast-icon {
    background: #f3e8ff;
    color: #7c3aed;
}

.iapc-toast-text {
    flex: 1;
    margin: 0 !important;
    padding: 4px 0 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;
    color: #111 !important;
}

.iapc-toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: #444 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
}

.iapc-toast-close:hover {
    background: transparent !important;
    color: #111 !important;
}

#iapc_3d_status:empty {
    display: none !important;
}


/* ==========================
   PAINT - MÁS ESPACIO
========================== */

#iapc_enable_paint,
#iapc_eraser_paint,
#iapc_undo_paint,
#iapc_clear_paint {
    width: 100%;
    margin: 0 !important;
    padding: 16px 20px !important;
    border-radius: 16px !important;
}

#iapc_enable_paint {
    margin-bottom: 0 !important;
}

.iapc-paint-mode-row {
    gap: 10px !important;
}

.iapc-paint-mode-row > button,
.iapc-designer-wrapper .iapc-paint-mode-row > #iapc_enable_paint,
.iapc-designer-wrapper .iapc-paint-mode-row > #iapc_eraser_paint {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: normal !important;
    line-height: 1.25 !important;
}

/* Separación de controles sueltos en panel Pintar (sin .iapc-field) */

.iapc-paint-panel>*:not(h3):not(.iapc-card-header),
.iapc-canva-panel>*:not(h3):not(.iapc-card-header) {
    margin-bottom: 0 !important;
}

#iapc_brush_color,
#iapc_brush_size,
#iapc_brush_opacity,
#iapc_paint_color,
#iapc_paint_size {
    margin: 0 !important;
}

/* ==========================
   PANEL DERECHO EN 2 CARDS
========================== */

.iapc-designer-right {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    height: 100%;
    min-height: 100%;

    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.iapc-designer-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.iapc-right-card {
    background: #fff;
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 0 !important;
    border: 1px solid #e8ebf0;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.05);
}


.iapc-actions-card {
    padding: 18px !important;
}

.iapc-price-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    padding: 18px !important;
    margin-top: auto;
}

/* Bloque compra: precio, cantidad y botones del mismo tamaño */
.iapc-price-card .iapc-product-price,
.iapc-price-card .quantity,
.iapc-price-card .single_add_to_cart_button,
.iapc-designer-wrapper .iapc-price-card .single_add_to_cart_button,
.iapc-price-card .iapc-view-cart {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    border-radius: var(--iapc-btn-radius, 16px) !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    float: none !important;
}

/* Precio */

.iapc-price-card .iapc-product-price {
    background: #f2f2f2 !important;
    color: #111 !important;
}

.iapc-price-card .iapc-product-price,
.iapc-price-card .iapc-product-price .price,
.iapc-price-card .iapc-product-price .woocommerce-Price-amount,
.iapc-price-card .iapc-product-price .woocommerce-Price-amount bdi {
    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    margin: 0 !important;
}

.iapc-price-card .iapc-add-to-cart-inside {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Formulario WooCommerce dentro del personalizador */
.iapc-price-card .iapc-add-to-cart-inside form.cart,
.iapc-designer-wrapper .iapc-price-card form.cart {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    float: none !important;
}

/* Cantidad */

.iapc-price-card .quantity,
.iapc-designer-wrapper .iapc-price-card .quantity,
.iapc-designer-wrapper .iapc-price-card form.cart .quantity,
.woocommerce .iapc-designer-wrapper .iapc-price-card .quantity {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
    align-self: stretch !important;
    flex: 0 0 auto !important;
}

.iapc-price-card input.qty,
.iapc-price-card .quantity input.qty,
.iapc-price-card .quantity input[type="number"],
.iapc-designer-wrapper .iapc-price-card input.qty,
.iapc-designer-wrapper .iapc-price-card .quantity input.qty,
.iapc-designer-wrapper .iapc-price-card .quantity input[type="number"],
.iapc-designer-wrapper .iapc-price-card form.cart input.qty,
.iapc-designer-wrapper .iapc-price-card form.cart .quantity input.qty,
.iapc-designer-wrapper .iapc-price-card form.cart .quantity input[type="number"],
.woocommerce .iapc-designer-wrapper .iapc-price-card input.qty,
.woocommerce .iapc-designer-wrapper .iapc-price-card .quantity input.qty,
.woocommerce .iapc-designer-wrapper .iapc-price-card .quantity input[type="number"] {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: var(--iapc-btn-radius, 16px) !important;
    background: #fff !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    box-sizing: border-box !important;
    float: none !important;
    align-self: stretch !important;
}

/* Botón comprar (WooCommerce) */

.iapc-price-card .single_add_to_cart_button,
.iapc-designer-wrapper .iapc-price-card .single_add_to_cart_button {
    border: 0 !important;
    background: #111 !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
}

/* Ver carrito */

.iapc-price-card .iapc-view-cart {
    background: #fff !important;
    border: 1px solid #d1d5db !important;
    color: #111 !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
}

.iapc-price-card .iapc-view-cart:hover {
    background: #f3f4f6 !important;
    color: #111 !important;
    border-color: #9ca3af !important;
}

.iapc-card-actions {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.iapc-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

.iapc-actions .iapc-btn {
    width: 100% !important;
    min-height: 52px !important;
    border-radius: var(--iapc-btn-radius, 16px) !important;
    text-transform: uppercase;
}

.iapc-price-card .single_add_to_cart_button,
.iapc-designer-wrapper .iapc-price-card .single_add_to_cart_button,
.iapc-price-card .iapc-view-cart {
    text-transform: uppercase;
}

/* Anti-reset tema — Side buttons neutros */
.iapc-designer-wrapper .iapc-side-btn,
.iapc-designer-wrapper .iapc-side-btn:active,
.woocommerce .iapc-designer-wrapper .iapc-side-btn,
.woocommerce .iapc-designer-wrapper .iapc-side-btn:active {
    background-color: #fff !important;
    background: #fff !important;
    color: #111 !important;
    border: 1px solid #d1d5db !important;
    border-radius: var(--iapc-btn-radius, 16px) !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.iapc-designer-wrapper .iapc-side-btn:hover,
.iapc-designer-wrapper .iapc-side-btn:focus,
.woocommerce .iapc-designer-wrapper .iapc-side-btn:hover,
.woocommerce .iapc-designer-wrapper .iapc-side-btn:focus {
    background-color: #f3f4f6 !important;
    background: #f3f4f6 !important;
    color: #111 !important;
    border-color: #9ca3af !important;
    box-shadow: none !important;
}

.iapc-designer-wrapper .iapc-side-btn.iapc-active,
.iapc-designer-wrapper .iapc-side-btn.iapc-active:active,
.woocommerce .iapc-designer-wrapper .iapc-side-btn.iapc-active,
.woocommerce .iapc-designer-wrapper .iapc-side-btn.iapc-active:active {
    background: #111 !important;
    background-color: #111 !important;
    color: #fff !important;
    border-color: #111 !important;
    box-shadow: none !important;
}

.iapc-designer-wrapper .iapc-side-btn.iapc-active:hover,
.iapc-designer-wrapper .iapc-side-btn.iapc-active:focus,
.woocommerce .iapc-designer-wrapper .iapc-side-btn.iapc-active:hover,
.woocommerce .iapc-designer-wrapper .iapc-side-btn.iapc-active:focus {
    background: #222 !important;
    background-color: #222 !important;
    color: #fff !important;
    border-color: #222 !important;
    box-shadow: none !important;
}

.iapc-designer-wrapper .iapc-btn,
.iapc-designer-wrapper .iapc-btn:hover,
.iapc-designer-wrapper .iapc-btn:focus,
.iapc-designer-wrapper .iapc-btn:active {
    background-color: #f1f3f5 !important;
    background: #f1f3f5 !important;
    color: #222 !important;
    border: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.iapc-designer-wrapper .iapc-btn:hover,
.iapc-designer-wrapper .iapc-btn:focus {
    background-color: #e5e7eb !important;
    background: #e5e7eb !important;
    color: #111 !important;
}

.iapc-designer-wrapper .iapc-lang-btn,
.iapc-designer-wrapper .iapc-lang-btn:hover,
.iapc-designer-wrapper .iapc-lang-btn:focus,
.iapc-designer-wrapper .iapc-lang-btn:active {
    background-color: #f1f3f5 !important;
    background: #f1f3f5 !important;
    color: #222 !important;
    text-decoration: none !important;
}

.iapc-designer-wrapper .iapc-lang-btn:hover,
.iapc-designer-wrapper .iapc-lang-btn:focus {
    background-color: #e5e7eb !important;
    background: #e5e7eb !important;
    color: #111 !important;
}

.iapc-designer-wrapper .iapc-lang-btn.iapc-active,
.iapc-designer-wrapper .iapc-lang-btn.iapc-active:hover,
.iapc-designer-wrapper .iapc-lang-btn.iapc-active:focus,
.iapc-designer-wrapper .iapc-lang-btn.iapc-active:active {
    background-color: #111 !important;
    background: #111 !important;
    color: #fff !important;
}

.iapc-designer-wrapper .iapc-canva-tab:hover,
.iapc-designer-wrapper .iapc-canva-tab:focus,
.iapc-designer-wrapper .iapc-canva-tab:active {
    background-color: #f6f7f9 !important;
    background: #f6f7f9 !important;
    color: #222 !important;
    border-color: #cfd6e0 !important;
}

.iapc-designer-wrapper .iapc-canva-tab-ai:not(.iapc-active),
.iapc-designer-wrapper .iapc-canva-tab-ai:not(.iapc-active):hover,
.iapc-designer-wrapper .iapc-canva-tab-ai:not(.iapc-active):focus,
.iapc-designer-wrapper .iapc-canva-tab-ai:not(.iapc-active):active {
    background-color: #fff !important;
    background: #fff !important;
    color: #7c3aed !important;
    border: 1px solid #9333ea !important;
    box-shadow: none !important;
}

.iapc-designer-wrapper .iapc-canva-tab-ai:not(.iapc-active):hover,
.iapc-designer-wrapper .iapc-canva-tab-ai:not(.iapc-active):focus {
    background-color: #f3e8ff !important;
    background: #f3e8ff !important;
    color: #6d28d9 !important;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.18) !important;
}

.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active,
.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active:hover,
.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active:focus,
.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active:active {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
    color: #fff !important;
    border-color: #9333ea !important;
}

.iapc-designer-wrapper .iapc-canva-tab.iapc-active,
.iapc-designer-wrapper .iapc-canva-tab.iapc-active:hover,
.iapc-designer-wrapper .iapc-canva-tab.iapc-active:focus,
.iapc-designer-wrapper .iapc-canva-tab.iapc-active:active {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
    background-color: #7c3aed !important;
    color: #fff !important;
    border-color: #9333ea !important;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.38) !important;
}

.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active:hover,
.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active:focus {
    background: linear-gradient(135deg, #b46cff 0%, #8b5cf6 100%) !important;
    color: #fff !important;
    border-color: #9333ea !important;
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.45) !important;
}

/* Integración ficha producto — temas clásicos y de bloques (Twenty Twenty-Five, etc.) */
body.iapc-product-page-integration .woocommerce-product-gallery,
body.iapc-product-page-integration .wp-block-woocommerce-product-image-gallery,
body.iapc-product-page-integration .woocommerce-tabs,
body.iapc-product-page-integration .related.products,
body.iapc-product-page-integration .upsells,
body.iapc-product-page-integration .wp-block-post-title,
body.iapc-product-page-integration .wp-block-woocommerce-product-price,
body.iapc-product-page-integration .wp-block-add-to-cart-form,
body.iapc-product-page-integration .wc-block-add-to-cart-form,
body.iapc-product-page-integration .wp-block-post-excerpt,
body.iapc-product-page-integration .wp-block-woocommerce-product-meta,
body.iapc-product-page-integration .wp-block-woocommerce-product-details,
body.iapc-product-page-integration .wp-block-woocommerce-product-collection {
    display: none !important;
}

body.iapc-product-page-integration .iapc-product-page-designer-root {
    width: 100%;
    max-width: var(--wp--style--global--wide-size, 1280px);
    margin: 0 auto 2rem;
    padding: 0;
    box-sizing: border-box;
}

body.iapc-product-page-integration .iapc-designer-wrapper {
    width: 100%;
    max-width: 100%;
}

body.iapc-product-page-integration .iapc-designer-layout {
    min-width: 0;
}

body.iapc-product-page-integration .iapc-designer-left,
body.iapc-product-page-integration .iapc-designer-center,
body.iapc-product-page-integration .iapc-designer-right {
    min-width: 0;
}

body.iapc-product-page-integration .iapc-designer-wrapper .iapc-btn,
body.iapc-product-page-integration .iapc-designer-wrapper .iapc-side-btn,
body.iapc-product-page-integration .iapc-designer-wrapper .iapc-canva-tab,
body.iapc-product-page-integration .iapc-designer-wrapper .iapc-canva-tab-ai {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    word-break: normal !important;
    letter-spacing: normal !important;
}

body.iapc-product-page-integration .iapc-designer-wrapper .iapc-canva-tab,
body.iapc-product-page-integration .iapc-designer-wrapper .iapc-canva-tab-ai,
body.iapc-product-page-integration .iapc-designer-wrapper .iapc-side-btn {
    white-space: nowrap !important;
}

body.iapc-product-page-integration .iapc-designer-wrapper .iapc-field label,
body.iapc-product-page-integration .iapc-designer-wrapper .iapc-tool-card label,
body.iapc-product-page-integration .iapc-designer-wrapper .iapc-help-text {
    white-space: normal !important;
}

body.iapc-product-page-integration form.cart {
    display: none !important;
}

body.iapc-product-page-integration .iapc-designer-wrapper form.cart {
    display: flex !important;
    flex-direction: column;
}

body.iapc-product-page-integration .summary>*:not(.iapc-designer-wrapper) {
    display: none !important;
}

body.iapc-product-page-integration .summary.entry-summary,
body.iapc-product-page-integration div.product .summary {
    width: 100% !important;
    float: none !important;
    max-width: 100% !important;
}

body.iapc-product-page-integration div.product {
    display: block;
}

/* Shortcode en descripción: ocultar carrito duplicado del resumen */
body.single-product:has(.iapc-designer-wrapper) .summary form.cart,
body.single-product:has(.iapc-designer-wrapper) .entry-summary form.cart {
    display: none !important;
}

/* Sin sombras en controles interactivos */
.iapc-designer-wrapper button,
.iapc-designer-wrapper .iapc-btn,
.iapc-designer-wrapper .iapc-btn-secondary,
.iapc-designer-wrapper .iapc-ai-choice,
.iapc-designer-wrapper .iapc-canva-tab,
.iapc-designer-wrapper input:not([type="color"]):not([type="range"]),
.iapc-designer-wrapper select,
.iapc-designer-wrapper textarea {
    box-shadow: none !important;
}

.iapc-designer-wrapper .iapc-canva-tab-ai:not(.iapc-active) {
    box-shadow: none !important;
}

.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active {
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.38) !important;
}

.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active:hover,
.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active:focus {
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.45) !important;
}

/* Sin borde negro ni outline en botones */
.iapc-designer-wrapper button,
.iapc-designer-wrapper button:hover,
.iapc-designer-wrapper button:focus,
.iapc-designer-wrapper button:active,
.iapc-designer-wrapper button:focus-visible,
.iapc-designer-wrapper .iapc-btn,
.iapc-designer-wrapper .iapc-btn:hover,
.iapc-designer-wrapper .iapc-btn:focus,
.iapc-designer-wrapper .iapc-btn:active,
.iapc-designer-wrapper .iapc-btn:focus-visible,
.iapc-designer-wrapper .iapc-btn-secondary,
.iapc-designer-wrapper .iapc-btn-secondary:hover,
.iapc-designer-wrapper .iapc-btn-secondary:focus,
.iapc-designer-wrapper .iapc-btn-secondary:active,
.iapc-designer-wrapper .iapc-ai-choice,
.iapc-designer-wrapper .iapc-ai-choice:hover,
.iapc-designer-wrapper .iapc-ai-choice:focus,
.iapc-designer-wrapper .iapc-ai-choice:active,
.iapc-designer-wrapper .iapc-canva-tab,
.iapc-designer-wrapper .iapc-canva-tab:hover,
.iapc-designer-wrapper .iapc-canva-tab:focus,
.iapc-designer-wrapper .iapc-canva-tab:active,
.iapc-designer-wrapper .iapc-canva-tab-ai,
.iapc-designer-wrapper .iapc-canva-tab-ai:hover,
.iapc-designer-wrapper .iapc-canva-tab-ai:focus,
.iapc-designer-wrapper .iapc-canva-tab-ai:active,
.iapc-designer-wrapper .iapc-side-btn,
.iapc-designer-wrapper .iapc-side-btn:hover,
.iapc-designer-wrapper .iapc-side-btn:focus,
.iapc-designer-wrapper .iapc-side-btn:active,
.iapc-designer-wrapper .iapc-ai-guided-modal__close,
.iapc-designer-wrapper .iapc-ai-guided-modal__close:hover,
.iapc-designer-wrapper .iapc-ai-guided-modal__close:focus,
.iapc-designer-wrapper .iapc-ai-guided-modal__close:active {
    outline: none !important;
    outline-offset: 0 !important;
}

/* Modal Guided AI se mueve a body al abrir: forzar sin depender de .iapc-designer-wrapper */
#iapc_ai_guided_modal .iapc-ai-guided-modal__clear-filters,
#iapc_ai_guided_modal #iapc_clear_guided,
#iapc_ai_guided_modal .iapc-ai-guided-modal__clear-filters:hover,
#iapc_ai_guided_modal .iapc-ai-guided-modal__clear-filters:focus,
#iapc_ai_guided_modal .iapc-ai-guided-modal__clear-filters:active,
#iapc_ai_guided_modal #iapc_clear_guided:hover,
#iapc_ai_guided_modal #iapc_clear_guided:focus,
#iapc_ai_guided_modal #iapc_clear_guided:active,
body > .iapc-ai-guided-modal .iapc-ai-guided-modal__clear-filters,
body > .iapc-ai-guided-modal #iapc_clear_guided,
body > .iapc-ai-guided-modal .iapc-ai-guided-modal__clear-filters:hover,
body > .iapc-ai-guided-modal .iapc-ai-guided-modal__clear-filters:focus,
body > .iapc-ai-guided-modal .iapc-ai-guided-modal__clear-filters:active,
.iapc-designer-wrapper .iapc-ai-guided-modal__clear-filters,
.iapc-designer-wrapper .iapc-ai-guided-modal__clear-filters:hover,
.iapc-designer-wrapper .iapc-ai-guided-modal__clear-filters:focus,
.iapc-designer-wrapper .iapc-ai-guided-modal__clear-filters:active,
.woocommerce .iapc-designer-wrapper .iapc-ai-guided-modal__clear-filters,
.woocommerce .iapc-designer-wrapper .iapc-ai-guided-modal__clear-filters:hover,
.woocommerce .iapc-designer-wrapper .iapc-ai-guided-modal__clear-filters:focus,
.woocommerce .iapc-designer-wrapper .iapc-ai-guided-modal__clear-filters:active,
.woocommerce button.iapc-ai-guided-modal__clear-filters,
.woocommerce #iapc_clear_guided {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-radius: 0 !important;
    outline: none !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: #000 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    cursor: pointer !important;
}

.iapc-designer-wrapper .iapc-ai-guided-modal__header,
.woocommerce .iapc-designer-wrapper .iapc-ai-guided-modal__header,
#iapc_ai_guided_modal .iapc-ai-guided-modal__header,
body > .iapc-ai-guided-modal .iapc-ai-guided-modal__header {
    background: transparent !important;
    background-color: transparent !important;
}

#iapc_ai_guided_modal .iapc-ai-guided-modal__close,
#iapc_ai_guided_modal .iapc-ai-guided-modal__close:hover,
#iapc_ai_guided_modal .iapc-ai-guided-modal__close:focus,
#iapc_ai_guided_modal .iapc-ai-guided-modal__close:active,
body > .iapc-ai-guided-modal .iapc-ai-guided-modal__close,
body > .iapc-ai-guided-modal .iapc-ai-guided-modal__close:hover,
body > .iapc-ai-guided-modal .iapc-ai-guided-modal__close:focus,
body > .iapc-ai-guided-modal .iapc-ai-guided-modal__close:active,
.iapc-designer-wrapper .iapc-ai-guided-modal__close,
.iapc-designer-wrapper .iapc-ai-guided-modal__close:hover,
.iapc-designer-wrapper .iapc-ai-guided-modal__close:focus,
.iapc-designer-wrapper .iapc-ai-guided-modal__close:active,
.woocommerce .iapc-designer-wrapper .iapc-ai-guided-modal__close,
.woocommerce .iapc-designer-wrapper .iapc-ai-guided-modal__close:hover,
.woocommerce .iapc-designer-wrapper .iapc-ai-guided-modal__close:focus,
.woocommerce .iapc-designer-wrapper .iapc-ai-guided-modal__close:active,
.woocommerce button.iapc-ai-guided-modal__close {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-radius: 0 !important;
    outline: none !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: #000 !important;
    font-size: 28px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    cursor: pointer !important;
}

#iapc_ai_guided_modal .iapc-ai-guided-modal__close:hover,
#iapc_ai_guided_modal .iapc-ai-guided-modal__close:focus,
body > .iapc-ai-guided-modal .iapc-ai-guided-modal__close:hover,
body > .iapc-ai-guided-modal .iapc-ai-guided-modal__close:focus,
.iapc-designer-wrapper .iapc-ai-guided-modal__close:hover,
.iapc-designer-wrapper .iapc-ai-guided-modal__close:focus,
.woocommerce .iapc-designer-wrapper .iapc-ai-guided-modal__close:hover,
.woocommerce .iapc-designer-wrapper .iapc-ai-guided-modal__close:focus {
    color: #000 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    opacity: 0.55 !important;
}

.iapc-designer-wrapper .iapc-canva-tab-ai:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #fff !important;
    color: #7c3aed !important;
    box-shadow: none !important;
}

.iapc-designer-wrapper .iapc-canva-tab:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #fff !important;
    color: #888 !important;
}

.iapc-designer-wrapper .iapc-btn-secondary,
.iapc-designer-wrapper .iapc-btn-secondary:hover,
.iapc-designer-wrapper .iapc-btn-secondary:focus,
.iapc-designer-wrapper .iapc-btn-secondary:active,
.iapc-designer-wrapper .iapc-ai-choice,
.iapc-designer-wrapper .iapc-ai-choice:hover,
.iapc-designer-wrapper .iapc-ai-choice:focus,
.iapc-designer-wrapper .iapc-ai-choice:active,
.iapc-designer-wrapper .iapc-canva-tab,
.iapc-designer-wrapper .iapc-canva-tab:hover,
.iapc-designer-wrapper .iapc-canva-tab:focus,
.iapc-designer-wrapper .iapc-canva-tab:active {
    border: 1px solid #dfe3ea !important;
}

.iapc-designer-wrapper .iapc-canva-tab-ai,
.iapc-designer-wrapper .iapc-canva-tab-ai:hover,
.iapc-designer-wrapper .iapc-canva-tab-ai:focus,
.iapc-designer-wrapper .iapc-canva-tab-ai:active {
    border: 1px solid #9333ea !important;
}

.iapc-designer-wrapper .iapc-ai-choice.iapc-active,
.iapc-designer-wrapper .iapc-ai-choice.iapc-active:hover,
.iapc-designer-wrapper .iapc-ai-choice.iapc-active:focus,
.iapc-designer-wrapper .iapc-ai-choice.iapc-active:active {
    border: 1px solid #9333ea !important;
}

.iapc-designer-wrapper .iapc-canva-tab.iapc-active,
.iapc-designer-wrapper .iapc-canva-tab.iapc-active:hover,
.iapc-designer-wrapper .iapc-canva-tab.iapc-active:focus,
.iapc-designer-wrapper .iapc-canva-tab.iapc-active:active {
    border: 1px solid #9333ea !important;
}

.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active,
.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active:hover,
.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active:focus,
.iapc-designer-wrapper .iapc-canva-tab-ai.iapc-active:active {
    border: 1px solid #9333ea !important;
}

/* Input focus — soft ring, no black border or outline gaps on rounded corners */
.iapc-designer-wrapper .iapc-field input[type="text"]:focus,
.iapc-designer-wrapper .iapc-field select:focus,
.iapc-designer-wrapper .iapc-field textarea:focus,
.iapc-designer-wrapper .iapc-tool-card input[type="text"]:focus,
.iapc-designer-wrapper .iapc-tool-card select:focus,
.iapc-designer-wrapper .iapc-tool-card textarea:focus,
.iapc-designer-wrapper .iapc-canva-panel input[type="text"]:focus,
.iapc-designer-wrapper .iapc-canva-panel input[type="number"]:focus,
.iapc-designer-wrapper .iapc-canva-panel select:focus,
.iapc-designer-wrapper .iapc-canva-panel textarea:focus {
    outline: none !important;
    outline-offset: 0 !important;
    border-width: 1px !important;
    border-color: #c4b5fd !important;
    box-shadow: 0 0 0 3px var(--iapc-brand-purple-ring, rgba(168, 85, 247, 0.24)) !important;
}

/* Color picker — anti-theme reset (Text + Paint); swatch must fill the control */
.iapc-designer-wrapper .iapc-field input[type="color"],
.iapc-designer-wrapper .iapc-tool-card input[type="color"],
.iapc-designer-wrapper .iapc-canva-panel input[type="color"],
.iapc-designer-wrapper #iapc_color,
.iapc-designer-wrapper #iapc_brush_color,
.iapc-designer-wrapper #iapc_paint_color {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 25px !important;
    min-height: 25px !important;
    padding: 4px !important;
    box-sizing: border-box !important;
    border: 1px solid #dfe3ea !important;
    border-radius: 14px !important;
    background: #fff !important;
    cursor: pointer !important;
    line-height: normal !important;
}

.iapc-designer-wrapper .iapc-field input[type="color"]::-webkit-color-swatch-wrapper,
.iapc-designer-wrapper .iapc-tool-card input[type="color"]::-webkit-color-swatch-wrapper,
.iapc-designer-wrapper .iapc-canva-panel input[type="color"]::-webkit-color-swatch-wrapper,
.iapc-designer-wrapper #iapc_color::-webkit-color-swatch-wrapper,
.iapc-designer-wrapper #iapc_brush_color::-webkit-color-swatch-wrapper,
.iapc-designer-wrapper #iapc_paint_color::-webkit-color-swatch-wrapper {
    padding: 0 !important;
    border: none !important;
    border-radius: 10px !important;
    width: 100% !important;
    height: 100% !important;
}

.iapc-designer-wrapper .iapc-field input[type="color"]::-webkit-color-swatch,
.iapc-designer-wrapper .iapc-tool-card input[type="color"]::-webkit-color-swatch,
.iapc-designer-wrapper .iapc-canva-panel input[type="color"]::-webkit-color-swatch,
.iapc-designer-wrapper #iapc_color::-webkit-color-swatch,
.iapc-designer-wrapper #iapc_brush_color::-webkit-color-swatch,
.iapc-designer-wrapper #iapc_paint_color::-webkit-color-swatch {
    border: none !important;
    border-radius: 10px !important;
    width: 100% !important;
    height: 100% !important;
}

.iapc-designer-wrapper .iapc-field input[type="color"]::-moz-color-swatch,
.iapc-designer-wrapper .iapc-tool-card input[type="color"]::-moz-color-swatch,
.iapc-designer-wrapper .iapc-canva-panel input[type="color"]::-moz-color-swatch,
.iapc-designer-wrapper #iapc_color::-moz-color-swatch,
.iapc-designer-wrapper #iapc_brush_color::-moz-color-swatch,
.iapc-designer-wrapper #iapc_paint_color::-moz-color-swatch {
    border: none !important;
    border-radius: 10px !important;
    width: 100% !important;
    height: 100% !important;
}

.iapc-designer-wrapper .iapc-field input[type="color"]:focus,
.iapc-designer-wrapper .iapc-tool-card input[type="color"]:focus,
.iapc-designer-wrapper .iapc-canva-panel input[type="color"]:focus,
.iapc-designer-wrapper #iapc_color:focus,
.iapc-designer-wrapper #iapc_brush_color:focus,
.iapc-designer-wrapper #iapc_paint_color:focus {
    outline: none !important;
    border-color: #c4b5fd !important;
    box-shadow: 0 0 0 3px var(--iapc-brand-purple-ring, rgba(168, 85, 247, 0.24)) !important;
}

/* Panel lateral: estirar controles al ancho completo */
.iapc-designer-wrapper .iapc-canva-panel.iapc-active,
.iapc-designer-wrapper .iapc-canva-panel.iapc-active .iapc-options,
.iapc-designer-wrapper .iapc-canva-panel.iapc-active .iapc-field,
.iapc-designer-wrapper .iapc-canva-panel.iapc-active .iapc-fields-2 {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

.iapc-designer-wrapper .iapc-canva-panel.iapc-active input:not([type="checkbox"]):not([type="radio"]),
.iapc-designer-wrapper .iapc-canva-panel.iapc-active select,
.iapc-designer-wrapper .iapc-canva-panel.iapc-active textarea,
.iapc-designer-wrapper .iapc-canva-panel.iapc-active .iapc-btn,
.iapc-designer-wrapper .iapc-canva-panel.iapc-active .iapc-btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* Side buttons — neutros, sin sombra morada */
.iapc-designer-wrapper .iapc-designer-center .iapc-side-btn,
.woocommerce .iapc-designer-wrapper .iapc-designer-center .iapc-side-btn {
    border-radius: var(--iapc-btn-radius, 16px) !important;
    min-height: 48px !important;
}

.iapc-designer-wrapper .iapc-side-btn:hover,
.iapc-designer-wrapper .iapc-side-btn:focus,
.woocommerce .iapc-designer-wrapper .iapc-side-btn:hover,
.woocommerce .iapc-designer-wrapper .iapc-side-btn:focus {
    box-shadow: none !important;
}

.iapc-designer-wrapper .iapc-side-btn.iapc-active,
.woocommerce .iapc-designer-wrapper .iapc-side-btn.iapc-active {
    box-shadow: none !important;
}

.iapc-designer-wrapper .iapc-side-btn.iapc-active:hover,
.iapc-designer-wrapper .iapc-side-btn.iapc-active:focus,
.woocommerce .iapc-designer-wrapper .iapc-side-btn.iapc-active:hover,
.woocommerce .iapc-designer-wrapper .iapc-side-btn.iapc-active:focus {
    box-shadow: none !important;
}

/* Guided AI — botón Create corporativo (después del reset .iapc-btn gris) */
.iapc-designer-wrapper #iapc_design_for_me,
.iapc-designer-wrapper #iapc_design_for_me:hover,
.iapc-designer-wrapper #iapc_design_for_me:focus,
.iapc-designer-wrapper #iapc_design_for_me:active,
.woocommerce .iapc-designer-wrapper #iapc_design_for_me,
.woocommerce .iapc-designer-wrapper #iapc_design_for_me:hover,
.woocommerce .iapc-designer-wrapper #iapc_design_for_me:focus,
.woocommerce .iapc-designer-wrapper #iapc_design_for_me:active {
    border: 0 !important;
    border-radius: var(--iapc-btn-radius, 16px) !important;
    color: #fff !important;
    text-decoration: none !important;
}

.iapc-designer-wrapper #iapc_design_for_me,
.woocommerce .iapc-designer-wrapper #iapc_design_for_me {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
    background-color: #7c3aed !important;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.38) !important;
}

.iapc-designer-wrapper #iapc_design_for_me:hover,
.iapc-designer-wrapper #iapc_design_for_me:focus,
.woocommerce .iapc-designer-wrapper #iapc_design_for_me:hover,
.woocommerce .iapc-designer-wrapper #iapc_design_for_me:focus {
    background: linear-gradient(135deg, #b46cff 0%, #8b5cf6 100%) !important;
    background-color: #8b5cf6 !important;
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.45) !important;
}

.iapc-designer-wrapper #iapc_design_for_me:disabled,
.woocommerce .iapc-designer-wrapper #iapc_design_for_me:disabled {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
    color: #fff !important;
    opacity: 0.45 !important;
    box-shadow: none !important;
}

/* Sliders — anti-reset tema / WooCommerce (track + thumb visibles y centrados)
   Incluye .iapc-canva-content / .iapc-canva-panel: en móvil el panel se porta a <body>.
   Hit-area 20px con padding; track 6px centrado; thumb con margin-top negativo. */
.iapc-designer-wrapper input[type="range"],
.iapc-canva-content input[type="range"],
.iapc-canva-panel input[type="range"],
.iapc-field input[type="range"],
.woocommerce .iapc-designer-wrapper input[type="range"],
.woocommerce-page .iapc-designer-wrapper input[type="range"],
.woocommerce .iapc-canva-content input[type="range"],
.woocommerce-page .iapc-canva-content input[type="range"] {
    --iapc-range-track-h: 6px;
    --iapc-range-thumb-size: 20px;
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: var(--iapc-range-track-h, 6px) !important;
    min-height: var(--iapc-range-track-h, 6px) !important;
    margin: 0 !important;
    /* Reserva espacio para la bolita sin desplazar el track hacia arriba */
    padding: calc((var(--iapc-range-thumb-size, 20px) - var(--iapc-range-track-h, 6px)) / 2) 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer !important;
    accent-color: var(--iapc-brand-purple, #9333ea) !important;
}

.iapc-designer-wrapper input[type="range"]::-webkit-slider-runnable-track,
.iapc-canva-content input[type="range"]::-webkit-slider-runnable-track,
.iapc-canva-panel input[type="range"]::-webkit-slider-runnable-track,
.iapc-field input[type="range"]::-webkit-slider-runnable-track,
.woocommerce .iapc-designer-wrapper input[type="range"]::-webkit-slider-runnable-track,
.woocommerce-page .iapc-designer-wrapper input[type="range"]::-webkit-slider-runnable-track,
.woocommerce .iapc-canva-content input[type="range"]::-webkit-slider-runnable-track,
.woocommerce-page .iapc-canva-content input[type="range"]::-webkit-slider-runnable-track {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    height: var(--iapc-range-track-h, 6px) !important;
    border: 0 !important;
    border-radius: 999px !important;
    background-color: #e5e7eb !important;
}

.iapc-designer-wrapper input[type="range"]::-webkit-slider-thumb,
.iapc-canva-content input[type="range"]::-webkit-slider-thumb,
.iapc-canva-panel input[type="range"]::-webkit-slider-thumb,
.iapc-field input[type="range"]::-webkit-slider-thumb,
.woocommerce .iapc-designer-wrapper input[type="range"]::-webkit-slider-thumb,
.woocommerce-page .iapc-designer-wrapper input[type="range"]::-webkit-slider-thumb,
.woocommerce .iapc-canva-content input[type="range"]::-webkit-slider-thumb,
.woocommerce-page .iapc-canva-content input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    width: var(--iapc-range-thumb-size, 20px) !important;
    height: var(--iapc-range-thumb-size, 20px) !important;
    margin-top: calc((var(--iapc-range-track-h, 6px) - var(--iapc-range-thumb-size, 20px)) / 2) !important;
    border-radius: 50% !important;
    background: var(--iapc-brand-purple, #9333ea) !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35) !important;
    cursor: pointer !important;
}

.iapc-designer-wrapper input[type="range"]::-moz-range-track,
.iapc-canva-content input[type="range"]::-moz-range-track,
.iapc-canva-panel input[type="range"]::-moz-range-track,
.iapc-field input[type="range"]::-moz-range-track,
.woocommerce .iapc-designer-wrapper input[type="range"]::-moz-range-track,
.woocommerce-page .iapc-designer-wrapper input[type="range"]::-moz-range-track,
.woocommerce .iapc-canva-content input[type="range"]::-moz-range-track,
.woocommerce-page .iapc-canva-content input[type="range"]::-moz-range-track {
    width: 100% !important;
    height: var(--iapc-range-track-h, 6px) !important;
    border-radius: 999px !important;
    background: #e5e7eb !important;
    border: 0 !important;
}

.iapc-designer-wrapper input[type="range"]::-moz-range-progress,
.iapc-canva-content input[type="range"]::-moz-range-progress,
.iapc-canva-panel input[type="range"]::-moz-range-progress,
.iapc-field input[type="range"]::-moz-range-progress,
.woocommerce .iapc-designer-wrapper input[type="range"]::-moz-range-progress,
.woocommerce-page .iapc-designer-wrapper input[type="range"]::-moz-range-progress,
.woocommerce .iapc-canva-content input[type="range"]::-moz-range-progress,
.woocommerce-page .iapc-canva-content input[type="range"]::-moz-range-progress {
    height: var(--iapc-range-track-h, 6px) !important;
    border-radius: 999px !important;
    background: var(--iapc-brand-purple, #9333ea) !important;
}

.iapc-designer-wrapper input[type="range"]::-moz-range-thumb,
.iapc-canva-content input[type="range"]::-moz-range-thumb,
.iapc-canva-panel input[type="range"]::-moz-range-thumb,
.iapc-field input[type="range"]::-moz-range-thumb,
.woocommerce .iapc-designer-wrapper input[type="range"]::-moz-range-thumb,
.woocommerce-page .iapc-designer-wrapper input[type="range"]::-moz-range-thumb,
.woocommerce .iapc-canva-content input[type="range"]::-moz-range-thumb,
.woocommerce-page .iapc-canva-content input[type="range"]::-moz-range-thumb {
    box-sizing: border-box !important;
    width: var(--iapc-range-thumb-size, 20px) !important;
    height: var(--iapc-range-thumb-size, 20px) !important;
    border: 2px solid #fff !important;
    border-radius: 50% !important;
    background: var(--iapc-brand-purple, #9333ea) !important;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35) !important;
    cursor: pointer !important;
}

/* CTAs primarios IA — alineados con web corporativa */
.iapc-designer-wrapper #iapc_generate_ai,
.iapc-designer-wrapper #iapc_open_guided_ai,
.woocommerce .iapc-designer-wrapper #iapc_generate_ai,
.woocommerce .iapc-designer-wrapper #iapc_open_guided_ai {
    border: 0 !important;
    border-radius: var(--iapc-btn-radius, 16px) !important;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
    background-color: #7c3aed !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.38) !important;
    text-decoration: none !important;
}

.iapc-designer-wrapper #iapc_generate_ai:hover,
.iapc-designer-wrapper #iapc_generate_ai:focus,
.iapc-designer-wrapper #iapc_open_guided_ai:hover,
.iapc-designer-wrapper #iapc_open_guided_ai:focus,
.woocommerce .iapc-designer-wrapper #iapc_generate_ai:hover,
.woocommerce .iapc-designer-wrapper #iapc_generate_ai:focus,
.woocommerce .iapc-designer-wrapper #iapc_open_guided_ai:hover,
.woocommerce .iapc-designer-wrapper #iapc_open_guided_ai:focus {
    background: linear-gradient(135deg, #b46cff 0%, #8b5cf6 100%) !important;
    background-color: #8b5cf6 !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.45) !important;
}

.iapc-designer-wrapper #iapc_generate_ai:disabled,
.iapc-designer-wrapper #iapc_open_guided_ai:disabled,
.woocommerce .iapc-designer-wrapper #iapc_generate_ai:disabled,
.woocommerce .iapc-designer-wrapper #iapc_open_guided_ai:disabled {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
    color: #fff !important;
    opacity: 0.45 !important;
    box-shadow: none !important;
}

/* Opciones IA guiada — selección activa en lila */
.iapc-designer-wrapper .iapc-ai-choice.iapc-active,
.iapc-designer-wrapper .iapc-ai-choice.iapc-active:hover,
.iapc-designer-wrapper .iapc-ai-choice.iapc-active:focus,
.iapc-designer-wrapper .iapc-ai-choice.iapc-active:active,
.woocommerce .iapc-designer-wrapper .iapc-ai-choice.iapc-active,
.woocommerce .iapc-designer-wrapper .iapc-ai-choice.iapc-active:hover,
.woocommerce .iapc-designer-wrapper .iapc-ai-choice.iapc-active:focus,
.woocommerce .iapc-designer-wrapper .iapc-ai-choice.iapc-active:active {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
    background-color: #7c3aed !important;
    color: #fff !important;
    border-color: #9333ea !important;
}

/* View cart — secundario outline neutro */
.iapc-designer-wrapper .iapc-view-cart,
.iapc-designer-wrapper .iapc-view-cart:hover,
.iapc-designer-wrapper .iapc-view-cart:focus,
.iapc-designer-wrapper .iapc-view-cart:active,
.woocommerce .iapc-designer-wrapper .iapc-view-cart,
.woocommerce .iapc-designer-wrapper .iapc-view-cart:hover,
.woocommerce .iapc-designer-wrapper .iapc-view-cart:focus,
.woocommerce .iapc-designer-wrapper .iapc-view-cart:active {
    background: #fff !important;
    background-color: #fff !important;
    border: 1px solid #d1d5db !important;
    color: #111 !important;
    text-decoration: none !important;
}

.iapc-designer-wrapper .iapc-view-cart:hover,
.iapc-designer-wrapper .iapc-view-cart:focus,
.woocommerce .iapc-designer-wrapper .iapc-view-cart:hover,
.woocommerce .iapc-designer-wrapper .iapc-view-cart:focus {
    background: #f3f4f6 !important;
    background-color: #f3f4f6 !important;
    color: #111 !important;
    border-color: #9ca3af !important;
}

/* MOBILE TOOLS: icon dock + almost-fullscreen modal (scroll inside) */
.iapc-canva-content-home {
    display: contents;
}

/* Desktop: header hidden; scroll wrapper is transparent to layout */
.iapc-mobile-modal-header {
    display: none !important;
}

.iapc-mobile-modal-scroll {
    display: contents;
}

html.iapc-mobile-tools-open,
body.iapc-mobile-tools-open {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

@media (max-width: 900px) {
    .iapc-designer-wrapper {
        /* Room for fixed dock so CLEAR TEXT / cart aren't covered */
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .iapc-designer-wrapper .iapc-designer-layout {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .iapc-designer-wrapper .iapc-designer-center {
        order: 1;
        padding: 0 !important;
    }

    .iapc-designer-wrapper .iapc-designer-right {
        order: 3;
        padding: 0 !important;
    }

    .iapc-designer-wrapper .iapc-designer-left {
        order: 2;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
        display: block !important;
    }

    .iapc-designer-wrapper .iapc-canva-menu {
        position: fixed !important;
        left: max(8px, env(safe-area-inset-left, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        z-index: 100070;
        display: grid !important;
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        align-items: center !important;
        justify-items: center !important;
        gap: 4px !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 6px !important;
        border-radius: 16px !important;
        /* Corporate purple dock — clearer customization entry point */
        background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
        border: 1px solid #6d28d9 !important;
        box-shadow: 0 10px 28px rgba(124, 58, 237, 0.42) !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab,
    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab-ai {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 0 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        border-radius: 12px !important;
        border-color: transparent !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab:hover,
    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab-ai:hover {
        background: rgba(255, 255, 255, 0.16) !important;
        border-color: transparent !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab.iapc-active,
    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab-ai.iapc-active,
    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab.iapc-active:hover,
    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab-ai.iapc-active:hover,
    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab.iapc-active:focus,
    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab-ai.iapc-active:focus {
        background: #fff !important;
        background-color: #fff !important;
        border-color: transparent !important;
        box-shadow: 0 2px 10px rgba(17, 24, 39, 0.18) !important;
        filter: none !important;
        transform: none !important;
    }

    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab::before,
    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab-ai::before {
        content: attr(data-icon);
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        font-size: 17px;
        line-height: 1;
        text-align: center;
        color: #fff !important;
        filter: none !important;
        opacity: 1;
    }

    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab-ai::before {
        font-size: 13px;
        font-weight: 900;
        letter-spacing: 0.02em;
        color: #fff !important;
    }

    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab.iapc-active::before,
    .iapc-designer-wrapper .iapc-canva-menu .iapc-canva-tab-ai.iapc-active::before {
        color: #7c3aed !important;
    }

    /* Full modal above the dock — portaled to body + inner scroll body */
    body > .iapc-canva-content.iapc-mobile-portal {
        --iapc-mobile-modal-top: max(8px, env(safe-area-inset-top, 0px));
        --iapc-mobile-modal-side: max(8px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
        --iapc-mobile-modal-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
        position: fixed !important;
        top: var(--iapc-mobile-modal-top) !important;
        left: var(--iapc-mobile-modal-side) !important;
        right: var(--iapc-mobile-modal-side) !important;
        bottom: var(--iapc-mobile-modal-bottom) !important;
        width: auto !important;
        max-width: none !important;
        /* Explicit height so overflow can scroll (auto + top/bottom alone fails on some mobile browsers) */
        height: calc(100vh - var(--iapc-mobile-modal-top) - var(--iapc-mobile-modal-bottom)) !important;
        height: calc(100dvh - var(--iapc-mobile-modal-top) - var(--iapc-mobile-modal-bottom)) !important;
        max-height: calc(100vh - var(--iapc-mobile-modal-top) - var(--iapc-mobile-modal-bottom)) !important;
        max-height: calc(100dvh - var(--iapc-mobile-modal-top) - var(--iapc-mobile-modal-bottom)) !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 16px !important;
        background: #fff !important;
        border: 1px solid #e8ebf0 !important;
        box-shadow: 0 18px 48px rgba(17, 24, 39, 0.22) !important;
        z-index: 100030 !important;
        display: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        overflow: hidden !important;
        transform: none !important;
        transition: opacity 0.18s ease;
        pointer-events: none;
        visibility: hidden;
        opacity: 0;
        box-sizing: border-box !important;
    }

    body.iapc-mobile-tools-open > .iapc-canva-content.iapc-mobile-portal {
        display: flex !important;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* All mobile tool panels = low bottom sheet (canvas stays visible above) */
    body.iapc-mobile-tools-open > .iapc-canva-content.iapc-mobile-portal.iapc-mobile-sheet--compact {
        top: auto !important;
        left: max(8px, env(safe-area-inset-left, 0px)) !important;
        right: max(8px, env(safe-area-inset-right, 0px)) !important;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
        height: min(44dvh, 400px) !important;
        max-height: min(44dvh, 400px) !important;
        min-height: 0 !important;
        border-radius: 18px 18px 14px 14px !important;
        box-shadow: 0 -12px 40px rgba(17, 24, 39, 0.22) !important;
    }

    body.iapc-mobile-tools-open.iapc-mobile-sheet--compact > .iapc-mobile-sheet-backdrop.iapc-mobile-portal {
        background: rgba(17, 24, 39, 0.28);
    }

    @supports not (height: 1dvh) {
        body.iapc-mobile-tools-open > .iapc-canva-content.iapc-mobile-portal.iapc-mobile-sheet--compact {
            height: min(44vh, 400px) !important;
            max-height: min(44vh, 400px) !important;
        }
    }

    /* Fallback when content is not yet portaled */
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-canva-content {
        position: fixed !important;
        top: max(8px, env(safe-area-inset-top, 0px)) !important;
        left: max(8px, env(safe-area-inset-left, 0px)) !important;
        right: max(8px, env(safe-area-inset-right, 0px)) !important;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
        height: calc(100dvh - max(8px, env(safe-area-inset-top, 0px)) - 64px - env(safe-area-inset-bottom, 0px)) !important;
        max-height: calc(100dvh - max(8px, env(safe-area-inset-top, 0px)) - 64px - env(safe-area-inset-bottom, 0px)) !important;
        z-index: 100030 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: #fff !important;
        border-radius: 16px !important;
        box-sizing: border-box !important;
    }

    body > .iapc-mobile-sheet-backdrop.iapc-mobile-portal,
    .iapc-mobile-sheet-backdrop {
        position: fixed;
        inset: 0;
        z-index: 100025;
        border: 0;
        padding: 0;
        margin: 0;
        background: rgba(17, 24, 39, 0.48);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
        touch-action: none;
        overscroll-behavior: none;
    }

    body.iapc-mobile-tools-open > .iapc-mobile-sheet-backdrop.iapc-mobile-portal,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-mobile-sheet-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .iapc-mobile-modal-header {
        position: relative !important;
        top: auto !important;
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 8px 10px 12px !important;
        border-bottom: 1px solid #eef1f5;
        background: #fff !important;
        z-index: 3;
    }

    /* Override desktop `display: contents` so this box can actually scroll */
    body > .iapc-canva-content.iapc-mobile-portal > .iapc-mobile-modal-scroll,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-canva-content > .iapc-mobile-modal-scroll {
        display: block !important;
    }

    .iapc-mobile-modal-title {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 15px !important;
        font-style: italic !important;
        font-weight: 500 !important;
        color: #4b5563 !important;
        line-height: 1.35 !important;
        text-align: left !important;
    }

    .iapc-mobile-modal-title[hidden] {
        display: none !important;
    }

    .iapc-mobile-sheet-close {
        position: static !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
        width: 36px !important;
        height: 36px !important;
        border: 0 !important;
        border-radius: 999px !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #111 !important;
        font-size: 20px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        z-index: 2;
        cursor: pointer;
    }

    .iapc-mobile-sheet-close:hover,
    .iapc-mobile-sheet-close:focus {
        background: #f3f4f6 !important;
        border: 0 !important;
        box-shadow: none !important;
        color: #111 !important;
    }

    /* THE scroll container */
    body > .iapc-canva-content.iapc-mobile-portal > .iapc-mobile-modal-scroll,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-canva-content > .iapc-mobile-modal-scroll {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        overflow-y: scroll !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        box-sizing: border-box !important;
    }

    /* Intro moves to header on mobile modal — hide duplicate in body */
    body.iapc-mobile-tools-open > .iapc-canva-content.iapc-mobile-portal .iapc-panel-intro,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-panel-intro {
        display: none !important;
    }

    /* Panel grows with content; scroll lives on .iapc-mobile-modal-scroll */
    body > .iapc-canva-content.iapc-mobile-portal .iapc-canva-panel,
    body > .iapc-canva-content.iapc-mobile-portal .iapc-card.iapc-canva-panel,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-canva-panel,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-canva-content .iapc-card.iapc-canva-panel {
        display: none !important;
    }

    body > .iapc-canva-content.iapc-mobile-portal .iapc-canva-panel.iapc-active,
    body > .iapc-canva-content.iapc-mobile-portal .iapc-card.iapc-canva-panel.iapc-active,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-canva-panel.iapc-active,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-canva-content .iapc-card.iapc-canva-panel.iapc-active {
        display: block !important;
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 10px 12px 24px !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    body > .iapc-canva-content.iapc-mobile-portal .iapc-canva-panel.iapc-active .iapc-options,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-canva-panel.iapc-active .iapc-options {
        display: flex !important;
        flex-direction: column !important;
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        gap: 12px !important;
        justify-content: flex-start !important;
        overflow: visible !important;
    }

    body > .iapc-canva-content.iapc-mobile-portal .iapc-canva-panel.iapc-active .iapc-options > #iapc_add_text,
    body > .iapc-canva-content.iapc-mobile-portal .iapc-canva-panel.iapc-active .iapc-options > #iapc_add_sticker,
    body > .iapc-canva-content.iapc-mobile-portal .iapc-canva-panel.iapc-active .iapc-options > #iapc_add_graphic,
    body > .iapc-canva-content.iapc-mobile-portal .iapc-canva-panel.iapc-active .iapc-options > #iapc_undo_paint,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-canva-panel.iapc-active .iapc-options > #iapc_add_text,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-canva-panel.iapc-active .iapc-options > #iapc_add_sticker,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-canva-panel.iapc-active .iapc-options > #iapc_add_graphic,
    .iapc-designer-wrapper.iapc-mobile-sheet-open .iapc-canva-panel.iapc-active .iapc-options > #iapc_undo_paint {
        margin-top: 8px !important;
    }

    /* Canvas: stop page scroll stealing paint/drag gestures */
    #iapc_canvas_wrap,
    #iapc_mug_canvas {
        touch-action: none !important;
        -webkit-user-select: none !important;
        user-select: none !important;
    }

    #iapc_canvas_wrap {
        position: relative;
    }

    .iapc-canvas-fs-toggle,
    .iapc-canvas-fs-exit {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        position: absolute;
        z-index: 8;
        width: 30px !important;
        height: 30px !important;
        min-height: 30px;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 999px !important;
        background: rgba(17, 24, 39, 0.88) !important;
        color: #fff !important;
        font-size: 0 !important;
        box-shadow: 0 8px 20px rgba(17, 24, 39, 0.28) !important;
        cursor: pointer;
    }

    .iapc-canvas-fs-toggle {
        right: 10px;
        bottom: 10px;
    }

    .iapc-canvas-fs-toggle .iapc-canvas-fs-icon,
    .iapc-canvas-fs-exit .iapc-canvas-fs-icon {
        display: block;
        width: 15px;
        height: 15px;
        pointer-events: none;
    }

    .iapc-canvas-fs-toggle.iapc-hidden,
    .iapc-canvas-fs-exit.iapc-hidden {
        display: none !important;
    }

    html.iapc-canvas-fs-open,
    body.iapc-canvas-fs-open {
        overflow: hidden !important;
        overscroll-behavior: none !important;
        touch-action: none !important;
    }

    /* Canvas-only fullscreen: product on TOP of sheet/backdrop */
    body.iapc-canvas-fs-open #iapc_canvas_wrap.iapc-canvas-fs {
        position: fixed !important;
        top: max(8px, env(safe-area-inset-top, 0px)) !important;
        left: max(8px, env(safe-area-inset-left, 0px)) !important;
        right: max(8px, env(safe-area-inset-right, 0px)) !important;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
        z-index: 100055 !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 10px !important;
        border-radius: 16px !important;
        background: #111 !important;
        border: 1px solid #1f2937 !important;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        /* Stay below the tool sheet so controls remain clickable */
        pointer-events: auto !important;
    }

    /* Leave room for the bottom sheet under the canvas */
    body.iapc-canvas-fs-open.iapc-mobile-tools-open.iapc-mobile-sheet--compact #iapc_canvas_wrap.iapc-canvas-fs,
    body.iapc-canvas-fs-open.iapc-mobile-tools-open #iapc_canvas_wrap.iapc-canvas-fs {
        bottom: calc(64px + env(safe-area-inset-bottom, 0px) + min(44dvh, 400px) + 10px) !important;
    }

    @supports not (height: 1dvh) {
        body.iapc-canvas-fs-open.iapc-mobile-tools-open.iapc-mobile-sheet--compact #iapc_canvas_wrap.iapc-canvas-fs,
        body.iapc-canvas-fs-open.iapc-mobile-tools-open #iapc_canvas_wrap.iapc-canvas-fs {
            bottom: calc(64px + env(safe-area-inset-bottom, 0px) + min(44vh, 400px) + 10px) !important;
        }
    }

    body.iapc-canvas-fs-open #iapc_canvas_wrap.iapc-canvas-fs #iapc_mug_canvas {
        width: auto !important;
        max-width: 100% !important;
        max-height: 100% !important;
        height: auto !important;
        margin: 0 auto !important;
        align-self: center !important;
        object-fit: contain;
        object-position: top center;
        background: #fff;
        border-radius: 12px;
    }

    body.iapc-canvas-fs-open #iapc_canvas_wrap.iapc-canvas-fs .iapc-canvas-fs-toggle {
        display: none !important;
    }

    /* Only control in fullscreen: exit icon, top-right */
    body.iapc-canvas-fs-open #iapc_canvas_wrap.iapc-canvas-fs .iapc-canvas-fs-exit {
        display: inline-flex !important;
        top: 10px;
        right: 10px;
        bottom: auto;
        left: auto;
        z-index: 12;
        background: rgba(17, 24, 39, 0.72) !important;
    }

    @media (orientation: landscape) {
        body.iapc-canvas-fs-open #iapc_canvas_wrap.iapc-canvas-fs {
            padding: 10px !important;
        }

        body.iapc-canvas-fs-open #iapc_canvas_wrap.iapc-canvas-fs #iapc_mug_canvas {
            width: auto !important;
            max-width: min(100%, 92vw) !important;
            max-height: calc(100dvh - 64px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 20px) !important;
            max-height: calc(100vh - 64px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 20px) !important;
        }
    }

    /* Sheet above canvas (clicks); canvas stays visually in the top band via bottom inset */
    body.iapc-canvas-fs-open.iapc-mobile-tools-open > .iapc-canva-content.iapc-mobile-portal {
        z-index: 100080 !important;
    }

    body.iapc-canvas-fs-open.iapc-mobile-tools-open > .iapc-mobile-sheet-backdrop.iapc-mobile-portal {
        z-index: 100050 !important;
        pointer-events: none;
    }

    body.iapc-canvas-fs-open .iapc-designer-wrapper .iapc-canva-menu,
    body.iapc-canvas-fs-open.iapc-mobile-tools-mode .iapc-canva-menu {
        z-index: 100100 !important;
    }

    /* Guided AI must sit above mobile sheet + dock */
    body.iapc-mobile-tools-open .iapc-ai-guided-modal,
    body.iapc-canvas-fs-open .iapc-ai-guided-modal,
    body > .iapc-ai-guided-modal {
        z-index: 100150 !important;
    }
}
