#woocommerce-product-data .options_group:has(.iapc-admin-customizer-box) {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.iapc-customizer-summary {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 16px !important;
    background: #f6f7f7;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

.iapc-customizer-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.iapc-customizer-arrow {
    font-size: 14px;
    line-height: 1;
}

.iapc-customizer-title {
    font-size: 16px;
    font-weight: 700;
}

.iapc-customizer-switch {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px;
    margin-left: auto;
    white-space: nowrap;
}

.iapc-customizer-switch input {
    position: static !important;
    display: inline-block !important;
    margin: 0 !important;
    flex: 0 0 auto;
}

.iapc-customizer-switch label {
    display: inline-block !important;
    margin: 0 !important;
    width: auto !important;
    float: none !important;
    line-height: 1;
    cursor: pointer;
}



.iapc-admin-customizer-content,
.iapc-admin-customizer-content * {
    box-sizing: border-box;
}

.iapc-admin-customizer-content {
    width: 100%;
    max-width: none;
    padding: 28px 12px 32px;
}

.iapc-admin-customizer-content h2,
.iapc-admin-customizer-content h3 {
    color: #6d28d9;
}

#poststuff .iapc-admin-customizer-content h2,
#poststuff .iapc-admin-customizer-content h3,
#poststuff .iapc-admin-customizer-content .iapc-section-title,
#poststuff .iapc-admin-customizer-content .iapc-subsection-title {
    padding: 0 !important;
}

.iapc-admin-customizer-content .iapc-section-title {
    margin: 0 0 10px !important;
    padding: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.01em;
    color: #6d28d9;
}

.iapc-admin-customizer-content .iapc-subsection-title {
    margin: 18px 0 8px !important;
    padding: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    color: #7c3aed;
}

.iapc-admin-customizer-content .iapc-section-text {
    margin: 0 0 16px;
    padding: 0;
    max-width: 900px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: #64748b;
}

.iapc-admin-customizer-content .iapc-section-text strong {
    font-weight: 600;
    color: #475569;
}

.iapc-admin-ai-promo-content .iapc-section-title,
.iapc-admin-ai-premium-box .iapc-section-title,
.iapc-integration-mode-box .iapc-section-title {
    margin-top: 0 !important;
    padding: 0 !important;
}

.iapc-integration-mode-box .iapc-section-text {
    padding-left: 0;
}

.iapc-admin-customizer-content p,
.iapc-admin-customizer-content li {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

.iapc-admin-customizer-content ul {
    margin: 12px 0 20px;
    padding: 14px 18px 14px 30px;
    background: #f8fafc;
    border-left: 4px solid #7c3aed;
    border-radius: 8px;
}

.iapc-admin-section .iapc-product-image-field {
    padding: 0 !important;
}

.iapc-admin-section .iapc-product-image-field-main {
    padding: 0 16px !important;
}

.iapc-admin-section .iapc-fees-grid {
    margin-top: 0;
}

.iapc-admin-section ul.iapc-section-list {
    margin: 0 0 16px 0;
}

/* ===== CONFIGURACIÓN OBLIGATORIA ===== */

.iapc-required-setup-notice {
    margin: 0 0 20px;
    padding: 0 0 0 12px;
    border-left: 3px solid #7c3aed;
    background: none;
}

.iapc-required-setup-notice p {
    margin: 0 0 4px;
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #4b5563;
}

.iapc-required-setup-notice p:last-child {
    margin-bottom: 0;
}

.iapc-required-setup-notice .iapc-required-setup-title {
    margin-bottom: 6px;
    color: #374151;
}

.iapc-admin-customizer-content ul.iapc-section-list li {
    color: #64748b;
}

.iapc-admin-customizer-content .form-field {
    display: block !important;
    margin: 0 0 20px !important;
    padding: 0 !important;
    text-align: left;
}

/* WooCommerce añade padding-left ~162px y float al label — alinear label + input */
#woocommerce-product-data .woocommerce_options_panel .iapc-admin-customizer-content p.form-field {
    padding: 0 !important;
    margin: 0 0 20px !important;
}

#woocommerce-product-data .woocommerce_options_panel .iapc-admin-customizer-content p.form-field label {
    float: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 8px !important;
    margin-left: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

#woocommerce-product-data .woocommerce_options_panel .iapc-admin-customizer-content p.form-field input:not(.iapc-product-image-input),
#woocommerce-product-data .woocommerce_options_panel .iapc-admin-customizer-content p.form-field textarea,
#woocommerce-product-data .woocommerce_options_panel .iapc-admin-customizer-content p.form-field select {
    float: none !important;
    margin-left: 0 !important;
    padding: 10px 12px !important;
    clear: both !important;
}

