/**
 * Estilos para el campo Link Artesan con modal personalizado
 */

/* Modal Base */
.acf-link-artesan-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 160000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.acf-link-artesan-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.acf-link-artesan-modal-content {
    position: relative;
    z-index: 2;
    background: #fff;
    width: 100%;
    max-width: 1080px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: visible;
}

/* Modal Header */
.acf-link-artesan-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.acf-link-artesan-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.acf-link-artesan-modal-close {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #666;
    transition: color 0.2s;
}

.acf-link-artesan-modal-close:hover {
    color: #000;
}

.acf-link-artesan-modal-close .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
}

/* Modal Body */
.acf-link-artesan-modal-body {
    flex: 1;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

/* Sección Superior Personalizada */
.acf-link-artesan-custom-section {
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    transition: background-color 0.5s ease;
}

.acf-link-artesan-custom-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
}

.acf-link-artesan-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.acf-link-artesan-form-row:last-child {
    margin-bottom: 0;
}

.acf-link-artesan-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.acf-link-artesan-form-group-checkbox {
    justify-content: center;
    flex: 0 0 auto;
    min-width: 200px;
}

.acf-link-artesan-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #23282d;
}

.acf-link-artesan-form-group input[type="text"],
.acf-link-artesan-form-group input[type="url"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.acf-link-artesan-form-group input[type="text"]:focus,
.acf-link-artesan-form-group input[type="url"]:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 1px #007cba;
}

.acf-link-artesan-form-group .description {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #646970;
    font-style: italic;
}

/* .acf-link-artesan-form-group-checkbox label,
.acf-link-artesan-form-group-checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    cursor: pointer;
    margin-bottom: 6px;
} */

.acf-link-artesan-form-group-checkboxes {
    display: flex;
    flex-direction: column;
}

.acf-link-artesan-form-group-checkbox input[type="checkbox"],
.acf-link-artesan-form-group-checkboxes input[type="checkbox"] {
    margin: 0;
}

/* Campos bloqueados (readonly) */
.acf-link-artesan-form-group input.is-readonly {
    background-color: #f0f0f1;
    color: #666;
    cursor: not-allowed;
    border-color: #c3c4c7;
}

/* Campo de icono con preview */
.acf-link-artesan-icon-group {
    flex: 1;
}

.acf-link-artesan-icon-input-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.acf-link-artesan-icon-preview {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    font-size: 24px;
    color: #2271b1;
}

.acf-link-artesan-icon-preview.has-icon {
    border-color: #2271b1;
    background: #fff;
}

.acf-link-artesan-icon-preview svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.acf-link-artesan-custom-icon {
    flex: 1;
    min-height: 40px;
    font-size: 14px;
    cursor: text !important;
}

.acf-link-artesan-custom-icon:focus {
    outline: none !important;
    border-color: var(--acf-link-artesan-color-primary) !important;
}

/* Estilos para el popup del iconpicker - usar estilos por defecto del plugin */

/* Información de sincronización */
.acf-link-artesan-sync-info {
    margin-top: 12px;
    padding: 10px 12px;
    background: #e7f5fe;
    border: 1px solid #72aee6;
    border-radius: 4px;
    display: none !important;
}

.acf-link-artesan-sync-info-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #2271b1;
}

.acf-link-artesan-sync-info-content .dashicons {
    flex-shrink: 0;
}

.acf-link-artesan-sync-info-content strong {
    font-weight: 600;
}

/* Botón desvincular */
.wp-core-ui .acf-link-artesan-unlink-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: #d63638;
    border-color: #d63638;
    background: #fff;
    transition: all 0.2s;
}

.acf-link-artesan-unlink-btn:hover {
    background: #d63638;
    color: #fff;
    border-color: #d63638;
}

.acf-link-artesan-unlink-btn .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* Divider */
.acf-link-artesan-divider {
    position: relative;
    padding: 16px 24px;
    text-align: center;
}

.acf-link-artesan-divider::before {
    content: '';
    position: absolute;
    left: 24px;
    right: 24px;
    top: 50%;
    height: 1px;
    background: #ddd;
}

.acf-link-artesan-divider span {
    position: relative;
    display: inline-block;
    padding: 0 12px;
    background: #fff;
    font-size: 13px;
    color: #646970;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabs */
.acf-link-artesan-tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.acf-link-artesan-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.acf-link-artesan-tab:hover {
    background: #eee;
    color: #000;
}

.acf-link-artesan-tab.active {
    background: #fff;
    color: #0073aa;
    border-bottom-color: #0073aa;
}

.acf-link-artesan-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Tab Content */
.acf-link-artesan-tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    /* overflow: hidden; */
}

.acf-link-artesan-tab-content.active {
    display: flex;
}

/* Search */
.acf-link-artesan-search {
    position: relative;
    padding: 16px 24px;
    border-bottom: 1px solid #ddd;
}

.acf-link-artesan-search-input {
    width: 100%;
    padding: 8px 40px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.acf-link-artesan-search .dashicons {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

/* Filters */
.acf-link-artesan-filters {
    padding: 12px 24px;
    background: #fafafa;
    border-bottom: 1px solid #ddd;
}

.acf-link-artesan-post-type-filter,
.acf-link-artesan-taxonomy-filter {
    width: 100%;
    max-width: 300px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Results */
.acf-link-artesan-results {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.acf-link-artesan-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #666;
}

.acf-link-artesan-results:not(:has(.acf-link-artesan-loading)) .acf-link-artesan-loading {
    display: none;
}

/* Result Item */
/* .acf-link-artesan-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
} */

/* .acf-link-artesan-result-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
} */

/* .acf-link-artesan-result-item.selected {
    background: #e6f3ff;
    border-color: #0073aa;
} */

.acf-link-artesan-result-item-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
}

.acf-link-artesan-result-item-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #666;
}

.acf-link-artesan-result-item-content {
    /* flex: 1;
    min-width: 0; */
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.acf-link-artesan-result-item-title {
    font-weight: 600;
    /* margin-bottom: 4px; */
    color: #000;
    font-size: 16px;
}

.acf-link-artesan-result-item-url {
    font-size: 12px;
    color: #666;
    word-break: break-all;
}

.acf-link-artesan-result-item-type {
    font-size: 12px;
    color: var(--dg-muted);
    /* margin-top: 4px; */
}

.acf-link-artesan-result-item-action {
    flex-shrink: 0;
}

.acf-link-artesan-select-item {
    opacity: 0;
    transition: opacity 0.2s;
}

.acf-link-artesan-result-item:hover .acf-link-artesan-select-item {
    opacity: 1;
}

/* Custom Form */
.acf-link-artesan-custom-form {
    padding: 24px;
}

.acf-link-artesan-form-group {
    margin-bottom: 16px;
}

.acf-link-artesan-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.acf-link-artesan-form-group input[type="url"],
.acf-link-artesan-form-group input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Popup Custom Links */
.acf-link-artesan-popup-custom {
    margin-top: 24px;
    padding: 16px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.acf-link-artesan-popup-custom h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
}

.acf-link-artesan-custom-links-list {
    margin-bottom: 12px;
}

.acf-link-artesan-custom-link-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.acf-link-artesan-custom-link-label,
.acf-link-artesan-custom-link-url {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.acf-link-artesan-remove-custom-link {
    padding: 4px 8px;
}

.acf-link-artesan-remove-custom-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.acf-link-artesan-add-custom-link {
    display: flex;
    align-items: center;
    gap: 4px;
}

.acf-link-artesan-add-custom-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Modal Footer */
.acf-link-artesan-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 15px;
    border-top: 1px solid var(--dg-border);
}

/* Campo ACF Link Original */
.acf-field-link-artesan .acf-link {
    position: relative;
}

.acf-field-link-artesan .acf-link .button[data-name="add"],
.acf-field-link-artesan .acf-link .acf-link-artesan-select-btn {
    display: inline-block;
    transition: all 0.2s ease;
}

.acf-field-link-artesan .acf-link .button[data-name="add"]:disabled,
.acf-field-link-artesan .acf-link .acf-link-artesan-select-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.acf-field-link-artesan .acf-link.-value .button[data-name="add"],
.acf-field-link-artesan .acf-link.-value .acf-link-artesan-select-btn {
    display: none;
}

.acf-link-artesan-modal-content .acf-field-link-artesan .acf-link .link-wrap {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.acf-link-artesan-modal-content .acf-field-link-artesan .acf-link.-value .link-wrap {
    display: flex;
}

.acf-field-link-artesan .acf-link .link-title {
    font-weight: 600;
}

.acf-field-link-artesan .acf-link .link-url {
    font-size: 12px;
    color: #666;
    text-decoration: none;
}

.acf-field-link-artesan .acf-link .link-url:hover {
    color: #0073aa;
}

.acf-field-link-artesan .acf-link .acf-icon.-link-ext {
    display: none;
}

.acf-field-link-artesan .acf-link.-external .acf-icon.-link-ext {
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .acf-link-artesan-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .acf-link-artesan-tabs {
        overflow-x: auto;
    }

    /* .acf-link-artesan-tab {
        flex-shrink: 0;
        min-width: 100px;
    } */

    .acf-link-artesan-result-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .acf-link-artesan-result-item-action {
        width: 100%;
    }

    .acf-link-artesan-select-item {
        width: 100%;
        opacity: 1;
    }

    .acf-link-artesan-modal-body {
        overflow: auto;
    }
}

/* Empty State */
.acf-link-artesan-empty-state {
    padding: 40px;
    text-align: center;
    color: #666;
}

.acf-link-artesan-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ccc;
    margin-bottom: 12px;
}

/* Pagination */
.acf-link-artesan-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
    margin-top: 16px;
    border-top: 1px solid #ddd;
}

.acf-link-artesan-pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
}