#woocommerce-product-data .woocommerce_options_panel .iapc-admin-customizer-content p.form-field .iapc-product-image-actions {
    float: none !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    clear: both !important;
}

.iapc-admin-customizer-content .form-field label {
    display: block !important;
    float: none !important;
    width: 100% !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    text-align: left;
    font-weight: 700;
}

.iapc-admin-customizer-content .form-field input,
.iapc-admin-customizer-content .form-field textarea,
.iapc-admin-customizer-content .form-field select {
    float: none !important;
    margin-left: 0 !important;
}

.iapc-admin-customizer-content input[type="text"]:not(.iapc-product-image-input),
.iapc-admin-customizer-content input[type="number"],
.iapc-admin-customizer-content textarea,
.iapc-admin-customizer-content select {
    width: 100% !important;
    max-width: 80%;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 9px;
}

.iapc-admin-customizer-content textarea {
    min-height: 110px;
    resize: vertical;
}

.iapc-admin-customizer-content input:focus,
.iapc-admin-customizer-content textarea:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 1px #7c3aed;
}

.iapc-admin-customizer-content .description {
    display: block !important;
    margin: 6px 0 0 !important;
    padding: 0 !important;
    font-size: 12px;
    color: #666;
    text-align: left;
}

.iapc-product-image-field {
    margin: 0 0 22px !important;
    padding: 0 !important;
    max-width: none;
    clear: both;
    text-align: left !important;
}

.iapc-product-image-field .iapc-product-image-preview {
    margin-left: 0 !important;
}

#poststuff .iapc-admin-customizer-content .iapc-product-image-field label,
.iapc-admin-customizer-content .iapc-product-image-field label,
.iapc-admin-extra-images .iapc-product-image-field label,
.iapc-admin-extra-printareas .iapc-product-image-field label {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 8px !important;
    margin-left: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    font-weight: 700;
}

.iapc-product-image-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 60%;
    max-width: none;
}

.iapc-product-image-input {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 !important;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 9px;
}

.iapc-product-image-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 1px #7c3aed;
    outline: none;
}

.iapc-upload-product-image,
.iapc-remove-product-image {
    flex: 0 0 auto;
    margin: 0 !important;
    min-height: 40px;
    min-width: 118px;
    height: auto;
    white-space: nowrap;
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.iapc-upload-product-image {
    border-color: #2271b1 !important;
    color: #2271b1 !important;
}

.iapc-remove-product-image {
    color: #b32d2e !important;
    border-color: #dba5a5 !important;
}

.iapc-remove-product-image.is-inactive {
    visibility: hidden;
    pointer-events: none;
}

.iapc-product-image-preview {
    display: block;
    max-width: 120px;
    height: auto;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.iapc-product-image-preview[style*="display: none"],
.iapc-product-image-preview:not([src]),
.iapc-product-image-preview[src=""] {
    display: none !important;
}

.iapc-admin-extra-images,
.iapc-admin-extra-printareas {
    margin: 20px 0 !important;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fafafa;
    overflow: hidden;
}

.iapc-admin-extra-images > summary,
.iapc-admin-extra-printareas > summary {
    padding: 14px 18px !important;
    background: #f3f4f6;
    border-bottom: 1px solid #ddd;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.iapc-admin-extra-images[open] > summary,
.iapc-admin-extra-printareas[open] > summary {
    background: #ede9fe;
    color: #6d28d9;
}

/* ===== RECARGOS ===== */

.iapc-fees-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:20px 30px;
    margin-top:20px;
}

.iapc-fees-grid .form-field{
    display:block !important;
}

.iapc-fees-grid .form-field label{
    display:block;
    width:100% !important;
    float:none !important;
    margin:0 0 8px !important;
}

.iapc-fees-grid .form-field input{
    width:100% !important;
}

.iapc-fees-grid .description{
    grid-column:auto !important;
    margin-top:6px !important;
}



/* ===== ÁREAS DE PERSONALIZACIÓN ===== */

.iapc-print-area-box {
    margin-top: 24px;
}

.iapc-print-area-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 30px;
}

.iapc-print-area-grid .form-field {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.iapc-print-area-grid .form-field label {
    display: block;
    width: 100% !important;
    float: none !important;
    margin: 0 0 8px !important;
}

.iapc-print-area-grid .form-field input {
    width: 100% !important;
    margin: 0 !important;
}

.iapc-print-area-grid .description {
    display: block;
    margin-top: 6px !important;
}

/*ROTACION */
.iapc-print-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:20px 30px;
    margin-bottom:24px;
}

.iapc-print-grid .form-field{
    display:block !important;
    margin:0 !important;
    padding:0 !important;
}

.iapc-print-grid .form-field label{
    display:block;
    width:100% !important;
    float:none !important;
    margin:0 0 8px !important;
}

.iapc-print-grid .form-field input{
    width:100% !important;
    margin:0 !important;
}

.iapc-print-grid .description{
    display:block;
    margin-top:6px !important;
}

/* Visual print area editor */
.iapc-print-area-block {
    margin: 0 0 28px;
}

.iapc-print-area-editor {
    margin: 0 0 12px;
    max-width: 420px;
}

.iapc-print-area-editor-empty {
    margin: 0;
    padding: 14px 16px;
    border: 1px dashed #c3c4c7;
    border-radius: 10px;
    background: #f6f7f7;
    color: #646970;
    font-size: 13px;
}

.iapc-print-area-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f1;
    user-select: none;
    touch-action: none;
}

.iapc-print-area-image {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
    margin: 0 !important;
    pointer-events: none;
}

.iapc-print-area-rect {
    position: absolute;
    box-sizing: border-box;
    border: 2px dashed #111;
    background: rgba(17, 24, 39, 0.12);
    cursor: move;
    outline: none;
}

.iapc-print-area-rect:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.25);
}

.iapc-print-area-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 2px;
    background: #111;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

.iapc-print-area-handle-nw {
    top: -7px;
    left: -7px;
    cursor: nwse-resize;
}

.iapc-print-area-handle-ne {
    top: -7px;
    right: -7px;
    cursor: nesw-resize;
}

.iapc-print-area-handle-sw {
    bottom: -7px;
    left: -7px;
    cursor: nesw-resize;
}

.iapc-print-area-handle-se {
    bottom: -7px;
    right: -7px;
    cursor: nwse-resize;
}

.iapc-print-area-advanced {
    margin: 8px 0 0;
}

.iapc-print-area-advanced > summary {
    cursor: pointer;
    font-weight: 600;
    color: #50575e;
    user-select: none;
}

.iapc-print-area-advanced[open] > summary {
    margin-bottom: 10px;
}

.iapc-print-area-advanced .iapc-print-grid {
    margin-bottom: 0;
}


/* Primera y última sección — tarjeta IA Premium (mismo borde y padding) */
.iapc-admin-ai-promo-content,
.iapc-admin-ai-premium-box {
    margin: 12px 0 30px;
    padding: 36px 24px;
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
    border: 1px solid #e9d5ff;
    border-radius: 12px;
    box-sizing: border-box;
    display: flow-root;
    width: 100%;
    overflow: visible;
}

.iapc-admin-section,
.iapc-integration-mode-box {
    margin: 12px 0 30px;
    padding: 34px 22px;
    background: #f8fafc;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    box-sizing: border-box;
    overflow: visible;
}

.iapc-admin-ai-promo-content.iapc-admin-section,
.iapc-admin-ai-premium-box.iapc-admin-section {
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
    border-color: #e9d5ff;
    padding: 36px 24px;
}

.iapc-admin-ai-promo-content {
    text-align: center;
}

.iapc-admin-ai-premium-box {
    text-align: left;
}

.iapc-integration-mode-fieldset {
    padding: 0 !important;
    border: 0;
    margin: 0;
    min-width: 0;
    overflow: visible;
}

.iapc-integration-mode-fieldset label,
.iapc-integration-mode-option {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    font-size: 14px;
    line-height: 1.55;
    color: #1d2327;
    cursor: pointer;
    text-align: left;
    white-space: normal;
    overflow: visible;
    box-sizing: border-box;
}

.iapc-integration-mode-option:last-child {
    margin-bottom: 0 !important;
}

.iapc-integration-mode-option input[type="radio"] {
    flex: 0 0 16px;
    display: inline-block !important;
    float: none !important;
    position: static !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    margin: 3px 0 0 !important;
    padding: 0 !important;
    line-height: normal;
    vertical-align: top;
    box-sizing: border-box;
    appearance: auto !important;
    -webkit-appearance: radio !important;
    accent-color: #7c3aed;
    box-shadow: none;
    opacity: 1 !important;
    visibility: visible !important;
}

#woocommerce-product-data .woocommerce_options_panel .iapc-integration-mode-fieldset label.iapc-integration-mode-option {
    float: none !important;
    width: 100% !important;
    margin-left: 0 !important;
}

.iapc-integration-mode-option-text {
    flex: 1 1 auto;
    min-width: 0;
}

.iapc-integration-mode-option code {
    font-size: 12px;
}

/* IA PREMIUM */

.iapc-admin-ai-promo-content .iapc-section-title,
.iapc-admin-ai-premium-box .iapc-section-title {
    font-size: 19px !important;
}

.iapc-admin-ai-premium-box .iapc-section-title {
    text-align: center;
}


.iapc-admin-ai-premium-box * {
    box-sizing: border-box;
}

.iapc-admin-ai-promo-content h3,
.iapc-admin-ai-premium-box h3 {
    margin: 0 0 10px;
}