.acf-link-artesan-pagination button:hover {
    background: #f5f5f5;
}

.acf-link-artesan-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.acf-link-artesan-pagination button.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Error Toast */
.acf-link-artesan-error-toast {
    position: fixed;
    top: 50px;
    right: 20px;
    background: #dc3232;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 999999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    display: flex;
    align-items: center;
    animation: slideInRight 0.3s ease;
}

.acf-link-artesan-error-toast .dashicons {
    margin-right: 8px;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading en botones */
.acf-field-link-artesan .button .spinner {
    float: none;
    margin: 0 5px 0 0;
    width: 16px;
    height: 16px;
}

.acf-field-link-artesan .button .spinner.is-active {
    display: inline-block;
    vertical-align: middle;
}

/* ============================================
 * NUEVO LAYOUT - POPUP LINK EDITOR
 * ============================================

/* Resetear estilos de Tailwind dentro del modal */
/* #acf-link-artesan-modal *,
#acf-link-artesan-modal *::before,
#acf-link-artesan-modal *::after {
    box-sizing: border-box;
} */

.acf-link-artesan-modal .acf-link-artesan-new-wrapper {
    --acf-link-artesan-bg: #ffffff !important;
    --acf-link-artesan-text: #0f172a !important;
    --acf-link-artesan-muted: #64748b !important;
    --acf-link-artesan-border: #e2e8f0 !important;
    --acf-link-artesan-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.08) !important;
    --acf-link-artesan-radius: 16px !important;
    --acf-link-artesan-pad: 16px !important;
    --acf-link-artesan-btn-primary: #2563eb !important;
    --acf-link-artesan-btn-secondary: #0f172a !important;
    --acf-link-artesan-btn-grad-start: #6366f1 !important;
    --acf-link-artesan-btn-grad-end: #06b6d4 !important;
    --acf-link-artesan-ring: #3b82f6 !important;
    --acf-link-artesan-btn-hover: #0f172ad5 !important;

    /* Mantener compatibilidad con variables antiguas */
    --dg-bg: var(--acf-link-artesan-bg);
    --dg-text: var(--acf-link-artesan-text);
    --dg-muted: var(--acf-link-artesan-muted);
    --dg-border: var(--acf-link-artesan-border);
    --dg-shadow: var(--acf-link-artesan-shadow);
    --dg-radius: var(--acf-link-artesan-radius);
    --dg-pad: var(--acf-link-artesan-pad);
    --dg-btn-primary: var(--acf-link-artesan-btn-primary);
    --dg-btn-secondary: var(--acf-link-artesan-btn-secondary);
    --dg-btn-grad-start: var(--acf-link-artesan-btn-grad-start);
    --dg-btn-grad-end: var(--acf-link-artesan-btn-grad-end);
    --dg-ring: var(--acf-link-artesan-ring);
    --dg-btn-hover: var(--acf-link-artesan-btn-hover);

    background: var(--acf-link-artesan-bg) !important;
    border-radius: var(--acf-link-artesan-radius) !important;
    padding: 24px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__container {
    display: flex !important;
    gap: 16px !important;
    flex-direction: row !important;
    align-items: stretch !important;
}

/* Aumentar especificidad para evitar conflictos con Tailwind */
.acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__column {
    background: #fff !important;
    border: 1px solid var(--acf-link-artesan-border) !important;
    border-radius: var(--acf-link-artesan-radius) !important;
    box-shadow: var(--acf-link-artesan-shadow) !important;
    padding: 20px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__column--left {
    width: 68% !important;
    max-width: 68% !important;
}

.acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__column--right {
    width: 32% !important;
    max-width: 32% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

/* Aumentar especificidad para tabs */
.acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__tabs {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    padding: 4px !important;
    background: var(--acf-link-artesan-border) !important;
    border-radius: 10px !important;
    margin-bottom: 20px !important;
    position: relative !important;
    /* Resetear estilos de Tailwind */
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__tabs::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 24px) / 3);
    background: var(--dg-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.acf-link-artesan-new-wrapper .popup-link-editor__tabs[data-active='1']::before {
    transform: translateX(calc(100% + 8px));
}

.acf-link-artesan-new-wrapper .popup-link-editor__tabs[data-active='2']::before {
    transform: translateX(calc(200% + 16px));
}

/* Aumentar especificidad para tabs individuales */
.acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__tabs .tab {
    border: none !important;
    background: transparent !important;
    border-radius: 8px !important;
    padding: 7px 10px !important;
    text-align: center !important;
    cursor: pointer !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--acf-link-artesan-muted) !important;
    transition: all 0.3s ease !important;
    z-index: 2 !important;
    /* Resetear estilos de Tailwind */
    margin: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__tabs .tab.is-active {
    color: var(--acf-link-artesan-text) !important;
}

.acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__tabs .tab:hover:not(.is-active) {
    color: var(--acf-link-artesan-text) !important;
    background: var(--dg-bg) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__panel {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.acf-link-artesan-new-wrapper .popup-link-editor__panel.active {
    display: flex;
}

.acf-link-artesan-new-wrapper .popup-link-editor__panel.is-highlighted {
    background: #e8f5e9;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px #c8e6c9;
    transition: background-color 0.4s ease;
}

.acf-link-artesan-new-wrapper .popup-link-editor__field {
    display: flex;
    /* flex-direction: column; */
    align-items: center;
    gap: 12px;
}

.acf-link-artesan-new-wrapper .popup-link-editor__field label {
    font-weight: 600;
    font-size: 16px;
    color: var(--dg-text);
    width: 32%;
}

.acf-link-artesan-new-wrapper .popup-link-editor__input,
.acf-link-artesan-new-wrapper .popup-link-editor__select {
    width: 68%;
    max-width: 100%;
}

.acf-link-artesan-new-wrapper .popup-link-editor__input,
.acf-link-artesan-new-wrapper .popup-link-editor__textarea {
    border: 1px solid var(--dg-border);
    border-radius: 10px;
    padding: 12px 14px;
    font: inherit;
    font-weight: 500;
    color: var(--dg-text);
    background: #fff;
}

.acf-link-artesan-new-wrapper .popup-link-editor__select {
    border: 1px solid var(--dg-border);
    border-radius: 10px;
    padding: 12px 14px;
    font: inherit;
    font-weight: 500;
    color: var(--dg-text);
    background-position: right 12px center;
}

.acf-link-artesan-new-wrapper .popup-link-editor__textarea {
    resize: vertical;
    min-height: 60px;
    font-family: Consolas, 'Courier New', monospace;
}

.acf-link-artesan-new-wrapper .popup-link-editor__input:focus,
.acf-link-artesan-new-wrapper .popup-link-editor__select:focus,
.acf-link-artesan-new-wrapper .popup-link-editor__textarea:focus {
    border-color: #93c5fd !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
    outline: 2px solid transparent !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__row {
    display: flex;
    /* align-items: center; */
    gap: 10px;
    flex-wrap: wrap;
}

.acf-link-artesan-new-wrapper .popup-link-editor__checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--dg-text);
    cursor: pointer;
}

.acf-link-artesan-new-wrapper .popup-link-editor__checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid var(--dg-text);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
    margin: 0;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.acf-link-artesan-new-wrapper .popup-link-editor__checkbox-label input[type='checkbox']:checked {
    background: var(--dg-text);
    border-color: var(--dg-text);
}

.acf-link-artesan-new-wrapper .popup-link-editor__checkbox-label input[type='checkbox']:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid var(--dg-bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.acf-link-artesan-new-wrapper .popup-link-editor__checkbox-label input[type=checkbox]:checked::before {
    content: none;
}

.acf-link-artesan-new-wrapper .popup-link-editor__checkbox-label input[type="checkbox"]:focus {
    border: 1px solid var(--dg-text);
    box-shadow: none;
    outline: none;
}

.acf-link-artesan-new-wrapper .popup-link-editor__description {
    font-size: 13px;
    color: var(--dg-muted);
}

.acf-link-artesan-new-wrapper .popup-link-editor__icon-wrapper {
    position: relative;
    width: 100%;
}

.acf-link-artesan-new-wrapper .popup-link-editor__icon-wrapper .popup-link-editor__input {
    width: 100%;
    padding-right: 80px !important;
    cursor: pointer !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__icon-wrapper .popup-link-editor__input:not([readonly]) {
    cursor: text !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__icon-clear {
    position: absolute !important;
    right: 45px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background-color: var(--acf-link-artesan-gray-300, #d1d5db) !important;
    border: none !important;
    cursor: pointer !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    transition: background-color 0.2s ease !important;
    z-index: 10 !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__icon-clear:hover {
    background-color: var(--acf-link-artesan-gray-400, #9ca3af) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__icon-clear:active {
    background-color: var(--acf-link-artesan-gray-500, #6b7280) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__icon-clear.has-icon {
    display: flex !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__icon-clear svg {
    display: block !important;
    width: 9px !important;
    height: 9px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__icon-picker-emoji {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 20px !important;
    pointer-events: none !important;
    user-select: none !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__icon-wrapper.is-lucide .popup-link-editor__icon-picker-emoji {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-panel {
    position: absolute !important;
    top: calc(100% + 13px) !important;
    left: 0 !important;
    width: 100% !important;
    background: #f7f7f7 !important;
    display: none !important;
    z-index: 30 !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-panel.is-visible {
    display: block !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-toolbar {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 12px !important;
    border-bottom: 1px solid #ebebeb !important;
    background-color: #f7f7f7 !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-search {
    flex: 1 !important;
    padding-right: 38px !important;
    border-radius: 3px !important;
    padding: 1px 8px !important;
    border-color: rgba(0, 0, 0, .15) !important;
    color: #373737 !important;
    margin: 0 !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-close {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    border: none !important;
    background: #fff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #4b5563 !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-close:hover {
    background: var(--acf-link-artesan-gray-200, #e5e7eb) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-loading {
    display: none !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    color: var(--acf-link-artesan-gray-500, #6b7280) !important;
    margin-bottom: 12px !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-panel.is-loading .popup-link-editor__lucide-loading {
    display: flex !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-list {
    display: grid !important;
    grid-template-columns: repeat(5, max-content) !important;
    justify-content: flex-start !important;
    max-height: 246px !important;
    overflow: hidden !important;
    overflow-y: auto !important;
    padding: 12px 0 12px 12px !important;
    gap: 12px !important;
    background: #fff !important;
    border: 1px solid #f7f7f7 !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-item {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    box-shadow: 0 0 0 1px #ddd !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: none !important;
    background-color: #fff !important;
    padding: 0;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-item:hover {
    background-color: #eee !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-item.is-selected {
    box-shadow: 0 0 0 1px var(--dg-btn-primary, #3b82f6) !important;
    background: rgba(59, 130, 246, 0.1) !important;
}

/* Font Awesome iconpicker - estado seleccionado */
.iconpicker-popover .iconpicker-item.iconpicker-selected {
    background: rgba(59, 130, 246, 0.1) !important;
    box-shadow: 0 0 0 1px var(--dg-btn-primary, #3b82f6) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-item-icon {
    width: 22px !important;
    height: 22px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--dg-text, #111827) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-item-icon svg {
    width: 100% !important;
    height: 100% !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-empty {
    display: none !important;
    text-align: center !important;
    font-size: 13px !important;
    color: var(--acf-link-artesan-gray-500, #6b7280) !important;
    padding: 20px 0 !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-panel.show-empty .popup-link-editor__lucide-empty {
    display: block !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-panel.show-empty .popup-link-editor__lucide-list {
    display: none !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__lucide-item-icon.is-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--acf-link-artesan-gray-300, #d1d5db);
    border-top-color: transparent;
    animation: acf-link-artesan-spin 0.8s linear infinite;
}

@keyframes acf-link-artesan-spin {
    to {
        transform: rotate(360deg);
    }
}

.acf-link-artesan-new-wrapper .iconpicker-popover.popover {
    width: 100% !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__icon-preview {
    width: 56px;
    height: 56px;
    border: 2px solid var(--dg-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--dg-btn-primary);
    background: #f8fafc;
}

.acf-link-artesan-new-wrapper .popup-link-editor__icon-preview.has-icon {
    border-color: var(--dg-btn-primary);
    background: #fff;
}

.acf-link-artesan-new-wrapper .popup-link-editor__search-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 68%;
}

.acf-link-artesan-new-wrapper .popup-link-editor__search-wrapper .popup-link-editor__input {
    width: 100%;
}


.acf-link-artesan-new-wrapper .popup-link-editor__search-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 20px;
    border-radius: 12px;
    border: 1px solid var(--dg-text);
    background: var(--dg-text);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.acf-link-artesan-new-wrapper .popup-link-editor__search-button:hover {
    background: var(--dg-btn-hover);
    color: #fff;
    border-color: var(--dg-btn-hover);
}

.acf-link-artesan-new-wrapper .popup-link-editor__search-button .dashicons {
    margin: 0;
}

.acf-link-artesan-new-wrapper .popup-link-editor__results {
    border: 1px solid var(--dg-border);
    border-radius: 14px;
    height: auto;
    max-height: 295px;
    overflow-y: auto;
    background: #fff;
    padding: 0;
}


.acf-link-artesan-new-wrapper .popup-link-editor__results .acf-link-artesan-result-item {
    margin: 0;
    padding: 20px 16px;
    display: flex;
    background: #fff;
    cursor: pointer;
}

.acf-link-artesan-new-wrapper .popup-link-editor__results .acf-link-artesan-result-item:not(:last-child) {
    border-bottom: 1px solid var(--dg-border);
}

.acf-link-artesan-new-wrapper .popup-link-editor__results .acf-link-artesan-result-item:hover,
.acf-link-artesan-new-wrapper .popup-link-editor__results .acf-link-artesan-result-item.selected {
    background: #f8fafc;
}

.acf-link-artesan-new-wrapper .popup-link-editor__empty-state {
    border: 1px dashed var(--dg-border);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    color: var(--dg-muted);
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-card {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 0;
    box-shadow: var(--dg-shadow);
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-card h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    padding: 15px 20px;
    min-width: 180px;
    border-radius: 60px;
    border: 0;
    cursor: pointer;
    transition: filter 0.15s ease;
    font-size: 16px;
    width: fit-content;
    font-family: var(--primary_font);
}

/* Estilos para el icono dentro del botón de preview */
.acf-link-artesan-new-wrapper .popup-link-editor__preview-icon {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-icon.has-icon {
    display: inline-flex;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-icon .acf-link-artesan-preview-icon-display {
    display: inline-block;
    line-height: 1;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-text {
    display: inline-block;
}

/* Hover genérico solo cuando es default */
.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn[data-hover="default"]:hover,
.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn:not([data-hover]):hover {
    filter: brightness(1.08);
}

.acf-link-artesan-new-wrapper .popup-link-editor__section {
    background: #fff;
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 15px;
    cursor: pointer;
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-header:hover h3 {
    text-decoration: underline;
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dg-muted);
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease, color 0.2s ease;
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-toggle:hover {
    color: var(--dg-text);
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-toggle .dashicons {
    transition: transform 0.3s ease;
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-toggle[aria-expanded="false"] .dashicons {
    transform: rotate(180deg);
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-body {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 2000px;
    opacity: 1;
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-body.is-collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    margin-bottom: 0;
    border-bottom: none;
    overflow: hidden;
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-body .popup-link-editor__field {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-body .popup-link-editor__field label,
.acf-link-artesan-new-wrapper .popup-link-editor__section-body .popup-link-editor__field input,
.acf-link-artesan-new-wrapper .popup-link-editor__section-body .popup-link-editor__field select,
.acf-link-artesan-new-wrapper .popup-link-editor__icon-wrapper .popup-link-editor__field textarea,
.acf-link-artesan-new-wrapper .popup-link-editor__icon-wrapper input.setting-icon-selector {
    width: 100%;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preset {
    border: 1px solid var(--dg-border);
    border-radius: 12px;
    padding: 8px;
    background: #fff;
    text-align: left;
    cursor: default;
    color: var(--dg-text);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preset.is-active {
    border-color: var(--dg-btn-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.acf-link-artesan-new-wrapper .popup-link-editor__preset:focus-visible {
    outline: 2px solid var(--dg-ring);
}

.acf-link-artesan-new-wrapper .popup-link-editor__preset-swatch {
    height: 36px;
    border-radius: 8px;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preset-swatch--primary {
    background: var(--dg-btn-primary);
}

.acf-link-artesan-new-wrapper .popup-link-editor__preset-swatch--secondary {
    background: var(--dg-btn-secondary);
}

.acf-link-artesan-new-wrapper .popup-link-editor__preset-swatch--gradient {
    background-image: linear-gradient(90deg, var(--dg-btn-grad-start), var(--dg-btn-grad-end));
}

.acf-link-artesan-new-wrapper .popup-link-editor__field.popup-link-editor__field--actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-body .popup-link-editor__field--inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.acf-link-artesan-new-wrapper .popup-link-editor__section-body .popup-link-editor__field--inline label {
    display: block;
    margin-bottom: 5px;
}

.acf-link-artesan-new-wrapper .button-darker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 20px;
    border-radius: 8px;
    border: 1px solid var(--dg-text);
    background: var(--dg-text);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.3s ease;
}

.acf-link-artesan-new-wrapper .button-darker:hover {
    background: var(--dg-btn-hover);
    color: #fff;
    border-color: var(--dg-btn-hover);
}

.acf-link-artesan-new-wrapper .button-shadow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 20px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--dg-text);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.acf-link-artesan-new-wrapper .button-shadow:hover {
    background: #F1F5F9;
    color: var(--dg-text);
}

.acf-link-artesan-new-wrapper .popup-link-editor__column--right .button.button-primary {
    background: var(--dg-text);
    border-color: var(--dg-text);
    border-radius: 12px;
    font-weight: 600;
    padding: 5px 16px;
    font-size: 15px;
}

.acf-link-artesan-new-wrapper .popup-link-editor__column--right .button.button-primary:hover {
    filter: brightness(1.05);
}

/* .acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.is-gradient {
    background-image: linear-gradient(90deg, var(--dg-btn-grad-start), var(--dg-btn-grad-end));
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.is-secondary {
    background: var(--dg-btn-secondary);
} */

/* Aplicar clases de color de botón del tema al botón de preview */
/* Las clases color-boton-X-normal ya aplican background-color desde el tema */
/* Solo necesitamos sobrescribir el background por defecto cuando tiene la clase */
.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.color-boton-1-normal {
    background: var(--color-boton-1-normal) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.color-boton-2-normal {
    background: var(--color-boton-2-normal) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.color-boton-3-normal {
    background: var(--color-boton-3-normal) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.color-boton-4-normal {
    background: var(--color-boton-4-normal) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.color-boton-5-normal {
    background: var(--color-boton-5-normal) !important;
}

/* Aplicar color de texto si existe la clase correspondiente */
.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.color-boton-1-texto-normal {
    color: var(--color-boton-1-texto-normal) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.color-boton-2-texto-normal {
    color: var(--color-boton-2-texto-normal) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.color-boton-3-texto-normal {
    color: var(--color-boton-3-texto-normal) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.color-boton-4-texto-normal {
    color: var(--color-boton-4-texto-normal) !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.color-boton-5-texto-normal {
    color: var(--color-boton-5-texto-normal) !important;
}

/* Border and hover for the preview button */

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.is-rounded {
    border-radius: 12px !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn.is-square {
    border-radius: 0 !important;
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn[data-hover="hover1"]:hover {
    filter: contrast(0.55);
}

.acf-link-artesan-new-wrapper .popup-link-editor__preview-btn[data-hover="hover2"]:hover {
    filter: sepia(2);
}

@media (max-width: 1200px) {
    .acf-link-artesan-modal .acf-link-artesan-new-wrapper {
        padding: 15px !important;
    }

    .acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__container {
        flex-direction: column !important;
    }

    .acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__column--left,
    .acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__column--right {
        width: 100% !important;
        max-width: 100% !important;
    }

    .acf-link-artesan-new-wrapper .popup-link-editor__column--right {
        position: sticky;
        top: 16px;
    }
}

@media (max-width: 768px) {
    .acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-bottom: 10px !important;
    }

    .acf-link-artesan-modal .acf-link-artesan-new-wrapper .popup-link-editor__column,
    .acf-link-artesan-new-wrapper .popup-link-editor__preview-card {
        padding: 15px !important;
    }

    .acf-link-artesan-new-wrapper .popup-link-editor__field--inline {
        grid-template-columns: 1fr;
    }

    .acf-link-artesan-new-wrapper .popup-link-editor__search-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .acf-link-artesan-new-wrapper .popup-link-editor__search-button {
        justify-content: center;
    }
}