.iapc-admin-ai-promo-content .iapc-section-title {
    text-align: center;
}

.iapc-admin-ai-promo-content .iapc-section-text,
.iapc-admin-ai-promo-content p:not(.iapc-admin-ai-subtitle) {
    margin: 0 0 12px;
    padding: 0;
    max-width: none;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: #64748b;
    text-align: center;
}

.iapc-admin-ai-subtitle {
    text-align: center;
    font-size: 15px;
    line-height: 1.6;
}

.iapc-admin-ai-promo-content .iapc-section-text strong,
.iapc-admin-ai-promo-content p:not(.iapc-admin-ai-subtitle) strong {
    font-weight: 600;
    color: #475569;
}

.iapc-ai-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.iapc-ai-status-item {
    padding: 16px;
    background: #fff;
    border: 1px solid #ece7ff;
    border-radius: 12px;
}

.iapc-ai-status-item span {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #6b7280;
}

.iapc-ai-status-item strong {
    font-size: 15px;
}

.iapc-ai-heading{
    display:block;
    margin-bottom:12px;
}

.iapc-ai-heading label{
    display:block !important;
    float:none !important;
    width:100% !important;
    margin:0 0 6px !important;
    font-weight:600;
    text-align:left;
}

.iapc-ai-heading .iapc-ai-help{
    display:block !important;
    margin:0 !important;
    padding:0 !important;
    text-align:left;
    color:#6b7280;
}



.iapc-ai-field input,
.iapc-ai-field textarea {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
}

.iapc-ai-field label {
    display: block;
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

.iapc-ai-license-field {
    margin-bottom: 8px;
}

.iapc-ai-license-input.is-locked,
.iapc-ai-license-input:disabled {
    background: #f8fafc;
    color: #64748b;
    border-color: #dcdcde;
    cursor: not-allowed;
}

.iapc-ai-license-note {
    margin: 8px 0 0 !important;
    padding: 0 !important;
}

.iapc-admin-ai-premium-box .notice.inline {
    margin: 12px 0 16px !important;
    padding: 8px 12px !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: none;
    border-left: 4px solid #c3c4c7;
    border-radius: 0;
    box-shadow: none !important;
}

.iapc-admin-ai-premium-box .notice.inline.notice-warning {
    background-color: #fcf9e8;
    border-left-color: #dba617;
}

.iapc-admin-ai-premium-box .notice.inline.notice-error {
    background-color: #fcf0f1;
    border-left-color: #d63638;
}

.iapc-admin-ai-premium-box .notice.inline.notice-success {
    background-color: #edfaef;
    border-left-color: #00a32a;
}

.iapc-admin-ai-premium-box .notice.inline p {
    margin: 0.4em 0 !important;
    padding: 2px !important;
    font-size: 13px;
    line-height: 1.5;
}

.iapc-ai-license-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 0 0 24px;
}

.iapc-ai-field .iapc-ai-help {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: #64748b;
}

.iapc-admin-ai-premium-box .iapc-section-text,
.iapc-admin-ai-premium-box .iapc-ai-license-note {
    font-size: 15px;
}

.iapc-admin-ai-promo-bottom {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.iapc-ai-field textarea {
    min-height: 120px;
    resize: vertical;
}




.iapc-admin-ai-license-btn,
.iapc-admin-ai-premium-btn {
    float: none !important;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    margin: 0 !important;

    min-height: 30px;             
    padding: 8px 22px !important;  

    background: linear-gradient(135deg, #7c3aed, #9333ea) !important;
    border: 0 !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700 !important;
    text-decoration: none;
    cursor: pointer;
}

.iapc-admin-ai-disconnect-btn {
    float: none !important;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    margin: 0 !important;
    min-height: 30px;
    padding: 8px 22px !important;
    border: 1px solid #dba5a5 !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #b32d2e !important;
    font-size: 15px;
    font-weight: 600 !important;
    cursor: pointer;
}

.iapc-admin-ai-disconnect-btn:hover {
    background: #fcf0f0 !important;
    color: #8a2424 !important;
}


@media (max-width: 900px) {
    .iapc-admin-section,
    .iapc-integration-mode-box {
        margin: 10px 0 24px;
        padding: 28px 18px;
    }

    .iapc-admin-ai-promo-content,
    .iapc-admin-ai-premium-box {
        margin: 10px 0 24px;
        padding: 30px 20px;
    }

    .iapc-ai-status-grid {
        grid-template-columns: 1fr;
    }

    .iapc-admin-ai-license-btn,
    .iapc-admin-ai-premium-btn,
    .iapc-admin-ai-disconnect-btn {
        width: 100% !important;
    }

    .iapc-ai-license-actions {
        justify-content: stretch;
        flex-direction: column;
    }
}